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

Investigate vector given as string #1509

Open
dirkkul opened this issue Jan 13, 2025 · 2 comments
Open

Investigate vector given as string #1509

dirkkul opened this issue Jan 13, 2025 · 2 comments

Comments

@dirkkul
Copy link
Collaborator

dirkkul commented Jan 13, 2025

From a user report:

I just tried inserting ["0.4", "0.2"...] instead of [0.4, 0.2].. again silly but Weaviate accepted this but was then unable to query the vectors it seemed.

@sebawita
Copy link

Hey @dirkkul,

I tried to reproduce it, but I Weaviate rejected both of my attempts:

Example 1

qt = client.collections.get("QuickTest")
qt.data.insert(
    properties={
        "title": "Try Array of strings as a vector"
    },
    vector=["0.1", "0.2"]
)

Throws the following error:

UnexpectedStatusCodeError: Object was not added! Unexpected status code: 400, with response body: {'code': 400, 'message': 'parsing body body from "" failed, because json: cannot unmarshal string into Go struct field Object.vector of type float32'}.

Example 2

qt = client.collections.get("QuickTest")
qt.data.insert(
    properties={
        "title": "Try a string with an array text inside"
    },
    vector="[0.1, 0.2]"
)

Throws the following error:

WeaviateInvalidInputError: Invalid input provided: The vector you supplied was malformatted! Vector: [0.1, 0.2].

@dirkkul
Copy link
Collaborator Author

dirkkul commented Feb 12, 2025

Thanks for checking @sebawita - if you have time, could you also try insert_many?

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

No branches or pull requests

3 participants