Lee-W commented on code in PR #67717:
URL: https://github.com/apache/airflow/pull/67717#discussion_r3367745310
##########
airflow-core/src/airflow/cli/commands/dag_command.py:
##########
@@ -157,10 +165,52 @@ def dag_clear(args, *, session: Session = NEW_SESSION) ->
None:
query = query.where(DagRun.partition_key == args.partition_key)
else:
query = query.where(DagRun.partition_date.is_not(None))
- if args.partition_date_start is not None:
- query = query.where(DagRun.partition_date >=
args.partition_date_start)
- if args.partition_date_end is not None:
- query = query.where(DagRun.partition_date <=
args.partition_date_end)
+ tt_tz = getattr(dag.timetable, "timezone", None) if
dag.timetable.partitioned else None
Review Comment:
Moved the day-bound computation to the timetable (`get_partition_day_bound`
(default midnight UTC)) with `CronMixin` overriding it for its timezone, so
`dag_clear` just calls the method — no more `.timezone` probing or `isinstance`
check.
--
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]