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

   ### Apache Airflow Provider(s)
   
   snowflake
   
   ### Versions of Apache Airflow Providers
   
   apache-airflow-providers-snowflake==6.2.1
   apache-airflow-providers-common-sql==1.25.0
   
   ### Apache Airflow version
   
   2.10.5
   
   ### Operating System
   
   macOS
   
   ### Deployment
   
   Docker-Compose
   
   ### Deployment details
   
   _No response_
   
   ### What happened
   
   When calling `SnowflakeHook().get_records()` in a DAG, the following 
deprecation warning is raised:
   
   ```
   WARNING - 
/usr/local/lib/python3.12/site-packages/airflow/providers/snowflake/hooks/snowflake.py:479
 DeprecationWarning: Import of return_single_query_results from the 
'airflow.providers.common.sql.hooks' module is deprecated and will
   be removed in the future. Please import it from 
'airflow.providers.common.sql.hooks.handlers'.
   ```
   
   The warning happens because SnowflakeHook is still importing 
`return_single_query_results` from the old location.
   
   ### What you think should happen instead
   
   SnowflakeHook should import `return_single_query_results` from 
`airflow.providers.common.sql.hooks.handlers`, per the self-deprecation 
introduced in #43747.
   
   ### How to reproduce
   
   Run the following minimal DAG using Airflow 2.10.5 and the mentioned 
provider versions:
   ```py
   from datetime import datetime, timedelta
   from airflow.decorators import dag, task
   from airflow.providers.snowflake.hooks.snowflake import SnowflakeHook
   
   
   default_args = {
       'owner': 'airflow',
       'depends_on_past': False,
       'email_on_failure': False,
       'email_on_retry': False,
   }
   
   @dag(
       default_args=default_args,
       schedule_interval=timedelta(days=1),
       start_date=datetime(2025, 4, 1),
       catchup=False,
   )
   def snowflake_hook_dag():
       @task(multiple_outputs=True)
       def query_snowflake_raw_items():
           sql_query = "SELECT * FROM RAW_ITEMS LIMIT 10"
           dwh_hook = SnowflakeHook(snowflake_conn_id="snowflake_default")
           query_result = dwh_hook.get_records(sql_query)
   
           return {"qr": query_result}
           
       query_snowflake_raw_items()
   
   snowflake_hook_dag()
   ```
   
   ### Anything else
   
   This is likely a missed import migration that should be updated post 
`common-sql` handler refactor
   
   ### 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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to