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

Branch 3.0.0 v1 #57

Open
wants to merge 7 commits into
base: dev
Choose a base branch
from
Open

Branch 3.0.0 v1 #57

wants to merge 7 commits into from

Conversation

rahul-aerospike
Copy link

@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 28.70370% with 77 lines in your changes missing coverage. Please review.

Project coverage is 71.46%. Comparing base (2047a23) to head (76ee876).

Files with missing lines Patch % Lines
..._vector_search/shared/proto_generated/types_pb2.py 2.77% 35 Missing ⚠️
...ctor_search/shared/proto_generated/transact_pb2.py 4.54% 21 Missing ⚠️
..._vector_search/shared/proto_generated/index_pb2.py 5.00% 19 Missing ⚠️
src/aerospike_vector_search/types.py 90.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev      #57      +/-   ##
==========================================
+ Coverage   71.30%   71.46%   +0.15%     
==========================================
  Files          25       25              
  Lines        2255     2278      +23     
==========================================
+ Hits         1608     1628      +20     
- Misses        647      650       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@dwelch-spike dwelch-spike left a comment

Choose a reason for hiding this comment

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

Main comment is about moving from_proto_response to the conversions.py file.

@@ -337,7 +337,7 @@ def index_get_status(
logger.error("Failed to get index status with error: %s", e)
raise types.AVSServerError(rpc_error=e)

return self._respond_index_get_status(response)
return types.IndexStatusResponse.from_proto_response(response)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it makes more sense to have a separate helper method that creates an IndexStatusResponse from the proto response rather than a method on IndexStatusResponse. I think this because the method will be exposed to the user but the user is not concerned with how we create the object from a proto response.

@@ -349,7 +350,7 @@ async def index_get_status(
logger.error("Failed to get index status with error: %s", e)
raise types.AVSServerError(rpc_error=e)

return self._respond_index_get_status(response)
return IndexStatusResponse.from_proto_response(response)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it makes more sense to have a separate helper method that creates an IndexStatusResponse from the proto response rather than a method on IndexStatusResponse. I think this because the method will be exposed to the user but the user is not concerned with how we create the object from a proto response.

field: str,
sets: str,
hnsw_params: HnswParams,
storage: IndexStorage,
storage: Optional[IndexStorage] = None,
Copy link
Contributor

Choose a reason for hiding this comment

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

Why was this change made? Because all the fields of indexStorage are optional? Are you sure that means passing None as IndexStorage works? I think a test case for this would be good.

Comment on lines +925 to +943
def from_proto_response(response: 'index_pb2.IndexStatusResponse') -> 'IndexStatusResponse':
"""
Converts a protobuf IndexStatusResponse into an IndexStatusResponse object.

Parameters:
-----------
response : index_pb2.IndexStatusResponse
A protobuf IndexStatusResponse object.

Returns:
--------
IndexStatusResponse
An instance of IndexStatusResponse with the values from the protobuf message.
"""
result = IndexStatusResponse()
result.unmerged_record_count = response.unmergedRecordCount
result.index_healer_vector_records_indexed = response.indexHealerVectorRecordsIndexed
result.index_healer_vertices_valid = response.indexHealerVerticesValid
return result
Copy link
Contributor

Choose a reason for hiding this comment

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

In the client these conversions are done by helper methods in conversions.py. Take for example fromIndexDefintion. I think this should be moved there.

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