uranusjr commented on code in PR #37826:
URL: https://github.com/apache/airflow/pull/37826#discussion_r1515936094
##########
airflow/models/dag.py:
##########
@@ -2009,6 +2011,16 @@ def _get_task_instances(
return tis
+ @property
+ def get_dataset_expression(self) -> Any | None:
+ """Serialize the dataset_triggers structure from DAG into a
JSON-compatible format."""
+ from airflow.serialization.serialized_objects import BaseSerialization
# avoid circular import
+
+ dataset_triggers = self.dataset_triggers
+ if dataset_triggers:
+ return BaseSerialization.serialize(dataset_triggers)
+ return None
Review Comment:
Since None is serialised to None, we don’t actually need to `if`. And if
this is a one-liner, we don’t need this property at all and can just do the
serialisation in `bulk_write_to_db`.
--
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]