Apache Airflow Provider(s)
snowflake
Versions of Apache Airflow Providers
6.8.2
Apache Airflow version
2.11.0
Operating System
NAME="Amazon Linux" VERSION="2023"
Deployment
Amazon (AWS) MWAA
Deployment details
No response
What happened
When using SnowflakeSqlApiHook HTTP 422 (query failure) responses from the Snowflake SQL API are immediately raised via response.raise_for_status().
Because of this, the response body is never read, and the hook loses the JSON/text payload
returned by Snowflake.
As a result, downstream components (e.g. TriggerEvent logs) only receive a generic ClientResponseError message such as:
422, message='Unprocessable Entity', url='https://<account>.snowflakecomputing.com/...'
What you think should happen instead
We need to pass this payload to _process_response method.
There is already enhanced message payload handler.
How to reproduce
- Submit a Snowflake SQL query that results in a statement-level error, for example:
-
Poll the query status using SnowflakeSqlApiHook.
-
The Snowflake SQL API returns an HTTP 422 (Unprocessable Entity) response.
-
The hook raises an HTTP error via response.raise_for_status(), and the response payload is discarded.
Anything else
I will handle this issue with below issue.
#60689
Are you willing to submit PR?
Code of Conduct
Apache Airflow Provider(s)
snowflake
Versions of Apache Airflow Providers
6.8.2
Apache Airflow version
2.11.0
Operating System
NAME="Amazon Linux" VERSION="2023"
Deployment
Amazon (AWS) MWAA
Deployment details
No response
What happened
When using SnowflakeSqlApiHook HTTP 422 (query failure) responses from the Snowflake SQL API are immediately raised via response.raise_for_status().
Because of this, the response body is never read, and the hook loses the JSON/text payload
returned by Snowflake.
As a result, downstream components (e.g. TriggerEvent logs) only receive a generic ClientResponseError message such as:
What you think should happen instead
We need to pass this payload to _process_response method.
There is already enhanced message payload handler.
How to reproduce
Poll the query status using SnowflakeSqlApiHook.
The Snowflake SQL API returns an HTTP 422 (Unprocessable Entity) response.
The hook raises an HTTP error via response.raise_for_status(), and the response payload is discarded.
Anything else
I will handle this issue with below issue.
#60689
Are you willing to submit PR?
Code of Conduct