vincbeck commented on code in PR #74293:
URL: https://github.com/apache/airflow/pull/74293#discussion_r4338659395


##########
providers/amazon/src/airflow/providers/amazon/aws/triggers/s3.py:
##########
@@ -266,3 +270,141 @@ async def run(self) -> AsyncIterator[TriggerEvent]:
                     await asyncio.sleep(self.polling_period_seconds)
         except Exception as e:
             yield TriggerEvent({"status": "error", "message": str(e)})
+
+
+class S3KeyUpdateTrigger(BaseEventTrigger):
+    """
+    Fire an event whenever a single S3 object is updated.
+
+    Polls ``head_object`` for ``bucket_key`` and emits an event when the 
object's ``ETag``
+    differs from the one the trigger last reported, which makes an upload to 
that key usable
+    as a scheduling signal::
+
+        from airflow.sdk import Asset, AssetWatcher
+
+        report = Asset(
+            "daily_report",
+            watchers=[
+                AssetWatcher(
+                    name="daily_report_updates",
+                    trigger=S3KeyUpdateTrigger(bucket_name="my-bucket", 
bucket_key="reports/daily.csv"),
+                )
+            ],
+        )
+
+
+        @dag(schedule=[report])
+        def downstream(): ...
+

Review Comment:
   Agree, I trimmed the comment



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