tests.system.google.cloud.sql_to_sheets.example_sql_to_sheets

Example DAG using SQLToGoogleSheetsOperator.

This DAG relies on the following OS environment variables

  • AIRFLOW__API__GOOGLE_KEY_PATH - Path to service account key file. Note, you can skip this variable if you run this DAG in a Composer environment.

Attributes

DAG_ID

ENV_ID

PROJECT_ID

REGION

ZONE

NETWORK

CONNECTION_ID

CONNECTION_TYPE

BUCKET_NAME

FILE_NAME

DB_NAME

DB_PORT

DB_USER_NAME

DB_USER_PASSWORD

SETUP_POSTGRES_COMMAND

SQL_TABLE

SQL_CREATE

SQL_INSERT

SQL_SELECT

GCE_MACHINE_TYPE

GCE_INSTANCE_NAME

GCE_INSTANCE_BODY

FIREWALL_RULE_NAME

CREATE_FIREWALL_RULE_COMMAND

DELETE_FIREWALL_RULE_COMMAND

SHEETS_CONNECTION_ID

SPREADSHEET

log

create_gce_instance

test_run

Module Contents

tests.system.google.cloud.sql_to_sheets.example_sql_to_sheets.DAG_ID = 'sql_to_sheets'[source]
tests.system.google.cloud.sql_to_sheets.example_sql_to_sheets.ENV_ID[source]
tests.system.google.cloud.sql_to_sheets.example_sql_to_sheets.PROJECT_ID[source]
tests.system.google.cloud.sql_to_sheets.example_sql_to_sheets.REGION = 'europe-west2'[source]
tests.system.google.cloud.sql_to_sheets.example_sql_to_sheets.ZONE = 'europe-west2-a'[source]
tests.system.google.cloud.sql_to_sheets.example_sql_to_sheets.NETWORK = 'default'[source]
tests.system.google.cloud.sql_to_sheets.example_sql_to_sheets.CONNECTION_ID = ''[source]
tests.system.google.cloud.sql_to_sheets.example_sql_to_sheets.CONNECTION_TYPE = 'postgres'[source]
tests.system.google.cloud.sql_to_sheets.example_sql_to_sheets.BUCKET_NAME = 'bucket_sql_to_sheets_Uninferable'[source]
tests.system.google.cloud.sql_to_sheets.example_sql_to_sheets.FILE_NAME = 'result.json'[source]
tests.system.google.cloud.sql_to_sheets.example_sql_to_sheets.DB_NAME = 'testdb'[source]
tests.system.google.cloud.sql_to_sheets.example_sql_to_sheets.DB_PORT = 5432[source]
tests.system.google.cloud.sql_to_sheets.example_sql_to_sheets.DB_USER_NAME = 'root'[source]
tests.system.google.cloud.sql_to_sheets.example_sql_to_sheets.DB_USER_PASSWORD = 'demo_password'[source]
tests.system.google.cloud.sql_to_sheets.example_sql_to_sheets.SETUP_POSTGRES_COMMAND = Multiline-String[source]
Show Value
"""
sudo apt update &&
sudo apt install -y docker.io &&
sudo docker run -d -p 5432:5432 --name testdb     -e PGUSER=root     -e POSTGRES_USER=root     -e POSTGRES_PASSWORD=demo_password     -e POSTGRES_DB=testdb     postgres
"""
tests.system.google.cloud.sql_to_sheets.example_sql_to_sheets.SQL_TABLE = 'test_table'[source]
tests.system.google.cloud.sql_to_sheets.example_sql_to_sheets.SQL_CREATE = 'CREATE TABLE IF NOT EXISTS test_table (col_1 INT, col_2 VARCHAR(8))'[source]
tests.system.google.cloud.sql_to_sheets.example_sql_to_sheets.SQL_INSERT = "INSERT INTO test_table (col_1, col_2) VALUES (1, 'one'), (2, 'two')"[source]
tests.system.google.cloud.sql_to_sheets.example_sql_to_sheets.SQL_SELECT = 'SELECT * FROM test_table'[source]
tests.system.google.cloud.sql_to_sheets.example_sql_to_sheets.GCE_MACHINE_TYPE = 'n1-standard-1'[source]
tests.system.google.cloud.sql_to_sheets.example_sql_to_sheets.GCE_INSTANCE_NAME = ''[source]
tests.system.google.cloud.sql_to_sheets.example_sql_to_sheets.GCE_INSTANCE_BODY[source]
tests.system.google.cloud.sql_to_sheets.example_sql_to_sheets.FIREWALL_RULE_NAME = ''[source]
tests.system.google.cloud.sql_to_sheets.example_sql_to_sheets.CREATE_FIREWALL_RULE_COMMAND[source]
tests.system.google.cloud.sql_to_sheets.example_sql_to_sheets.DELETE_FIREWALL_RULE_COMMAND[source]
tests.system.google.cloud.sql_to_sheets.example_sql_to_sheets.SHEETS_CONNECTION_ID = 'connection_sql_to_sheets_Uninferable'[source]
tests.system.google.cloud.sql_to_sheets.example_sql_to_sheets.SPREADSHEET[source]
tests.system.google.cloud.sql_to_sheets.example_sql_to_sheets.log[source]
tests.system.google.cloud.sql_to_sheets.example_sql_to_sheets.create_gce_instance[source]
tests.system.google.cloud.sql_to_sheets.example_sql_to_sheets.test_run[source]

Was this entry helpful?