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

Update obstore tests #2

Merged
merged 5 commits into from
Dec 13, 2024

Conversation

maxrjones
Copy link

No description provided.

super().__init__(read_only=read_only)

def __str__(self) -> str:
return f"object://{self.store}"

def __repr__(self) -> str:
return f"ObjectStore({self!r})"
return f"ObjectStore({self})"
Copy link
Author

Choose a reason for hiding this comment

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

This was changed to avoid a recursion error when __repr__ is called

Comment on lines +44 to +54
if not isinstance(
store,
(
obs.store.AzureStore,
obs.store.GCSStore,
obs.store.HTTPStore,
obs.store.S3Store,
obs.store.LocalStore,
obs.store.MemoryStore,
),
):
Copy link
Author

Choose a reason for hiding this comment

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

@kylebarron I couldn't find an abstract base class or another way to simplify this, but suggestions for better approaches would be welcome

Copy link
Owner

Choose a reason for hiding this comment

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

Hmm, perhaps we should have a base class.

@@ -38,18 +38,29 @@ def __eq__(self, value: object) -> bool:
if not isinstance(value, ObjectStore):
return False

return self.store.__eq__(value.store)
return bool(self.store.__eq__(value.store))
Copy link
Author

Choose a reason for hiding this comment

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

This was added to avoid type errors with mypy

Copy link
Owner

@kylebarron kylebarron left a comment

Choose a reason for hiding this comment

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

Thank you! In the future we can update the isinstance check when obstore adds a base class.

@kylebarron kylebarron merged commit fb8b16d into kylebarron:kyle/object-store Dec 13, 2024
4 checks passed
@maxrjones maxrjones deleted the update-tests branch December 13, 2024 21:02
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