-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[STACKED #1237] [ENH] Move get_or_create into sysdb #1242
Conversation
Current dependencies on/for this PR: This comment was auto-generated by Graphite. |
Reviewer ChecklistPlease leverage this checklist to ensure your code review is thorough before approving Testing, Bugs, Errors, Logs, Documentation
System Compatibility
Quality
|
@@ -105,33 +105,20 @@ def create_collection( | |||
embedding_function: Optional[EmbeddingFunction] = ef.DefaultEmbeddingFunction(), | |||
get_or_create: bool = False, | |||
) -> Collection: | |||
existing = self._sysdb.get_collections(name=name) |
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.
Logic removed from here
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.
LGTM
@@ -59,9 +59,13 @@ def create_collection( | |||
name: str, | |||
metadata: Optional[Metadata] = None, | |||
dimension: Optional[int] = None, | |||
get_or_create: bool = False, |
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.
Add get_or_create into here
@@ -44,8 +44,11 @@ message UpdateSegmentRequest { | |||
} | |||
|
|||
message CreateCollectionRequest { |
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.
Alter grpc type to match the flattened input
) -> Collection: | ||
"""Create a new collection and the associate topic""" | ||
if id is None and not get_or_create: |
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.
Logic to handle get_or_create is in here now
3e01da7
to
47c73e9
Compare
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.
LGTM
@@ -105,33 +105,20 @@ def create_collection( | |||
embedding_function: Optional[EmbeddingFunction] = ef.DefaultEmbeddingFunction(), | |||
get_or_create: bool = False, | |||
) -> Collection: | |||
existing = self._sysdb.get_collections(name=name) |
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.
LGTM
## Description of changes This PR is stacked on #1228, please TAL at that before this. *Summarize the changes made by this PR.* - Improvements & Bug fixes - n/a - New functionality - Introduced a grpc sysdb implementation. - Migrate the protobufs to support Null vs Presence where needed. - Added minimal protobuf definitions to implement the grpc coordinator - Add a mock grpc sysdb server that reimplements the core functionality in memory for testing. Will address the following open questions in stacked PRs! Open questions/issues: - [x] Collection <> Topic Mapping _This requires some thought if we use hashing then we can just map the collection onto a topic and store it. Will we ever want to shard a collection across topics?_ I don't think this is needed at this moment! - [x] Topic management moving to sysdb interface _This is conceptually simple, we make topic creation implicitly part of sysdb create collection_ I address this in #1237 - [x] We need to move the get_or_create concept into sysdb _This is conceptually simple, we just move this logic into sysdb and make it aware of it_ I address this in #1242 ## Test plan *How are these changes tested?* I added a mock gRPC server that implements the basic functionality of sysdb with in memory data structures. We will run the coordinator tests with this impl in the bin/cluster test once the go coordinator service is ready from @Ishiihara ## Documentation Changes None required.
b78877a
to
f4ef680
Compare
47c73e9
to
ee2849b
Compare
Description of changes
Summarize the changes made by this PR.
Test plan
How are these changes tested?
Existing tests as well as a new test at the sysdb level.
pytest
for python,yarn test
for jsDocumentation Changes
None, all changes are to internal interfaces.