mobuchowski commented on code in PR #43434:
URL: https://github.com/apache/airflow/pull/43434#discussion_r1827505378
##########
providers/src/airflow/providers/openlineage/utils/utils.py:
##########
@@ -262,9 +262,31 @@ class DagInfo(InfoJsonEncodable):
"start_date",
"tags",
]
- casts = {"timetable": lambda dag: dag.timetable.serialize() if
getattr(dag, "timetable", None) else None}
+ casts = {"timetable": lambda dag: DagInfo.serialize_timetable(dag)}
renames = {"_dag_id": "dag_id"}
+ @classmethod
+ def serialize_timetable(cls, dag):
+ serialized = dag.timetable.serialize()
+ if serialized != {} and serialized is not None:
+ return serialized
+ if (
+ hasattr(dag, "dataset_triggers")
+ and isinstance(dag.dataset_triggers, list)
+ and len(dag.dataset_triggers) > 0
+ ):
+ triggers = dag.dataset_triggers
+ return {
+ "dataset_condition": {
Review Comment:
@Lee-W Yes, this is only for 2.8 and 2.9.
--
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]