-
Notifications
You must be signed in to change notification settings - Fork 16.5k
Closed
Labels
area:providerskind:bugThis is a clearly a bugThis is a clearly a bugneeds-triagelabel for new issues that we didn't triage yetlabel for new issues that we didn't triage yetprovider:common-sqlprovider:snowflakeIssues related to Snowflake providerIssues related to Snowflake provider
Description
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:
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?
- Yes I am willing to submit a PR!
Code of Conduct
- I agree to follow this project's Code of Conduct
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area:providerskind:bugThis is a clearly a bugThis is a clearly a bugneeds-triagelabel for new issues that we didn't triage yetlabel for new issues that we didn't triage yetprovider:common-sqlprovider:snowflakeIssues related to Snowflake providerIssues related to Snowflake provider