AmarEL edited a comment on issue #15001:
URL: https://github.com/apache/airflow/issues/15001#issuecomment-807891419


   We created the same sensor here to look for specific keys in the s3.
   In our case, since the prefix was different, we did it on top of the 
`check_for_key` from the s3 hook class (The same used by the S3KeySensor).
   ```
           key_list = 
context['task_instance'].xcom_pull(task_ids='get_s3_keys_of_extracted_tables', 
key='s3_parquet_keys')
           hook = S3Hook(aws_conn_id=self.aws_conn_id, verify=self.verify)
           for key in key_list:
               self.log.info('Poking for key: s3://%s/%s', self.bucket_name, 
key)
               if not hook.check_for_key(key, self.bucket_name):
                   return False
           return True
   ```
   
   Make the `S3KeySensor` accept str or List[str] would work too.
   Btw, apply this behavior for the three current sensors for s3 would be nice.


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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to