Lee-W commented on code in PR #46460:
URL: https://github.com/apache/airflow/pull/46460#discussion_r1953910707
##########
airflow/jobs/scheduler_job_runner.py:
##########
@@ -1486,7 +1465,12 @@ def _update_state(dag: DAG, dag_run: DagRun):
dag_run.state = DagRunState.RUNNING
dag_run.start_date = timezone.utcnow()
- if dag.timetable.periodic and not dag_run.external_trigger and
dag_run.clear_number < 1:
+ if (
+ dag.timetable.periodic
+ and dag_run.triggered_by != DagRunTriggeredByType.ASSET
+ and not dag_run.external_trigger
+ and dag_run.clear_number < 1
+ ):
Review Comment:
because if we set `schedule` to something like
`AssetOrTimeSchedule(timetable=CronTriggerTimetable("0 1 * * 3",
timezone="UTC"), assets=dag1_asset_2)`. the timetable will be periodic even if
it's triggered by an asset, which causes the error, as there are no data
intervals for such dag runs. Also according to the comment
```
# We only publish these metrics for scheduled dag runs and
only
# when ``external_trigger`` is *False* and ``clear_number``
is 0.
```
asset triggered dag runs should not be included
--
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]