Skip to content

GCS Sensor for matching glob #32650

Description

@A-Costa

Description

Since the new version of GCSHook.list implements the match_glob parameter, it would be possible to implement a new GCS sensor that checks if a file that matches a given glob exists in a GCS bucket.

The new sensor could be called GCSObjectsMatchingGlobExistenceSensor and would have a similar signature to GCSObjectsWithPrefixExistenceSensor, changing in the __init__ function the prefix parameter with a glob parameter.

Use case/motivation

This will be a new sensor, useful to check if inside a Google Cloud Storage bucket a file that matches a certain blob is available.

For example:

GCSObjectsMatchingGlobExistenceSensor(
    task_id="gcs_file_sensor",
    bucket="test_bucket",
    glob="*.csv"
)

will find all csv files in the bucket test_bucket.

Related issues

No response

Are you willing to submit a PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions