I have this super simple DAG with one task that's trying to execute a query on Snowflake
default_args = {
'owner': 'POC project',
'depends_on_past': False,
'start_date': datetime(2021, 6, 14),
'email_on_failure': False,
'email_on_retry': False,
'retries': 1,
'retry_delay': timedelta(minutes=5)
}
query_test = "select current_date() as date;"
SNOWFLAKE_CONN_ID = """{
"conn_type": "snowflake",
"login": "zz__poc",
"password": "123456",
"schema": "users",
"extra": {
"account": "snf_account_poc",
"database": "POC_DB",
"region": "us-east",
"warehouse": "POC_S_WH"
}
}"""
dag = DAG(
dag_id = 'SNOWFLAKE_QUERY',
default_args=default_args,
schedule_interval=timedelta(days=1),
max_active_runs=1,
catchup=False
)
#
# Connection Test
snowflake = SnowflakeOperator(
task_id='test_snowflake_connection',
sql=query_test,
snowflake_conn_id=SNOWFLAKE_CONN_ID,
dag=dag
)
I'm getting this following error:
{standard_task_runner.py:107} ERROR - Failed to execute job 26 for task test_snowflake_connection (The conn_id `{
"conn_type": "snowflake",
"login": "zz__poc",
"password": "123456",
"schema": "users",
"extra": {
"account": "snf_account_poc",
"database": "POC_DB",
"region": "us-east",
"warehouse": "POC_S_WH"
}
}` isn't defined; 769
)
I'm pretty sure that all Snowflake credentials are correct. Can anyone give an example on how to properly use SnowflakeOperator or explain what the issue is with my code?