josix commented on code in PR #46279:
URL: https://github.com/apache/airflow/pull/46279#discussion_r1935449433
##########
tests/api_fastapi/core_api/routes/ui/test_structure.py:
##########
@@ -81,6 +132,28 @@ def make_dag(dag_maker, session, time_machine):
dag_maker.sync_dagbag_to_db()
[email protected]
+def make_dag_with_multiple_version(dag_maker, session):
+ with dag_maker(DAG_ID) as dag:
+ EmptyOperator(task_id="task1")
+ dag.sync_to_db()
+ SerializedDagModel.write_dag(dag, bundle_name="dag_maker")
+ with dag_maker(DAG_ID) as dag2:
+ EmptyOperator(task_id="task1")
+ EmptyOperator(task_id="task2")
+ dag2.sync_to_db()
+ SerializedDagModel.write_dag(dag2, bundle_name="dag_maker")
+ with dag_maker(DAG_ID) as dag3:
+ EmptyOperator(task_id="task1")
+ EmptyOperator(task_id="task2")
+ EmptyOperator(task_id="task3")
+ dag3.sync_to_db()
+ SerializedDagModel.write_dag(dag3, bundle_name="dag_maker")
+
+ latest_version = DagVersion.get_latest_version(dag.dag_id)
+ assert latest_version.version_number == 3
Review Comment:
nit. Maybe we could remove the assertion, since the verification has been
covered at
https://github.com/apache/airflow/blob/459c74600018ff69bbd49f465053052652b048f6/tests/models/test_dag_version.py#L61
--
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]