jedcunningham commented on code in PR #52177:
URL: https://github.com/apache/airflow/pull/52177#discussion_r2220061096
##########
airflow-core/src/airflow/jobs/scheduler_job_runner.py:
##########
@@ -131,15 +131,16 @@ def _get_dag(self, version_id: str, session: Session) ->
DAG | None:
return dag
@staticmethod
- def _version_from_dag_run(dag_run, session):
- if dag_run.bundle_version:
- dag_version = dag_run.created_dag_version
- else:
+ def _version_from_dag_run(dag_run, latest, session):
+ if latest or not dag_run.bundle_version:
dag_version = DagVersion.get_latest_version(dag_id=dag_run.dag_id,
session=session)
- return dag_version
+ if dag_version:
+ return dag_version
+
+ return dag_run.created_dag_version
- def get_dag(self, dag_run: DagRun, session: Session) -> DAG | None:
- version = self._version_from_dag_run(dag_run=dag_run, session=session)
+ def get_dag(self, dag_run: DagRun, session: Session, latest=False) -> DAG
| None:
Review Comment:
Should we make dag_run optional instead, and not passing it means get the
latest?
##########
airflow-core/src/airflow/api_fastapi/core_api/openapi/v2-rest-api-generated.yaml:
##########
@@ -8396,6 +8396,10 @@ components:
type: boolean
title: Include Past
default: false
+ run_on_latest_version:
+ type: boolean
+ title: Run On Latest Version
Review Comment:
Any way we can mark these flags as experimental in docs?
--
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]