Skip to content

SnowflakeSqlApiOperator fails with JSONDecode at times #52079

Closed
@rawwar

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

Metadata

Metadata

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions