uranusjr commented on code in PR #37826:
URL: https://github.com/apache/airflow/pull/37826#discussion_r1512476829


##########
airflow/models/dag.py:
##########
@@ -3902,6 +3901,16 @@ def get_dataset_triggered_next_run_info(self, *, 
session=NEW_SESSION) -> dict[st
             return None
         return get_dataset_triggered_next_run_info([self.dag_id], 
session=session)[self.dag_id]
 
+    @staticmethod
+    def get_dataset_expression(obj: DAG) -> Any | None:
+        """Deserialize the dataset_triggers structure from DAG into a 
dataset_expression."""
+        from airflow.serialization.serialized_objects import BaseSerialization 
 # avoid circular import
+
+        dataset_triggers = obj.dataset_triggers

Review Comment:
   `dataset_triggers` is on `DAG`, not `DagModel`. I would make this a 
`@property` on `DAG`, and add a field on `DagModel` to store the same value by 
calling the property when a DagModel is created from a DAG.



-- 
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: commits-unsubscr...@airflow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to