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

   ### 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
   
   1. Submit a Snowflake SQL query that results in a statement-level error, for 
example:
   ```
   SELECT 1 / 0;
   ```
   2. Poll the query status using SnowflakeSqlApiHook.
   
   3. The Snowflake SQL API returns an HTTP 422 (Unprocessable Entity) response.
   4. 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.
   https://github.com/apache/airflow/pull/60689
   
   ### 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