Skip to content

Conversation

@prdai
Copy link
Contributor

@prdai prdai commented Aug 3, 2025

Closes: #53638, which highlights the lack of meaningful error context when SnowflakeSqlApiOperator fails with a 422 Unprocessable Entity error.

What’s improved:

Enhanced the _process_response method in the Snowflake SQL API hook to extract and log additional error context from the Snowflake response, including:

  • code
  • sqlState
  • statementHandle

This allows users to debug 422 errors with significantly more clarity.

Before:

{ "status": "error", "message": "SQL compilation error" }

After:

{
  "status": "error",
  "message": "SQL compilation error (Code: 000904, SQL State: 42000, Statement Handle: handle123)"
}

Changes:

  • Refactored _process_response to enrich error messages.
  • Added unit tests for error message formatting to cover the new behavior.

Closes: #53638

@prdai
Copy link
Contributor Author

prdai commented Aug 13, 2025

hi, the reason for the failing ci/cd seems to be due to unrelated changes to this pr, what should I do?

logs:

providers/google/src/airflow/providers/google/version_compat.py:64: error: Name "timeout" already defined (possibly by an import)  [no-redef]
        from airflow.utils.timeout import timeout  # type: ignore[assignment]  # type: ignore[assignment]
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
providers/google/src/airflow/providers/google/version_compat.py:64: note: Error code "no-redef" not covered by "type: ignore" comment
providers/openlineage/src/airflow/providers/openlineage/version_compat.py:47: error: Name "timeout" already defined (possibly by an import)  [no-redef]
        from airflow.utils.timeout import timeout  # type: ignore[assignment]
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
providers/openlineage/src/airflow/providers/openlineage/version_compat.py:47: note: Error code "no-redef" not covered by "type: ignore" comment
providers/celery/src/airflow/providers/celery/version_compat.py:34: error: Name "timeout" already defined (possibly by an import)  [no-redef]
        from airflow.utils.timeout import timeout  # type: ignore[assignment]
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
providers/celery/src/airflow/providers/celery/version_compat.py:34: note: Error code "no-redef" not covered by "type: ignore" comment
Found 3 errors in 3 files (checked 3962 source files)

@rawwar
Copy link
Contributor

rawwar commented Aug 13, 2025

hi, the reason for the failing ci/cd seems to be due to unrelated changes to this pr, what should I do?

logs:

providers/google/src/airflow/providers/google/version_compat.py:64: error: Name "timeout" already defined (possibly by an import)  [no-redef]
        from airflow.utils.timeout import timeout  # type: ignore[assignment]  # type: ignore[assignment]
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
providers/google/src/airflow/providers/google/version_compat.py:64: note: Error code "no-redef" not covered by "type: ignore" comment
providers/openlineage/src/airflow/providers/openlineage/version_compat.py:47: error: Name "timeout" already defined (possibly by an import)  [no-redef]
        from airflow.utils.timeout import timeout  # type: ignore[assignment]
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
providers/openlineage/src/airflow/providers/openlineage/version_compat.py:47: note: Error code "no-redef" not covered by "type: ignore" comment
providers/celery/src/airflow/providers/celery/version_compat.py:34: error: Name "timeout" already defined (possibly by an import)  [no-redef]
        from airflow.utils.timeout import timeout  # type: ignore[assignment]
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
providers/celery/src/airflow/providers/celery/version_compat.py:34: note: Error code "no-redef" not covered by "type: ignore" comment
Found 3 errors in 3 files (checked 3962 source files)

I think, they are about to be fixed. Hold on for a while and pull changes from main. - #54471

@rawwar rawwar self-requested a review August 13, 2025 15:18
@potiuk potiuk merged commit 44121bf into apache:main Aug 15, 2025
70 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:providers provider:snowflake Issues related to Snowflake provider

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve error message when SnowflakeSqlApiOperator fails with 422 Unprocessible entity

3 participants