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

Modify UCObjectStore.list_objects to lists all files recursively #2959

Merged
merged 9 commits into from
Feb 3, 2024

Conversation

irenedea
Copy link
Contributor

@irenedea irenedea commented Feb 2, 2024

What does this PR do?

Modifies UCObjectStore.list_objects to list all files recursively. Previously, UCObjectStore.list_objects only listed top level files.

This is consistent with other ObjectStore behavior.

Tests

(1) Manually tested with:

from composer.utils.object_store import UCObjectStore

uc = UCObjectStore(path="Volumes/main/nancyhung/cpt/small")
res = uc.list_objects(prefix="Volumes/main/nancyhung/cpt/small")
print('\n'.join(res))

Output:

/Volumes/main/nancyhung/cpt/small/AAA-fake/foo/chat.jsonl
/Volumes/main/nancyhung/cpt/small/ABT/sec_0000001800_10-K_1993_metadata.json
/Volumes/main/nancyhung/cpt/small/ABT/sec_0000001800_10-K_1993_txt.txt
/Volumes/main/nancyhung/cpt/small/ABT/sec_0000001800_10-K_1994_metadata.json
/Volumes/main/nancyhung/cpt/small/ABT/sec_0000001800_10-K_1994_txt.txt
...

I checked that each subfolder was represented.

Before these changes, there was no output printed because there were no top level files.

(2) Manually tested that an exception is raised when the max recursive depth is reached.

@irenedea irenedea requested a review from nancyhung February 2, 2024 03:46
@irenedea irenedea requested a review from panchalhp-db February 2, 2024 21:30
Copy link
Contributor

@panchalhp-db panchalhp-db left a comment

Choose a reason for hiding this comment

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

LGTM!

@dakinggg dakinggg merged commit 8b9e18e into mosaicml:dev Feb 3, 2024
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants