-
Notifications
You must be signed in to change notification settings - Fork 14.2k
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
KeyError: 0 error with common-sql version 1.3.0 #27978
Comments
Can you please try 1.3.1rc3 (it is going to be released today most likely) |
The issue unfortunately continues to exist with 1.3.1. |
Yeah I was afraid of it. |
This is basically duplicate of #27976. We should fix it in the same way. Closing this one as duplicate. |
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
* 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: #27978 Fixes: #27976
@park-peter - can you please test the new snowflake 4.0.2rc1 and report it in the issue here: #27978 |
* 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
@potiuk with snowflake 4.0.2rc1 and common-sql 1.3.1, I can confirm that things look good! |
Apache Airflow Provider(s)
common-sql
Versions of Apache Airflow Providers
Apache Airflow version
2.4.3
Operating System
Debian Bullseye
Deployment
Astronomer
Deployment details
No response
What happened
With the latest version of common-sql provider, the
get_records
from hook is now a ordinary dictionary, causing this KeyError with SqlSensor:I have only tested with Snowflake, I haven't tested it with other databases. Reverting back to 1.2.0 solves the issue.
What you think should happen instead
It should return an iterable list as usual with the query.
How to reproduce
Anything else
No response
Are you willing to submit PR?
Code of Conduct
The text was updated successfully, but these errors were encountered: