-
Notifications
You must be signed in to change notification settings - Fork 14.3k
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
SnowflakeSqlApiOperator not resolving parameters in SQL #42033
Comments
Thanks for opening your first issue here! Be sure to follow the issue template! If you are willing to raise PR to address this issue please do so, no need to wait for approval. |
…ement SQL requests. - added warning for multi-statement query bindings in Snowflake hook test: added unit test for multi-statement bindings warning Related: apache#42033
@chris-okorodudu You can add bindings as a keyword argument within Here is an example:
or more details on the correct format, please refer to the following article: sql-api-bind-variables |
While no entirely fixed - seems that this is on the snowflake side and #42719 at least provides an explanation. |
…ement SQL requests. (apache#42719) - added warning for multi-statement query bindings in Snowflake hook test: added unit test for multi-statement bindings warning Related: apache#42033
…ement SQL requests. (apache#42719) - added warning for multi-statement query bindings in Snowflake hook test: added unit test for multi-statement bindings warning Related: apache#42033
Apache Airflow version
2.9.3
If "Other Airflow 2 version" selected, which one?
No response
What happened?
The SnowflakeSqlApiOperator does not resolve parameters in SQL despite accepting this param:
This is due to the fact that it executes by initializing a
SnowflakeSqlApiHook
and then executing the queries without ever passing the parameters:This means that parameters passed in and then referenced how they would be in other Snowflake operators -
%(param)s
- will not be resolved and cause the execution to fail.What you think should happen instead?
The parameters should be resolved either before the sql is passed to the
SnowflakeSqlApiHook
, or as part of theSnowflakeSqlApiHook
.How to reproduce
To reproduce, try passing any parameter and referencing it in your SQL via this syntax
%(param)s
Operating System
all
Versions of Apache Airflow Providers
Tested with multiple versions, most recently
The text was updated successfully, but these errors were encountered: