its-amann commented on code in PR #76693:
URL: https://github.com/apache/airflow/pull/76693#discussion_r4506280963
##########
airflow-core/src/airflow/api_fastapi/core_api/services/ui/calendar.py:
##########
@@ -81,7 +81,11 @@ def get_calendar_data(
granularity,
)
- planned_data = self._get_planned_dag_runs(dag, raw_dag_states,
date_filter, granularity)
+ baseline_states = raw_dag_states
+ if not raw_dag_states and dag.timetable.periodic:
Review Comment:
the fallback still gets cut off at the year of that latest run, since both
planned loops break on `dt.year != year`. so with a nov 2026 run the hourly
view for jan 2027 is still empty
stopping at the range's upper bound instead fixes it:
```diff
- if dt.year != year:
+ if self._is_past_range(dt, year, date_filter):
break
...
+ def _is_past_range(self, dt: datetime, year: int, date_filter:
RangeFilter) -> bool:
+ value = date_filter.value
+ upper = value and (value.upper_bound_lte or value.upper_bound_lt)
+ if upper:
+ return dt > upper
+ return dt.year != year
```
(same swap for `effective_date.year != year` in
`_calculate_timetable_planned_runs`)
pushed it here if you want to cherry pick:
https://github.com/its-amann/airflow/commit/f36026773a96f09d9993f0924b98834597502207
--
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]