SQL to Google Sheets Transfer Operators

With Google Sheets, everyone can work together in the same spreadsheet at the same time. Use formulas functions, and formatting options to save time and simplify common spreadsheet tasks.

Prerequisite Tasks

To use these operators, you must do a few things:

Upload data from SQL to Google Sheets

To upload data from and Database using SQL to Google Spreadsheet you can use the SQLToGoogleSheetsOperator.

tests/system/providers/google/cloud/sql_to_sheets/example_sql_to_sheets.py[source]

upload_gcs_to_sheet = SQLToGoogleSheetsOperator(
    task_id="upload_sql_to_sheet",
    sql=SQL,
    sql_conn_id=DB_CONNECTION,
    database="test_db",
    spreadsheet_id=SPREADSHEET_ID,
)

You can use Jinja templating with sql, spreadsheet_id, spreadsheet_range, impersonation_chain.

Was this entry helpful?