-
Notifications
You must be signed in to change notification settings - Fork 16.4k
Closed
Labels
area:providersgood first issuekind:bugThis is a clearly a bugThis is a clearly a bugprovider:googleGoogle (including GCP) related issuesGoogle (including GCP) related issues
Description
Apache Airflow Provider(s)
Versions of Apache Airflow Providers
apache-airflow-providers-google==12.0.0
Apache Airflow version
2.9.3
Operating System
Ubuntu
Deployment
Virtualenv installation
Deployment details
No response
What happened
BigQueryInsertJobOperator set traceability job labels(airflow-dag & airflow-task) in BigQuery jobs. But, when using the BigQueryInsertJobOperator with TaskGroup, the traceability labels were not available
What you think should happen instead
traceability_labels = {"airflow-dag": dag_label, "airflow-task": task_label}
The traceability labels should be available for BigQueryInsertJobOperator with TaskGroup
How to reproduce
from datetime import datetime, timedelta
from airflow import DAG
from airflow.providers.google.cloud.operators.bigquery import BigQueryInsertJobOperator
from airflow.operators.dummy import DummyOperator
from airflow.utils.task_group import TaskGroup
default_args = {
"retries": 1,
"retry_delay": timedelta(minutes=1),
}
with DAG(
"test_dag",
default_args=default_args,
description="BQ test DAG",
schedule_interval=timedelta(days=1),
start_date=datetime(2025, 3, 2),
catchup=False,
) as dag:
start = DummyOperator(task_id="start")
with TaskGroup("taskgroup_1", tooltip="task group #1") as section_1:
t1 = BigQueryInsertJobOperator(
task_id="insert_job_1",
configuration={
"query": {
"query": "SELECT * FROM `project.dataset.table_1`;",
"useLegacySql": False,
} },
gcp_conn_id="google_cloud_default",
)
t2 = BigQueryInsertJobOperator(
task_id="insert_job_2",
configuration={
"query": {
"query": "SELECT * FROM `project.dataset.table_1`;",
"useLegacySql": False,
},
},
gcp_conn_id="google_cloud_default",
)
end = DummyOperator(task_id="end")
start >> section_1 >> end
Anything else
No response
Are you willing to submit PR?
- Yes I am willing to submit a PR!
Code of Conduct
- I agree to follow this project's Code of Conduct
Metadata
Metadata
Assignees
Labels
area:providersgood first issuekind:bugThis is a clearly a bugThis is a clearly a bugprovider:googleGoogle (including GCP) related issuesGoogle (including GCP) related issues