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
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/integration_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,7 @@ jobs:
- name: Build and install aerospike-vector-search
run: |
python -m build
pip install dist/aerospike_vector_search-2.1.0-py3-none-any.whl
pip install dist/aerospike_vector_search-3.0.0-py3-none-any.whl

- name: Upload to Codecov
uses: codecov/codecov-action@v4
Expand Down
6 changes: 6 additions & 0 deletions proto/index.proto
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ import "types.proto";
message IndexStatusResponse {
// Number of unmerged index records.
int64 unmergedRecordCount = 2;

// Number of vector records indexed (0 in case healer has not yet run).
int64 indexHealerVectorRecordsIndexed = 3;

// Number of vertices in the main index (0 in case healer has not yet run).
int64 indexHealerVerticesValid = 4;
}

message GcInvalidVerticesRequest {
Expand Down
8 changes: 4 additions & 4 deletions proto/transact.proto
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ message PutRequest {
// The key for the record to insert/update
Key key = 1;

// The type of the put/write request.
WriteType writeType = 2;
// The type of the put/write request. Defaults to UPSERT.
optional WriteType writeType = 2;

// The record fields.
repeated Field fields = 3;
Expand Down Expand Up @@ -88,8 +88,8 @@ enum ProjectionType {

// A projection filter.
message ProjectionFilter {
// The type of the selector.
ProjectionType type = 1;
// The type of the selector. Defaults to ALL.
optional ProjectionType type = 1;

// Names of desired fields / selectors.
repeated string fields = 2;
Expand Down
18 changes: 13 additions & 5 deletions proto/types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,10 @@ message HnswParams {

// Configures merge of batch indices to main index.
HnswIndexMergeParams mergeParams = 8;

// Verify whether the underlying vector has changed before returning the kAnn
// result. Defaults to true.
optional bool enableVectorIntegrityCheck = 9;
}

// Params for the HNSW index search.
Expand Down Expand Up @@ -234,7 +238,7 @@ message HnswCachingParams {
// A cache entry will expire after this time in milliseconds has
// expired after the entry was added to cache.
// Defaults to the global cache config configured for the VectorDB.
optional uint64 expiry = 2;
optional int64 expiry = 2;
}

// Params to configure Hnsw index cache
Expand Down Expand Up @@ -292,6 +296,10 @@ message HnswIndexUpdate {

// Configures merge of batch indices to main index.
optional HnswIndexMergeParams mergeParams = 5;

// Verify whether the underlying vector has changed before returning the kAnn
// result. Defaults to true.
optional bool enableVectorIntegrityCheck = 6;
}

// Index storage configuration
Expand All @@ -310,15 +318,15 @@ message IndexDefinition {
// The index identifier.
IndexId id = 1;

// The type of index.
IndexType type = 2;
// The type of index. Defaults to HNSW.
optional IndexType type = 2;

// Number of dimensions in data.
// Vectors not matching the dimension count will not be indexed.
uint32 dimensions = 3;

// Optional The distance metric to use. Defaults to SQUARED_EUCLIDEAN
VectorDistanceMetric vectorDistanceMetric = 4;
// Optional The distance metric to use. Defaults to SQUARED_EUCLIDEAN.
optional VectorDistanceMetric vectorDistanceMetric = 4;

// Name of the record vector field to index.
string field = 5;
Expand Down
10 changes: 5 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ classifiers = [
"Programming Language :: Python :: Implementation :: CPython",
"Topic :: Database"
]
version = "2.1.0"
version = "3.0.0"
requires-python = ">3.8"
dependencies = [
"grpcio == 1.66.1",
"protobuf == 5.27.2",
"pyjwt == 2.8.0",
"grpcio == 1.67.0",
"protobuf == 5.28.2",
"pyjwt == 2.9.0",
"numpy",
"sphinx_rtd_theme"
]
Expand All @@ -54,4 +54,4 @@ exclude = '''
| src/aerospike_vector_search/__pycache__/*
| src/aerospike_vector_search.egg-info/*
)/
'''
'''
6 changes: 3 additions & 3 deletions src/aerospike_vector_search/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ def index_get(

def index_get_status(
self, *, namespace: str, name: str, timeout: Optional[int] = None
) -> int:
) -> types.IndexStatusResponse:
"""
Retrieve the number of records queued to be merged into an index.

Expand All @@ -311,7 +311,7 @@ def index_get_status(
:param timeout: Time in seconds this operation will wait before raising an :class:`AVSServerError <aerospike_vector_search.types.AVSServerError>`. Defaults to None.
:type timeout: int

Returns: int: Records queued to be merged into an index.
Returns: IndexStatusResponse: AVS response containing index status information.

Raises:
AVSServerError: Raised if an error occurs during the RPC communication with the server while attempting to get the index status.
Expand All @@ -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.


def add_user(
self,
Expand Down
5 changes: 3 additions & 2 deletions src/aerospike_vector_search/aio/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from .. import types
from .internal import channel_provider
from ..shared.admin_helpers import BaseClient
from ..types import IndexStatusResponse

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -308,7 +309,7 @@ async def index_get(

async def index_get_status(
self, *, namespace: str, name: str, timeout: Optional[int] = None
) -> int:
) -> types.IndexStatusResponse:
"""
Retrieve the number of records queued to be merged into an index.

Expand Down Expand Up @@ -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.


async def add_user(
self,
Expand Down
1 change: 1 addition & 0 deletions src/aerospike_vector_search/shared/admin_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from .proto_generated import types_pb2, user_admin_pb2, index_pb2
from .. import types
from . import conversions
from ..types import AVSClientError

logger = logging.getLogger(__name__)

Expand Down
1 change: 1 addition & 0 deletions src/aerospike_vector_search/shared/client_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from .. import types
from .proto_generated import types_pb2
from . import helpers
from ..types import AVSClientError


class BaseClient(object):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from . import auth_pb2 as auth__pb2

GRPC_GENERATED_VERSION = '1.66.1'
GRPC_GENERATED_VERSION = '1.66.2'
GRPC_VERSION = grpc.__version__
_version_not_supported = False

Expand Down
40 changes: 20 additions & 20 deletions src/aerospike_vector_search/shared/proto_generated/index_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from . import index_pb2 as index__pb2
from . import types_pb2 as types__pb2

GRPC_GENERATED_VERSION = '1.66.1'
GRPC_GENERATED_VERSION = '1.66.2'
GRPC_VERSION = grpc.__version__
_version_not_supported = False

Expand Down
Loading
Loading