syedahsn commented on code in PR #31018:
URL: https://github.com/apache/airflow/pull/31018#discussion_r1210612988
##########
airflow/providers/amazon/aws/sensors/s3.py:
##########
@@ -131,6 +135,43 @@ def poke(self, context: Context):
else:
return all(self._check_key(key) for key in self.bucket_key)
+ def execute(self, context: Context) -> None:
+ """
+ Defers to Trigger class to poll for state of the job run until
+ it reaches a failure state or success state
+ """
+ if not self.deferrable:
+ super().execute(context)
+ else:
+ if not self.poke(context=context):
+ self.defer(
+ timeout=timedelta(seconds=self.timeout),
+ trigger=S3KeyTrigger(
+ bucket_name=cast(str, self.bucket_name),
+ bucket_key=self.bucket_key,
+ wildcard_match=self.wildcard_match,
+ check_fn=self.check_fn,
Review Comment:
I'm curious about how this works. How does a function handle being
serialized? Are you able to reconstruct the function after it has been stored
as a string in the database?
--
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]