Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

list_blobs and list_folder log incorrect bucket name #184

Closed
1 task
desertaxle opened this issue May 25, 2023 · 2 comments · Fixed by #214
Closed
1 task

list_blobs and list_folder log incorrect bucket name #184

desertaxle opened this issue May 25, 2023 · 2 comments · Fixed by #214
Labels
good first issue Good for newcomers

Comments

@desertaxle
Copy link
Member

Expectation / Proposal

The list_blobs and list_folder methods on GcsBucket log what bucket and path they are listing blobs or folders for.

Traceback / Example

When running this code:

from prefect_gcp import GcsBucket

bucket = GcsBucket(
    bucket="my-bucket",
)

bucket.list_folders()

The log output is:

08:30:20.932 | INFO    | prefect.GcsBucket - Listing folders in bucket None.
08:30:21.002 | INFO    | prefect.GcsBucket - Listing blobs in bucket None.

Instead, the log messages should be:

08:30:20.932 | INFO    | prefect.GcsBucket - Listing folders in bucket 'my-bucket'.
08:30:21.002 | INFO    | prefect.GcsBucket - Listing blobs in bucket 'my-bucket`.

When running this code:

from prefect_gcp import GcsBucket

bucket = GcsBucket(
    bucket="my-bucket",
    bucket_folder="my-folder",
)

bucket.list_folders()

The log output is:

08:30:20.932 | INFO    | prefect.GcsBucket - Listing folders in bucket my-folder.
08:30:21.002 | INFO    | prefect.GcsBucket - Listing blobs in bucket my-folder.

Instead, the log messages should be something like:

08:30:20.932 | INFO    | prefect.GcsBucket - Listing folders in folder 'my-folder' in bucket 'my-bucket'.
08:30:21.002 | INFO    | prefect.GcsBucket - Listing blobs in folder 'my-folder' in bucket 'my-bucket`.
@desertaxle desertaxle added the good first issue Good for newcomers label May 25, 2023
@bjarneschroeder
Copy link
Contributor

bjarneschroeder commented Sep 21, 2023

Hey @desertaxle , if this is till an issue, I would love to help and contribute a PR. I tested the first example and still got None for Buckets that had folders in them. The provided link to the contribution-section of the library just refers to the starting page though. Did the section move to anywhere else? :)

@desertaxle
Copy link
Member Author

Thanks for your willingness to contribute @bjarneschroeder! Thanks for letting us know that our contributing link needs to be updated. You can see our contribution guide here: https://prefecthq.github.io/prefect-gcp/contributing/.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants