Closed tzachz closed 1 week ago
Thank you @tzachz for creating the issue, we will look into it and fix it soon in upcoming release
Unfortunately, SnowflakeOperatorAsync
currently extends SnowflakeOperator
, which has been deprecated. We're using conn_id
in the superclass to initialize the connection parameter in SQLExecuteQueryOperator. Based on the example you have shared, it seems you're attempting to extend SnowflakeOperatorAsync to create a new custom operator and not directly using it. If you're planning to create the operator MySnowflakeOperator, I recommend considering SQLExecuteQueryOperator as the appropriate class to extend, rather than SnowflakeOperatorAsync.
Closing as per @pankajastro 's suggestion. Please re-open if required
Describe the bug It seems that there are inconsistencies between
SnowflakeOperatorAsync
and its super class,SnowflakeOperator
. TheSnowflakeOperator
expects asnowflake_conn_id
argument (see here), but when this constructor is called fromSnowflakeOperatorAsync
constructor, it's called withconn_id
instead (here):This practically means that the
conn_id
argument gets bundled intokwargs
withinSnowflakeOperator.__init__
, but thenSnowflakeOperator
calls its parent's__init__
method (SQLExecuteQueryOperator.__init__
) with an explicitconn_id=
argument - in addition to passing along thekwargs
. This results in the following DAG import error:I'm using versions:
2.9.1
11.4.01
1.19.0
5.4.0
To Reproduce Create the following simple operator:
Use it in a DAG:
Deploy this DAG.
Expected behavior DAG is imported successfully
Screenshots Instead, DAG cannot be imported:![image](https://github.com/astronomer/astronomer-providers/assets/2573953/aca2e094-8ab5-4212-b3ac-38e051252981)
Desktop (please complete the following information):
Potential fix The fix seems to be trivial - replace the
conn_id=snowflake_conn_id
withsnowflake_conn_id=snowflake_conn_id
when callingSnowflakeOperator
's__init__
method fromSnowflakeOperatorAsync.__init__
.