shahar1 commented on code in PR #41298:
URL: https://github.com/apache/airflow/pull/41298#discussion_r1710086601


##########
airflow/exceptions.py:
##########
@@ -239,6 +239,28 @@ def __init__(self, dag_run: DagRun, execution_date: 
datetime.datetime, run_id: s
             f"A DAG Run already exists for DAG {dag_run.dag_id} at 
{execution_date} with run id {run_id}"
         )
         self.dag_run = dag_run
+        self.execution_date = execution_date
+        self.run_id = run_id
+
+    def serialize(self):
+        cls = self.__class__
+        # Note the DagRun object will be detached here and fails 
serialization, we need to create a new

Review Comment:
   ```suggestion
           # Note the DagRun object will be detached here and fails 
serialization, we need to create a new one
   ```
   Maybe worth explaining why it happens, and how creating a new object helps 
to deal with it (either in the code, or in the PR, or here)



##########
airflow/operators/trigger_dagrun.py:
##########
@@ -250,7 +263,7 @@ def execute(self, context: Context):
                 )
                 time.sleep(self.poke_interval)
 
-                dag_run.refresh_from_db()
+                dag_run.refresh_from_db()  # TODO here fail on internal API

Review Comment:
   When adding such `TODO`, I think it would be helpful to associate it with a 
GitHub issue, so we'll be able to track and eventually resolve it



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