Skip to content

Fix passing labels from Airflow connections to BQ jobs#65663

Merged
kaxil merged 1 commit intoapache:mainfrom
VladaZakharova:bq-label-fix
Apr 22, 2026
Merged

Fix passing labels from Airflow connections to BQ jobs#65663
kaxil merged 1 commit intoapache:mainfrom
VladaZakharova:bq-label-fix

Conversation

@VladaZakharova
Copy link
Copy Markdown
Contributor

The current documentation on BigQuery suggests that the logic of adding labels that were set in the Airflow connection should be also expected in the labels section of the created Big Query Job:
https://airflow.apache.org/docs/apache-airflow-providers-google/stable/connections/bigquery.html

So this current flow looks like a bug, that should be fixed.

This PR merges connection-level labels into the job configuration before the job is submitted.
The new behavior is:

If the operator config has no labels, it copies labels from the connection.
If the operator config already has labels, it merges them.
If the same label key exists in both places, the operator config wins.
If the operator explicitly sets labels=None, that stays unchanged.


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.

@VladaZakharova VladaZakharova requested a review from shahar1 as a code owner April 22, 2026 08:12
@boring-cyborg boring-cyborg Bot added area:providers provider:google Google (including GCP) related issues labels Apr 22, 2026
@kaxil kaxil merged commit 0bcec1d into apache:main Apr 22, 2026
93 checks passed
@boring-cyborg
Copy link
Copy Markdown

boring-cyborg Bot commented Apr 22, 2026

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:google Google (including GCP) related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants