-
Notifications
You must be signed in to change notification settings - Fork 208
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: update connection string in Snowflake extractor to include wareh… #357
Conversation
…ouse as param Signed-off-by: Alagappan Sethuraman <[email protected]>
Signed-off-by: Alagappan Sethuraman <[email protected]>
Signed-off-by: Alagappan Sethuraman <[email protected]>
example/dags/snowflake_sample_dag.py
Outdated
database=SNOWFLAKE_DATABASE, | ||
warehouse=warehouse, | ||
) | ||
return "snowflake://%s:%s@%s" % (user, password, account, warehouse) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return "snowflake://%s:%s@%s" % (user, password, account, warehouse) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess one return statement will do!?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes. updated it. 👍
database=SNOWFLAKE_DATABASE, | ||
warehouse=warehouse, | ||
) | ||
return "snowflake://%s:%s@%s" % (user, password, account, warehouse) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return "snowflake://%s:%s@%s" % (user, password, account, warehouse) |
Same here
Signed-off-by: Alagappan Sethuraman <[email protected]>
ping. can we merge this one, please? |
example/dags/snowflake_sample_dag.py
Outdated
@@ -69,15 +69,23 @@ | |||
SUPPORTED_SCHEMA_SQL_IN_CLAUSE = "('{schemas}')".format(schemas="', '".join(SUPPORTED_SCHEMAS)) | |||
|
|||
# SNOWFLAKE CONFIGs | |||
SNOWFLAKE_DATABASE_KEY = 'YOUR_SNOWFLAKE_DB_NAME' | |||
SNOWFLAKE_DATABASE = 'YOUR_SNOWFLAKE_DB_NAME' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why we make this change when it still uses
SNOWFLAKE_DATABASE_KEY = 'snowflake_database' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah. I think we went back and forth on the other PR. Let me just use what is in snowflake_metadata_extractor.py
to keep them consistent for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sounds good, yeap, let's keep it consistent.
return "snowflake://%s:%s@%s" % (user, password, account) | ||
# specify a warehouse to connect to. | ||
warehouse = 'yourwarehouse' | ||
return 'snowflake://{user}:{password}@{account}/{database}?warehouse={warehouse}'.format( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not familiar with snowflake connection string format, you need to put the doc on how it defines the conn string as comment here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. I will add some comments and make it clear. Will update both the files.
@@ -31,7 +30,7 @@ | |||
# Disable snowflake logging | |||
logging.getLogger("snowflake.connector.network").disabled = True | |||
|
|||
SNOWFLAKE_DATABASE_KEY = 'YourSnowflakeDbName' | |||
SNOWFLAKE_DATABASE = 'YourSnowflakeDbName' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and has this been tested?
Also Alagappan, I will be out until next Tue, so my response will be slow in the mean time. hope it is ok. |
No problem. thanks for the heads up! |
|
let me know if you update the pr based on the discussion. |
Signed-off-by: Alagappan <[email protected]>
06f1310
to
16b6931
Compare
@feng-tao updated PR based on comments. Let me know if this is good. thanks! |
…ouse as param
Signed-off-by: Alagappan Sethuraman [email protected]
Summary of Changes
Updated Snowflake sample data loader script and DAG to include warehouse in the connection string. Without the
warehouse
param, snowflake throws an error asking to select a warehouse viaUSE [WAREHOUSE_NAME]
command before executing extraction query.CheckList
Make sure you have checked all steps below to ensure a timely review.
make test