Skip to content

Log check_query_output response via format string in Snowflake SQL API hook - #67848

Merged
shahar1 merged 1 commit into
apache:mainfrom
michaelneely:fix-snowflakesqlapihook-check-query-output
Jul 24, 2026
Merged

Log check_query_output response via format string in Snowflake SQL API hook#67848
shahar1 merged 1 commit into
apache:mainfrom
michaelneely:fix-snowflakesqlapihook-check-query-output

Conversation

@michaelneely

@michaelneely michaelneely commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Error:SnowflakeSqlApiHook.check_query_output logs the raw response dict, which violates StructuredLogMessage.event's str type.

This prevents logs from being displayed in the UI after a deferred SnowflakeSqlApiOperator finishes executing:

1 validation error for StructuredLogMessage
event
  Input should be a valid string [type=string_type, input_value={'resultSetMetaData': {'n...eatedOn': 1780320202371}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.13/v/string_type

Fix: Log the query response JSON in a templated string, matching the pattern used by other methods in the file.


Was generative AI tooling used to co-author this PR?
  • Yes (please specify the tool below)

  • Read the Pull Request Guidelines for more information. Note: commit author/co-author name and email in commits become permanently public when merged.
  • For fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
  • When adding dependency, check compliance with the ASF 3rd Party License Policy.
  • For significant user-facing changes create newsfragment: {pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.

Important

🛠️ Maintainer triage note for @michaelneely · by @potiuk · 2026-06-17 14:51 UTC

Helpful heads-up from the maintainers — please address before this PR can be reviewed:

  • Failing test jobs: provider distributions tests / Compat 2.11.1:P3.10:, provider distributions tests / Compat 3.0.6:P3.10:, provider distributions tests / Compat 3.1.8:P3.10:, provider distributions tests / Compat 3.2.2:P3.10:. Reproduce and fix locally, then push.
  • See the Pull Request quality criteria.

The ball is in your court — you've been assigned to this PR. Fix the above, then mark it Ready for review.

Automated triage — may be imperfect; a maintainer takes the next look.

@michaelneely
michaelneely requested a review from potiuk as a code owner June 1, 2026 14:30
@boring-cyborg boring-cyborg Bot added area:providers provider:snowflake Issues related to Snowflake provider labels Jun 1, 2026
@boring-cyborg

boring-cyborg Bot commented Jun 1, 2026

Copy link
Copy Markdown

Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contributors' Guide
Here are some useful points:

  • Pay attention to the quality of your code (ruff, mypy and type annotations). Our prek-hooks will help you with that.
  • In case of a new feature add useful documentation (in docstrings or in docs/ directory). Adding a new operator? Check this short guide Consider adding an example Dag that shows how users should use it.
  • Consider using Breeze environment for testing locally, it's a heavy docker but it ships with a working Airflow and a lot of integrations.
  • Be patient and persistent. It might take some time to get a review or get the final approval from Committers.
  • Please follow ASF Code of Conduct for all communication including (but not limited to) comments on Pull Requests, Mailing list and Slack.
  • Be sure to read the Airflow Coding style.
  • Always keep your Pull Requests rebased, otherwise your build might fail due to changes not related to your commits.
    Apache Airflow is a community-driven project and together we are making it better 🚀.
    In case of doubts contact the developers at:
    Mailing List: dev@airflow.apache.org
    Slack: https://s.apache.org/airflow-slack

@michaelneely
michaelneely force-pushed the fix-snowflakesqlapihook-check-query-output branch from 1d32130 to 2f50c84 Compare June 1, 2026 14:33

@henry3260 henry3260 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Good catch

@potiuk potiuk added the ready for maintainer review Set after triaging when all criteria pass. label Jun 3, 2026

@potiuk potiuk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM — lazy %s formatting with the query id is a clear improvement over log.info(response_json), which eagerly stringified and dropped context. Test updated to match. Thanks!


Drafted-by: Claude Code (Opus 4.8); reviewed by @potiuk before posting

@shahar1 shahar1 changed the title fix(snowflake): log check_query_output response via format string Log check_query_output response via format string in Snowflake API hook Jun 17, 2026
@shahar1 shahar1 changed the title Log check_query_output response via format string in Snowflake API hook Log check_query_output response via format string in Snowflake SQL API hook Jun 17, 2026
@michaelneely

Copy link
Copy Markdown
Contributor Author

Looks like azure provider tests are failing, but that has nothing to do with this PR

@potiuk
potiuk marked this pull request as draft June 18, 2026 21:47
@michaelneely
michaelneely marked this pull request as ready for review June 22, 2026 14:08
@shahar1

shahar1 commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Merged from main to see if past issues were solved

@eladkal
eladkal force-pushed the fix-snowflakesqlapihook-check-query-output branch from 5749a5f to 126fa0e Compare July 23, 2026 09:39
@michaelneely

Copy link
Copy Markdown
Contributor Author

@shahar1 Looks like all tests are passing. can this be merged?

@shahar1
shahar1 merged commit 0d209e6 into apache:main Jul 24, 2026
83 checks passed
@boring-cyborg

boring-cyborg Bot commented Jul 24, 2026

Copy link
Copy Markdown

Awesome work, congrats on your first merged pull request! You are invited to check our Issue Tracker for additional contributions.

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 ready for maintainer review Set after triaging when all criteria pass.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants