pierrejeambrun commented on code in PR #46484:
URL: https://github.com/apache/airflow/pull/46484#discussion_r1966148982


##########
airflow/models/dagrun.py:
##########
@@ -314,7 +314,11 @@ def validate_run_id(self, key: str, run_id: str) -> str | 
None:
     @property
     def dag_versions(self) -> list[DagVersion]:
         """Return the DAG versions associated with the TIs of this DagRun."""
-        dag_versions = list(dict.fromkeys(list(self._tih_dag_versions) + 
list(self._ti_dag_versions)))
+        dag_versions = [
+            dv
+            for dv in dict.fromkeys(list(self._tih_dag_versions) + 
list(self._ti_dag_versions))
+            if dv is not None
+        ]
         sorted_ = sorted(dag_versions, key=lambda dv: dv.id)

Review Comment:
   It’s because some TI or TIH do not find the related version. That might not 
be a real use case, just a test thing. TI has no dag version initialized in the 
test.
   
   can a TIH have None for Version when joining to populate the relationship 
<=> Can versions be removed I guess would be the use case.
   
   



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