Repository navigation
BigQuery task decorated functions failing in Airflow 2.9.1 #39541
Description
Activity
- addedkind:bugThis is a clearly a bugThis is a clearly a bugneeds-triagelabel for new issues that we didn't triage yetlabel for new issues that we didn't triage yet
on May 10, 2024 Could this be something to do with updates to some of the
google-apilibraries between Airflow 2.8.4 and 2.9.1?2.8.4
google-api-core==2.17.1 google-api-python-client==2.122.0 google-auth==2.28.22.9.1
google-api-core==2.19.0 google-api-python-client==2.127.0 google-auth==2.29.0Although I'm confused why this would affect @task decorated functions?
- added_eol_affected_version:2.9Issues Reported for 2.9Issues Reported for 2.9
on May 10, 2024 Although I'm confused why this would affect @task decorated functions?
You are using BQHook, so it does not matter if task is decorated
Could this be something to do with updates to some of the google-api libraries between Airflow 2.8.4 and 2.9.1?
Can you downgrade the libraries and check if it fixes the issue?
@VladaZakharova - you might want to take a look at this one
Reacted by Pankaj Koti@potiuk Yes, I guess my confusion is more about why hook is giving the error in this context rather than the operator; especially as it doesn't seen to be caused by the provider. I downgraded the libraries but the issue persists.
Look like this is related to
google-cloud-bigquerydowngrading it to google-cloud-bigquery<3.21.0 fix for meReacted by Pankaj Koti- removedneeds-triagelabel for new issues that we didn't triage yetlabel for new issues that we didn't triage yet
on May 13, 2024 @pankajastro Interesting. Downgrading does work but I'm curious to know what issue is and why the hook method gives the error but the operator does not.
It is because the way we pass
nowaitparam toinsert_jobmethod. When you are using @task thennowaitis False but when you are using operator it is Truereturn hook.insert_job( error coming from
airflow/airflow/providers/google/cloud/hooks/bigquery.py
Lines 1674 to 1676 in 79042cf
else: # Start the job and wait for it to complete and get the result. job_api_repr.result(timeout=timeout, retry=retry) I have drafted a PR to pin the lib version until we fix it #39583
Reacted by Pankaj Koti- addedprovider:googleGoogle (including GCP) related issuesGoogle (including GCP) related issuesand removed
on May 13, 2024 I see. Thanks for the info.
Reacted by Pankaj Koti- added and removed_eol_affected_version:2.9Issues Reported for 2.9Issues Reported for 2.9
on May 26, 2024 Closing this task as we have pinned the version and we have a todo in the code that reference this issue
I read the thread, but this also happens with official Google Cloud BigQuery operators that uses BQHook under the hood. Thanks for the info !
Could you also update the constraint file ?
Could you also update the constraint file ?
Constraints are updated only when they prevent things from being build. We never update constraints with new providers - they are generally frozen in time. New provider will be in the constraints of 2.9.2
Nothing prevents you from installing new provider without constraints - this is described in "upgrade scenario" documentation (See installation documentation) - you should follow this rather than stick to constraints in this case.
Oh i thought constraints were the recommended way to always install airflow. I forced the installation of the google-cloud-bigquery package in 3.20.1 without constraints as you mentionned.
- added a commit that references this issue
on Jul 19, 2024 - added a commit that references this issue
on Sep 16, 2024
Apache Airflow version
2.9.1
If "Other Airflow 2 version" selected, which one?
No response
What happened?
After upgrading to Airflow 2.9.1, @task decorated functions that implement BigQuery hooks are not successfully submitting jobs but returning an error such as the following:
I have replicated this issue against Airflow 2.9.1 and against
mainbut this does not seem to be related to the Google provider because using either 10.17 or 10.16 will result in this error.Using either Google provider with Airflow 2.8.4 does not cause this error.
What you think should happen instead?
No response
How to reproduce
Here's a simple DAG that will replicate the issue using Breeze. The
bq_hook_testtask will fail butbq_insert_job_testbased onBigQueryInsertJobOperatorwith the same configuration will succeed.We are using Google default credentials for authentication with the following environment variables:
Operating System
n/a
Versions of Apache Airflow Providers
apache-airflow-providers-google=10.17.0
Deployment
Astronomer
Deployment details
No response
Anything else?
Full log exception.
Are you willing to submit PR?
Code of Conduct