k-nithin commented on issue #59618:
URL: https://github.com/apache/airflow/issues/59618#issuecomment-3892931449

   > agree that the current name last_automated_run is misleading given that it 
may not actually represent the most recent DAG run, especially considering 
scheduler behavior and Airflow’s distributed nature.
   > 
   > As a first step, I’m planning to:
   > 
   > Audit the call sites to better document the expectations vs. reality of 
what is being passed.
   > 
   > Propose a clearer, semantics-accurate name that reflects “the run 
currently being processed by the scheduler” rather than “latest”.
   > 
   > Separately, I’ll also look into whether the logic around updating 
next_dagrun can be made more robust to avoid regressions when newer runs are 
created concurrently.
   > 
   > I’ll keep the initial PR focused and small (primarily naming + 
documentation), and follow up with logic changes if that’s acceptable.
   
   @dstandish 
   
   I've audited the call sites for calculate_dagrun_date_fields and confirmed 
that last_automated_run does not consistently receive the latest run. It 
receives the run object currently being processed by the scheduler (which might 
be an older run in a backfill).
   
   As a first step, I've renamed the parameter to reference_run locally to 
better reflect its usage as a reference point for calculation rather than 
strictly the "latest" automated run.
   
   Does reference_run align with your thinking? I can proceed with this rename 
in a PR if you agree, or adjust if you prefer something like base_run.


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