ashb commented on code in PR #56660:
URL: https://github.com/apache/airflow/pull/56660#discussion_r2432327339
##########
airflow-core/src/airflow/serialization/serialized_objects.py:
##########
@@ -2346,7 +2346,7 @@ def _create_orm_dagrun(
run.dag = dag
# create the associated task instances
# state is None at the moment of creation
- run.verify_integrity(session=session, dag_version_id=dag_version.id)
+ run.verify_integrity(session=session, dag_version_id=dag_version.id if
dag_version else None)
Review Comment:
Do we need to run verify integrity at all if dag version is none? (I dont
have the context loaded in my head right now)
##########
airflow-core/src/airflow/serialization/serialized_objects.py:
##########
@@ -2318,7 +2318,7 @@ def _create_orm_dagrun(
select(DagModel.bundle_version).where(DagModel.dag_id ==
dag.dag_id),
)
dag_version = DagVersion.get_latest_version(dag.dag_id, session=session)
- if not dag_version:
+ if not dag_version and triggering_user_name != "dag_test":
Review Comment:
I guess this works, but i don't line this method of detection.
First question: why do we need a orm dag object anyway? (I think this is
since that is where the scheduling logic is?)
Second question: since we know we aren't going to store anything here in the
db: do we need to call this function, or would a specialised one that just
creates the orm objects in memory fir the purposes of dag.test be better suited?
--
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]