obarisk commented on code in PR #55110:
URL: https://github.com/apache/airflow/pull/55110#discussion_r2422022575
##########
providers/google/src/airflow/providers/google/cloud/hooks/bigquery.py:
##########
@@ -1285,10 +1295,35 @@ def generate_job_id(self, job_id, dag_id, task_id,
logical_date, configuration,
if job_id:
return f"{job_id}_{uniqueness_suffix}"
- exec_date = logical_date.isoformat()
- job_id = f"airflow_{dag_id}_{task_id}_{exec_date}_{uniqueness_suffix}"
+ if logical_date is not None:
+ if AIRFLOW_V_3_0_PLUS:
+ warnings.warn(
+ "The 'logical_date' parameter is deprecated. Please use
'run_after' instead.",
+ AirflowProviderDeprecationWarning,
+ stacklevel=1,
+ )
+ job_id_timestamp = logical_date
+ elif run_after is not None:
+ job_id_timestamp = run_after
+ else:
+ job_id_timestamp = pendulum.now("UTC")
+
+ job_id =
f"airflow_{dag_id}_{task_id}_{job_id_timestamp.isoformat()}_{uniqueness_suffix}"
return re.sub(r"[:\-+.]", "_", job_id)
+ def get_run_after_or_logical_date(self, context: Context) ->
pendulum.DateTime:
+ if AIRFLOW_V_3_0_PLUS:
+ if dag_run := context.get("dag_run"):
+ run_after = pendulum.instance(dag_run.run_after)
+ else:
+ run_after = pendulum.now("UTC")
+ else:
+ if logical_date := context.get("logical_date"):
+ run_after = logical_date
+ else:
+ run_after = pendulum.now("UTC")
Review Comment:
I prefer to keep `run_after` here. Updated
`providers/google/src/airflow/providers/google/cloud/operators/workflows.py`
Because, `logical_date` is deprecated.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]