-
Notifications
You must be signed in to change notification settings - Fork 13
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
list_refs #318
base: main
Are you sure you want to change the base?
Conversation
@@ -3,6 +3,12 @@ import datetime | |||
from collections.abc import AsyncGenerator | |||
from typing import Any | |||
|
|||
class Ref: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this really the model we want to return to users?
Alternatives could be:
- Arraylake style Pydantic models:
BranchName(str)
andTagName(str)
- or,
class RefType(Enum):
BRANCH = auto()
TAG = auto()
class Ref:
name: str
kind: RefType
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh sorry, forgot to comment. i like your approach best, but I'd like to see how easy/hard is to pattern match the result in python. Probably tests will show me that.
Other option would be to have separate functions, list_tags
and list_branches
, or maybe the three of them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that tags and branches can be in separate functions and that simplifies a lot from the Python user perspective
} | ||
|
||
#[pymethods] | ||
impl PyRef { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
beautiful
@@ -432,6 +464,25 @@ impl PyIcechunkStore { | |||
Ok(snapshot_id.to_string()) | |||
} | |||
|
|||
fn list_refs<'py>( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we also provide async_list_refs
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we add a python test that exercises this new function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I can do both. I'd like some input on #318 (comment) first before I tackle those.
Closes #136