tests.system.providers.google.cloud.sql_to_sheets.example_sql_to_sheets

First, you need a db instance that is accessible from the Airflow environment. You can, for example, create a Cloud SQL instance and connect to it from within breeze with Cloud SQL proxy: https://cloud.google.com/sql/docs/postgres/connect-instance-auth-proxy

# DB setup Create db: ` CREATE DATABASE test_db; `

Switch to db: ` \c test_db `

Create table and insert some rows ` CREATE TABLE test_table (col1 INT, col2 INT); INSERT INTO test_table VALUES (1,2), (3,4), (5,6), (7,8); `

# Setup connections db connection: In airflow UI, set one db connection, for example “postgres_default” and make sure the “Test” at the bottom succeeds

google cloud connection: We need additional scopes for this test scopes: https://www.googleapis.com/auth/spreadsheets, https://www.googleapis.com/auth/cloud-platform

# Sheet Finally, you need a Google Sheet you have access to, for testing you can create a public sheet and get its ID.

# Tear Down You can delete the db with ` DROP DATABASE test_db; `

Module Contents

tests.system.providers.google.cloud.sql_to_sheets.example_sql_to_sheets.DAG_ID = 'example_sql_to_sheets'[source]
tests.system.providers.google.cloud.sql_to_sheets.example_sql_to_sheets.ENV_ID[source]
tests.system.providers.google.cloud.sql_to_sheets.example_sql_to_sheets.PROJECT_ID[source]
tests.system.providers.google.cloud.sql_to_sheets.example_sql_to_sheets.REGION = 'europe-west2'[source]
tests.system.providers.google.cloud.sql_to_sheets.example_sql_to_sheets.ZONE[source]
tests.system.providers.google.cloud.sql_to_sheets.example_sql_to_sheets.NETWORK = 'default'[source]
tests.system.providers.google.cloud.sql_to_sheets.example_sql_to_sheets.SHEETS_CONNECTION_ID[source]
tests.system.providers.google.cloud.sql_to_sheets.example_sql_to_sheets.SPREADSHEET[source]
tests.system.providers.google.cloud.sql_to_sheets.example_sql_to_sheets.DB_NAME[source]
tests.system.providers.google.cloud.sql_to_sheets.example_sql_to_sheets.DB_PORT = 5432[source]
tests.system.providers.google.cloud.sql_to_sheets.example_sql_to_sheets.DB_USER_NAME = 'demo_user'[source]
tests.system.providers.google.cloud.sql_to_sheets.example_sql_to_sheets.DB_USER_PASSWORD = 'demo_password'[source]
tests.system.providers.google.cloud.sql_to_sheets.example_sql_to_sheets.DB_CONNECTION_ID[source]
tests.system.providers.google.cloud.sql_to_sheets.example_sql_to_sheets.SHORT_MACHINE_TYPE_NAME = 'n1-standard-1'[source]
tests.system.providers.google.cloud.sql_to_sheets.example_sql_to_sheets.DB_INSTANCE_NAME[source]
tests.system.providers.google.cloud.sql_to_sheets.example_sql_to_sheets.GCE_INSTANCE_BODY[source]
tests.system.providers.google.cloud.sql_to_sheets.example_sql_to_sheets.DELETE_PERSISTENT_DISK[source]
tests.system.providers.google.cloud.sql_to_sheets.example_sql_to_sheets.SETUP_POSTGRES[source]
tests.system.providers.google.cloud.sql_to_sheets.example_sql_to_sheets.FIREWALL_RULE_NAME[source]
tests.system.providers.google.cloud.sql_to_sheets.example_sql_to_sheets.CREATE_FIREWALL_RULE[source]
tests.system.providers.google.cloud.sql_to_sheets.example_sql_to_sheets.DELETE_FIREWALL_RULE[source]
tests.system.providers.google.cloud.sql_to_sheets.example_sql_to_sheets.SQL_TABLE = 'test_table'[source]
tests.system.providers.google.cloud.sql_to_sheets.example_sql_to_sheets.SQL_CREATE[source]
tests.system.providers.google.cloud.sql_to_sheets.example_sql_to_sheets.SQL_INSERT[source]
tests.system.providers.google.cloud.sql_to_sheets.example_sql_to_sheets.SQL_SELECT[source]
tests.system.providers.google.cloud.sql_to_sheets.example_sql_to_sheets.log[source]
tests.system.providers.google.cloud.sql_to_sheets.example_sql_to_sheets.create_instance[source]
tests.system.providers.google.cloud.sql_to_sheets.example_sql_to_sheets.test_run[source]

Was this entry helpful?