ferruzzi commented on code in PR #58248:
URL: https://github.com/apache/airflow/pull/58248#discussion_r2566580844


##########
airflow-core/src/airflow/models/serialized_dag.py:
##########
@@ -470,6 +578,15 @@ def write_dag(
         log.debug("Writing Serialized DAG: %s to the DB", dag.dag_id)
         new_serialized_dag.dag_version = dagv
         session.add(new_serialized_dag)
+        session.flush()

Review Comment:
   I think I may need a hand on this one.  If we don't flush then we don't have 
the serdag id.  I initially had all of this tied to dag_id instead of 
serdag_id, and we do have dag_id at this point so we didn't need the flush, but 
serdag does feel like the more accurate "connection point".
   
   I'll have a look and see if I can shift the logic to somewhere outside of 
write_dag maybe



-- 
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]

Reply via email to