Skip to content

fix: fix conversion in create_payload_index, add tests - #750

Merged
joein merged 2 commits into
devfrom
fix-payload-index-conversion
Aug 22, 2024
Merged

fix: fix conversion in create_payload_index, add tests#750
joein merged 2 commits into
devfrom
fix-payload-index-conversion

Conversation

@joein

@joein joein commented Aug 20, 2024

Copy link
Copy Markdown
Member

we forgot to use conversion for parametrized payload indices in create_payload_index

this PR adds the necessary invocations

a bug in core was found related to the creation of parametrized geo and bool indices

grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
	status = StatusCode.INVALID_ARGUMENT
	details = "field_type (Geo) and field_index_params do not match"
	debug_error_string = "UNKNOWN:Error received from peer  {grpc_message:"field_type (Geo) and field_index_params do not match", grpc_status:3, created_time:"2024-08-20T21:42:22.125081+02:00"}"

There are new tests, which can reproduce this error (tests/test_qdrant_client.py::test_create_payload_index)

grpc code snippet to reproduce the issue:

from qdrant_client import grpc
from qdrant_client import QdrantClient, models

collection_name = "checkgeo"
cl = QdrantClient(prefer_grpc=True)
if cl.collection_exists(collection_name):
    cl.delete_collection(collection_name)
cl.create_collection(
    collection_name, vectors_config=models.VectorParams(size=2, distance=models.Distance.COSINE)
)
field_name = "testfield"
field_schema = grpc.FieldType.FieldTypeGeo
field_index_params = grpc.PayloadIndexParams(geo_index_params=grpc.GeoIndexParams())
request = grpc.CreateFieldIndexCollection(
    collection_name=collection_name,
    field_name=field_name,
    field_type=field_schema,
    field_index_params=field_index_params,
    wait=True,
)

print(cl._client.grpc_points.CreateFieldIndex(request).result)

cc: @coszio

@netlify

netlify Bot commented Aug 20, 2024

Copy link
Copy Markdown

Deploy Preview for poetic-froyo-8baba7 ready!

Name Link
🔨 Latest commit b4295de
🔍 Latest deploy log https://app.netlify.com/sites/poetic-froyo-8baba7/deploys/66c73f0b63f7f80008078917
😎 Deploy Preview https://deploy-preview-750--poetic-froyo-8baba7.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@joein
joein merged commit 72f7769 into dev Aug 22, 2024
joein added a commit that referenced this pull request Aug 26, 2024
* fix: fix conversion in create_payload_index, add tests

* fix: fix backward compatibility tests
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.

2 participants