Lee-W commented on code in PR #69454:
URL: https://github.com/apache/airflow/pull/69454#discussion_r3536872339


##########
airflow-core/src/airflow/cli/commands/partition_command.py:
##########
@@ -44,7 +44,9 @@ def clear(args, *, session: Session = NEW_SESSION) -> None:
     the matching partitions; a date-only value (no time) is treated as local
     midnight.
     """
-    has_range = args.start_date is not None or args.end_date is not None or 
args.date is not None
+    has_start = args.start_date is not None
+    has_end = args.end_date is not None
+    has_range = has_start or has_end or args.date is not None

Review Comment:
   Instead of pre-validating, I aligned the guard with the query: both bounds 
now pass through `dag.timetable.localize_partition_datetime()` — the exact 
transform `apply_partition_date_window()` applies downstream — before the 
`lower > upper` check. Because the guard and the query share that single 
transform, they can no longer disagree: your `-10:00` / `+14:00` example is 
localized identically in both places and accepted.
   
   A `yyyy-mm-dd`-only format check would also have rejected the sub-day 
windows this command is meant to support on sub-daily schedules, so aligning 
the comparison is both narrower and more general than a format guard.



-- 
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]

Reply via email to