-
Notifications
You must be signed in to change notification settings - Fork 16.3k
Make Snowflake Hook conform to semantics of DBApi #28006
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
Make Snowflake Hook conform to semantics of DBApi #28006
Conversation
|
If this one will be ok for others, I will fix all failing tests (if there will be some) and add a set of tests like I did for Databricks Hook: https://github.com/apache/airflow/blob/main/tests/providers/databricks/hooks/test_databricks_sql.py |
|
cc: @kazanzhy @denimalpaca . This is hopefull the LAST (🤞 ) of standardising Hook's run() behaviour. And I hope later on we might be even able to switch to using the common.sql one for both Snowflake and Exasol (they are the two remaining Hooks with custom run() - but after this change, they are conforming to the same semantics, so we should be able to replace the custom run() methods easily. |
|
Ah... Tests passed so we REALLY need to add more tests, because we do not test what we should :) |
e1503d0 to
931d08f
Compare
|
I addeed million tests - similar as we have in Databricks case (and it's good I did - I found few issues). |
vincbeck
left a comment
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.
One minor comment, otherwise LGTM
931d08f to
13b60d5
Compare
13b60d5 to
58065aa
Compare
58065aa to
09c4957
Compare
This is a breaking change, that changes return value of the Hook, however it keeps compatibility with regards of the value returned by the SnowflakeOperator (so DAGs using the operator should be unaffected). You can also switch back to the Dictionary returned by Hooks by specifying ``return_dictionaries`` parameter to run method of the Hook. At the same time SnowflakeHook can be used in a number of generic operators and sensors such as: * SQLColumnCheckOperator * SQLSensor Fixes: apache#27978 Fixes: apache#27976
09c4957 to
4ff1099
Compare
Co-authored-by: Tzu-ping Chung <[email protected]>
Co-authored-by: Tzu-ping Chung <[email protected]>
* Make Snowflake Hook conform to semantics of DBApi This is a breaking change, that changes return value of the Hook, however it keeps compatibility with regards of the value returned by the SnowflakeOperator (so DAGs using the operator should be unaffected). You can also switch back to the Dictionary returned by Hooks by specifying ``return_dictionaries`` parameter to run method of the Hook. At the same time SnowflakeHook can be used in a number of generic operators and sensors such as: * SQLColumnCheckOperator * SQLSensor Fixes: apache#27978 Fixes: apache#27976
This is a breaking change, that changes return value of the Hook, however it keeps compatibility with regards of the value returned by the SnowflakeOperator (so DAGs using the operator should be unaffected).
At the same time SnowflakeHook can be used in a number of generic operators and sensors such as:
Fixes: #27978
Fixes: #27976
^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named
{pr_number}.significant.rstor{issue_number}.significant.rst, in newsfragments.