Skip to content

Conversation

@dilshadshaik3031
Copy link
Contributor

Fixes #60765

Preserve and surface the response payload when Snowflake returns HTTP 422
during OAuth token retrieval, improving debuggability for users.

Copy link
Contributor

@Ajay9704 Ajay9704 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All changes made by hooks:
diff --git a/providers/snowflake/src/airflow/providers/snowflake/hooks/snowflake.py b/providers/snowflake/src/airflow/providers/snowflake/hooks/snowflake.py
index 3490427..7439dd0 100644
--- a/providers/snowflake/src/airflow/providers/snowflake/hooks/snowflake.py
+++ b/providers/snowflake/src/airflow/providers/snowflake/hooks/snowflake.py
@@ -519,9 +519,7 @@ class SnowflakeHook(DbApiHook):
response = e.response
if response is not None and response.status_code == 422:
payload = response.text if response is not None else ""
raise AirflowException(
f"Snowflake returned HTTP 422 with payload: {payload}"
)

  •            raise AirflowException(f"Snowflake returned HTTP 422 with payload: {payload}")
          raise
    
      token = response.json()["access_token"]
    

Error: Process completed with exit code 1.

prehooks made some changes , so you have to fix those inorder to pass static checks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:helm-chart Airflow Helm Chart area:providers kind:documentation provider:snowflake Issues related to Snowflake provider

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Snowflake: Preserve 422 response payload instead of raising HTTP error.

2 participants