vincbeck commented on code in PR #45562: URL: https://github.com/apache/airflow/pull/45562#discussion_r1926040582
########## task_sdk/src/airflow/sdk/definitions/asset/__init__.py: ########## @@ -257,6 +258,17 @@ def iter_dag_dependencies(self, *, source: str, target: str) -> Iterator[DagDepe raise NotImplementedError +@attrs.define(frozen=True) +class AssetWatcher: + """A representation of an asset watcher. The name uniquely identity the watch.""" + + name: str + # This attribute serves double purpose. For a "normal" asset instance + # loaded from DAG, this holds the trigger used to monitor an external resource. + # For an asset recreated from a serialized DAG, however, this holds the serialized data of the trigger. Review Comment: You are :) A lot! Thanks a lot for the details, that helps a lot to better understand. I created a new class `SerializedAssetWatcher` and use that class whenever I deserialize. In `collection.py`, when I fetch the watchers, I cast them as `SerializedAssetWatcher` because `asset.watchers` can be `AssetWatcher` or `SerializedAssetWatcher`. Let me know if this is what you had in mind :) -- 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