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

Refactor maybe_create_object_store_from_uri #3679

Merged
merged 7 commits into from
Oct 24, 2024
Merged

Conversation

irenedea
Copy link
Contributor

@irenedea irenedea commented Oct 23, 2024

What does this PR do?

Refactors maybe_create_object_store_from_uri to use a dictionary, which maps backend strings to object store factory functions.

What issue(s) does this change relate to?

Before submitting

  • Have you read the contributor guidelines?
  • Is this change a documentation change or typo fix? If so, skip the rest of this checklist.
  • Was this change discussed/approved in a GitHub issue first? It is much more likely to be merged if so.
  • Did you update any related docs and document your change?
  • Did you update any related tests and add any new tests related to your change? (see testing)
  • Did you run the tests locally to make sure they pass?
  • Did you run pre-commit on your change? (see the pre-commit section of prerequisites)

@irenedea irenedea force-pushed the objectstore-registry branch from 7b1b906 to f7a6d56 Compare October 23, 2024 05:55
@irenedea irenedea marked this pull request as ready for review October 23, 2024 06:09
@irenedea irenedea changed the title Make maybe_create_object_store_from_uri extensible Refactor maybe_create_object_store_from_uri Oct 23, 2024
Copy link
Contributor

@mvpatel2000 mvpatel2000 left a comment

Choose a reason for hiding this comment

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

Should we add a test for registering a mock option?

composer/utils/file_helpers.py Outdated Show resolved Hide resolved
@irenedea
Copy link
Contributor Author

irenedea commented Oct 24, 2024

@mvpatel2000 The existing test test_maybe_create_object_store_from_uri already tests that items in the dictionary are read from. I think that should be sufficient to handle the case where someone adds a new items to the dictionary.

@irenedea irenedea requested a review from mvpatel2000 October 24, 2024 16:51
Copy link
Contributor

@mvpatel2000 mvpatel2000 left a comment

Choose a reason for hiding this comment

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

LGTM. not sure why comments are removed though

composer/utils/file_helpers.py Outdated Show resolved Hide resolved
@irenedea irenedea force-pushed the objectstore-registry branch from 01cbcf6 to a501786 Compare October 24, 2024 17:55
@irenedea irenedea enabled auto-merge (squash) October 24, 2024 17:57
@irenedea irenedea merged commit af5dea4 into main Oct 24, 2024
14 checks passed
@irenedea irenedea deleted the objectstore-registry branch October 24, 2024 18:18
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.

2 participants