I have created the below function that creates a task for a list of files I am looking for.
The file names change daily, so there’s a function that sets the bucket_key.
This part works great.
However, once the sensor sees the file, I can’t seem to find a way to get the filename or path found.
Nothing hits xcom from the sensor.
Is there a way to do this?
The only thing I can come up with is to customize the s3 sensor to do an xcom push once the poke succeeds
sensor_tasks = [
S3KeySensor(
task_id=f,
bucket_key=myFiles[f],
aws_conn_id='AWS S3',
poke_interval=10,
timeout=10800,
soft_fail=True,
wildcard_match=True,
bucket_name=Variable.get('S3-MasterBucket'),
verify=False,
mode='reschedule'
)
for f in myFiles.keys()
]