Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: fs.exists() checks if path exists TDE-710 #441

Merged
merged 3 commits into from
Apr 18, 2023

Conversation

paulfouquet
Copy link
Collaborator

fs.exists() checks if a s3 or local path points to an existing file/directory/object

@paulfouquet paulfouquet requested a review from a team as a code owner April 12, 2023 03:40

bucket_name = bucket_name_from_path(s3_path)
bucket = s3.Bucket(bucket_name)
objects = bucket.objects.filter(Prefix=key)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

generally you would do a head to see if a key exists, this is checking for anything that starts with this path

so exists s3://foo/bar.tiff would succeed if you did exists s3://foo/bar.tiff.bak

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, that's right.
I'm going to fix that

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@blacha this is now checking if the path is a "directory" aka ends with / to determine wether it does a head or a list.

amfage
amfage previously approved these changes Apr 12, 2023
@kodiakhq kodiakhq bot merged commit f79bd7a into master Apr 18, 2023
@kodiakhq kodiakhq bot deleted the feat/fs-exists-tde-710 branch April 18, 2023 22:33
@github-actions github-actions bot mentioned this pull request Apr 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants