Skip to content

SnowflakeSqlApiOperator fails with JSONDecode at times #52079

Description

@rawwar

Apache Airflow version

3.0.2

If "Other Airflow 2 version" selected, which one?

No response

What happened?

SnowflakeSqlApiOperator's get_sql_api_query_status method directly tries to do response.json and this sometimes fails with JSONDecode error when the response isn't a JSON.

We should first do response.raise_for_status() to ensure we don't try to parse response body when the API request has failed.

What you think should happen instead?

No response

How to reproduce

It's an intermittent issue and I am not sure how to reproduce this. But, we can definitely have a test case where response not a JSON.

Operating System

mac os

Versions of Apache Airflow Providers

main

Deployment

Astronomer

Deployment details

No response

Anything else?

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

No activity

Activity on this issue will appear here.

Activity

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

Metadata

Metadata

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions