You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "anamargaridarl (via GitHub)" <gi...@apache.org> on 2023/03/08 13:20:30 UTC

[GitHub] [airflow] anamargaridarl opened a new issue, #29975: SnowflakeHook get_records() - 'list' object has no attribute 'sfqid

anamargaridarl opened a new issue, #29975:
URL: https://github.com/apache/airflow/issues/29975

   ### Apache Airflow version
   
   Other Airflow 2 version (please specify below)
   
   ### What happened
   
   Airflow version 2.4.0
   
   All the dags using SnowflakeHook started failing with the following error:
   
   ```
   [2023-03-08, 11:22:02 UTC] {taskinstance.py:1851} ERROR - Task failed with exception
   Traceback (most recent call last):
     File "/home/airflow/.local/lib/python3.8/site-packages/airflow/operators/python.py", line 175, in execute
       return_value = self.execute_callable()
     File "/home/airflow/.local/lib/python3.8/site-packages/airflow/operators/python.py", line 193, in execute_callable
       return self.python_callable(*self.op_args, **self.op_kwargs)
     File "/opt/airflow/xxx.py", line 37, in xxxx
       data_rows = dwh_hook.get_records(query)
     File "/home/airflow/.local/lib/python3.8/site-packages/airflow/providers/common/sql/hooks/sql.py", line 235, in get_records
       return self.run(sql=sql, parameters=parameters, handler=fetch_all_handler)
     File "/home/airflow/.local/lib/python3.8/site-packages/airflow/providers/snowflake/hooks/snowflake.py", line 341, in run
       query_id = cur.sfqid
   AttributeError: 'list' object has no attribute 'sfqid
   ```
   
   Could someone help me understand why this is happening? 
   Thank you
   
   
   ### What you think should happen instead
   
   The dag should run normally.
   
   ### How to reproduce
   
   Run the function get_records() with the SnowflakeHook
   
   ### Operating System
   
   linux debian
   
   ### Versions of Apache Airflow Providers
   
   apache-airflow-providers-airbyte==2.1.1
   apache-airflow-providers-celery==3.1.0
   apache-airflow-providers-cncf-kubernetes==1.0.0
   apache-airflow-providers-common-sql==1.3.3
   apache-airflow-providers-ftp==3.3.1
   apache-airflow-providers-http==4.1.1
   apache-airflow-providers-imap==3.1.1
   apache-airflow-providers-opsgenie==4.0.0
   apache-airflow-providers-slack==5.1.0
   apache-airflow-providers-snowflake==3.1.0
   apache-airflow-providers-sqlite==3.3.1
   
   ### Deployment
   
   Official Apache Airflow Helm Chart
   
   ### Deployment details
   
   _No response_
   
   ### Anything else
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [X] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] eladkal commented on issue #29975: SnowflakeHook get_records() - 'list' object has no attribute 'sfqid

Posted by "eladkal (via GitHub)" <gi...@apache.org>.
eladkal commented on issue #29975:
URL: https://github.com/apache/airflow/issues/29975#issuecomment-1460164510

   What version of snowflake provider do you use?
   Can you please share reproduce example?
   
   At least from what I see in [Snowflake docs ](https://docs.snowflake.com/en/user-guide/python-connector-example#retrieving-the-snowflake-query-id)
   ```
   # Retrieving a Snowflake Query ID
   cur = con.cursor()
   cur.execute("SELECT * FROM testtable")
   print(cur.sfqid)
   ```
   
   the hook code:
   
   https://github.com/apache/airflow/blob/eff677c418f09690f7e89302368dbff54e7fce75/airflow/providers/snowflake/hooks/snowflake.py#L390
    should work


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] anamargaridarl commented on issue #29975: SnowflakeHook get_records() - 'list' object has no attribute 'sfqid

Posted by "anamargaridarl (via GitHub)" <gi...@apache.org>.
anamargaridarl commented on issue #29975:
URL: https://github.com/apache/airflow/issues/29975#issuecomment-1460483917

   I will close the issue since updating the provider version was enough. 
   Thank you.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] anamargaridarl closed issue #29975: SnowflakeHook get_records() - 'list' object has no attribute 'sfqid

Posted by "anamargaridarl (via GitHub)" <gi...@apache.org>.
anamargaridarl closed issue #29975: SnowflakeHook get_records() - 'list' object has no attribute 'sfqid
URL: https://github.com/apache/airflow/issues/29975


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] boring-cyborg[bot] commented on issue #29975: SnowflakeHook get_records() - 'list' object has no attribute 'sfqid

Posted by "boring-cyborg[bot] (via GitHub)" <gi...@apache.org>.
boring-cyborg[bot] commented on issue #29975:
URL: https://github.com/apache/airflow/issues/29975#issuecomment-1460147611

   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.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org