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


##########
airflow/assets/__init__.py:
##########
@@ -276,20 +279,43 @@ class Asset(os.PathLike, BaseAsset):
     uri: str
     group: str
     extra: dict[str, Any]
+    watchers: list[BaseTrigger]
 
     asset_type: ClassVar[str] = "asset"
     __version__: ClassVar[int] = 1
 
     @overload
-    def __init__(self, name: str, uri: str, *, group: str = "", extra: dict | 
None = None) -> None:
+    def __init__(
+        self,
+        name: str,
+        uri: str,
+        *,
+        group: str = "",
+        extra: dict | None = None,
+        watchers: list[BaseTrigger] | None = None,

Review Comment:
   I wonder if *watcher* is a good name for this. What do we expect this to do? 
If I understand AIP-82 correctly, an external event would fire the trigger, and 
the trigger would create events for assets associated to it.
   
   Assuming my understanding is correct, the triggers here are not watchers of 
the asset; rather, the asset *watches* the triggers. The relationship is the 
other way around. So it is probably better to call this `watch` instead? Or 
maybe this attribute should live on the trigger instead, something like
   
   ```python
   asset = Asset("example_asset_watchers")
   
   trigger = SqsSensorTrigger(sqs_queue="my_queue", trigger=[asset])
   
   DAG(..., schedule=[asset])
   ```
   
   Tell me what you think on this.



-- 
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]

Reply via email to