From 326a8e972989762fa40f444e53437eed1e481d05 Mon Sep 17 00:00:00 2001 From: Dominic Pelini <111786059+DomPeliniAerospike@users.noreply.github.com> Date: Thu, 4 Apr 2024 13:35:25 -0600 Subject: [PATCH 1/2] Update vectordb_channel_provider.py --- src/aerospike_vector/vectordb_channel_provider.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/aerospike_vector/vectordb_channel_provider.py b/src/aerospike_vector/vectordb_channel_provider.py index 03e01a3e..14c90968 100644 --- a/src/aerospike_vector/vectordb_channel_provider.py +++ b/src/aerospike_vector/vectordb_channel_provider.py @@ -50,16 +50,16 @@ async def close(self): if channelEndpoints.channel: await channelEndpoints.channel.close() - def getChannel(self) -> grpc.Channel: + def get_channel(self) -> grpc.Channel: if not self._is_loadbalancer: - discoveredChannels: list[ChannelAndEndpoints] = list( + discovered_channels: list[ChannelAndEndpoints] = list( self._nodeChannels.values()) - if len(discoveredChannels) <= 0: + if len(discovered_channels) <= 0: return self._seedChannels[0] # Return a random channel. - channel = random.choice(discoveredChannels).channel + channel = random.choice(discovered_channels).channel if channel: return channel From efb98234764463518c549150940f7b731bbeb5d4 Mon Sep 17 00:00:00 2001 From: Dominic Pelini <111786059+DomPeliniAerospike@users.noreply.github.com> Date: Thu, 4 Apr 2024 13:47:09 -0600 Subject: [PATCH 2/2] Removed print statements and corrected expected result --- tests/test_vector_get_put_exists.py | 3 ++- tests/test_vector_search.py | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_vector_get_put_exists.py b/tests/test_vector_get_put_exists.py index b5feadb5..aa715e64 100644 --- a/tests/test_vector_get_put_exists.py +++ b/tests/test_vector_get_put_exists.py @@ -3,6 +3,7 @@ async def test_vector_put(truncated_vector_client): namespace="test", key="example", record_data={"chocolate": [0 for i in range(1024)]}, + ) @@ -11,7 +12,7 @@ async def test_vector_get(truncated_vector_client): namespace="test", key="example", bin_names=["chocolate"] ) assert result.key.namespace == "test" - assert result.key.set == "demo" + assert result.key.set == "" assert result.key.key == "example" assert isinstance(result.key.digest, bytes) assert result.bins["chocolate"] == [0 for i in range(1024)] diff --git a/tests/test_vector_search.py b/tests/test_vector_search.py index 8ec90227..520c7639 100644 --- a/tests/test_vector_search.py +++ b/tests/test_vector_search.py @@ -126,7 +126,6 @@ async def test_vector_search( binList = [] for j, result in enumerate(results[i]): - print(result) binList.append(result.bins["unit_test"]) for j, index in enumerate(outside): vector = base_numpy[index].tolist()