arch-DJ removed a comment on issue #13504:
URL: https://github.com/apache/airflow/issues/13504#issuecomment-755900855


   I was going through **sync_to_db** method in **dagbag.py** .
   Most probably this function is called when the parsed DAG has to be saved in 
the database.
   The sequence followed here is that DAG is first saved into **dag** table and 
then **serialized_dag** table.
   I think if we reverse the sequence the issue I am getting should get 
addressed.
   
   
                   try:
                       DAG.bulk_write_to_db(self.dags.values(), session=session)
   
                       # Write Serialized DAGs to DB, capturing errors
                       for dag in self.dags.values():
                           
serialize_errors.extend(_serialze_dag_capturing_errors(dag, session))
                   except OperationalError:
                       session.rollback()
                       raise
   
   
   Can anyone please tell me if reversing the sequence is OK?


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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to