uranusjr commented on code in PR #45961:
URL: https://github.com/apache/airflow/pull/45961#discussion_r1939015080
##########
airflow/models/dagrun.py:
##########
@@ -1227,11 +1217,11 @@ def
_emit_true_scheduling_delay_stats_for_finished_state(self, finished_tis: lis
rid of the outliers on the stats side through dashboards tooling.
Note that the stat will only be emitted for scheduler-triggered DAG
runs
- (i.e. when ``external_trigger`` is *False* and ``clear_number`` is
equal to 0).
+ (i.e. when ``run_type`` is *MANUAL* and ``clear_number`` is equal to
0).
Review Comment:
I dug into the history and yes it seems that `external_trigger` is *False*
when `run_type` is set to `BACKFILL_JOB`. Also, `external_trigger` predates
both `run_type` and `triggered_by` by a lot, its true definition is quite
ambiguous and lost to time, so we can probably take some liberty changing its
definition as long as the new implementation makes sense and does not cause
bugs.
I think it’d be reasonable enough to define `external_trigger == True` as
equivalent to `run_type == "manual"` for refactoring purposes. If this causes
bugs, they should be fixed under this definition.
--
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]