This is an automated email from the ASF dual-hosted git repository.

kaxilnaik pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new 927e550adcc Fix ``BigQueryInsertJobOperator`` failure with 
asset-triggered DAGs (#55092)
927e550adcc is described below

commit 927e550adccc8ba4d9f1d959de3bc220efb4fe0d
Author: Kaxil Naik <[email protected]>
AuthorDate: Sat Aug 30 09:36:07 2025 +0100

    Fix ``BigQueryInsertJobOperator`` failure with asset-triggered DAGs (#55092)
---
 .../src/airflow/providers/google/cloud/operators/bigquery.py   | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git 
a/providers/google/src/airflow/providers/google/cloud/operators/bigquery.py 
b/providers/google/src/airflow/providers/google/cloud/operators/bigquery.py
index 6b96adb01e7..d09a7c9f6a4 100644
--- a/providers/google/src/airflow/providers/google/cloud/operators/bigquery.py
+++ b/providers/google/src/airflow/providers/google/cloud/operators/bigquery.py
@@ -2370,11 +2370,19 @@ class 
BigQueryInsertJobOperator(GoogleCloudBaseOperator, _BigQueryInsertJobOpera
         if self.project_id is None:
             self.project_id = hook.project_id
 
+        # Handle missing logical_date. Example: asset-triggered DAGs (Airflow 
3)
+        logical_date = context.get("logical_date")
+        if logical_date is None:
+            # Use dag_run.run_after as fallback when logical_date is not 
available
+            dag_run = context.get("dag_run")
+            if dag_run and hasattr(dag_run, "run_after"):
+                logical_date = dag_run.run_after
+
         self.job_id = hook.generate_job_id(
             job_id=self.job_id,
             dag_id=self.dag_id,
             task_id=self.task_id,
-            logical_date=context["logical_date"],
+            logical_date=logical_date,
             configuration=self.configuration,
             force_rerun=self.force_rerun,
         )

Reply via email to