Support Airflow v3 run_after field and simplify DAG run table#589
Support Airflow v3 run_after field and simplify DAG run table#589
Conversation
The DAG Run ID column encoded the same information as the logical date and run type columns, making it redundant. This removes it and replaces the "Logical Date" column with a unified "Date" column that prefers `run_after` (Airflow v3) over `logical_date` (Airflow v2), handling the semantic change where `logical_date` can be None for manually triggered runs in v3. https://claude.ai/code/session_01Ntp6UzeBVp78XaMQm1rS21
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
This PR adds support for Airflow v3's
run_afterfield while maintaining backward compatibility with Airflow v2'slogical_date. It also simplifies the DAG run display table by removing the DAG Run ID column and consolidating date display.Key Changes
Added
run_afterfield support: TheDagRunstruct now includes an optionalrun_afterfield to support Airflow v3, with a newdisplay_date()method that prefersrun_afteroverlogical_datefor display and sorting purposes.Simplified table layout: Removed the dedicated "DAG Run ID" column from the table display, reducing visual clutter while keeping the information accessible through the state indicator and other context.
Improved date handling: The sorting logic now uses
display_date()which intelligently selects betweenrun_after(v3),logical_date(v2), andstart_dateas fallback, ensuring correct chronological ordering across Airflow versions.Updated table constraints: Adjusted column width calculations to account for the removed DAG Run ID column, improving space allocation for the duration gauge.
Enhanced test coverage: Added a new test case
test_sort_dag_runs_prefers_run_after()to verify thatrun_aftertakes precedence overlogical_datewhen both are present.Cleaned up imports: Removed unused
Modifierimport from ratatui style module.Implementation Details
The
display_date()method provides a clean abstraction for date selection, making it easy to handle the transition between Airflow versions. The sorting implementation now uses this method consistently, ensuring that runs are always ordered by the most meaningful date available. The table layout changes maintain the same visual hierarchy while reducing cognitive load by focusing on essential information.https://claude.ai/code/session_01Ntp6UzeBVp78XaMQm1rS21