ephraimbuddy commented on code in PR #46484:
URL: https://github.com/apache/airflow/pull/46484#discussion_r1965747681
##########
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:
Can you find out why it errored like that? if it's because the dag_versions
is None, then we should just check it and return empty list:
```python
if not dag_versions:
return []
```
And adjust the return type
--
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]