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

insert_many silently discards vectors if they're NumPy arrays #1002

Open
kylrth opened this issue Apr 10, 2024 · 4 comments
Open

insert_many silently discards vectors if they're NumPy arrays #1002

kylrth opened this issue Apr 10, 2024 · 4 comments
Labels
24Q1 target quarter bug Something isn't working

Comments

@kylrth
Copy link

kylrth commented Apr 10, 2024

If I have a collection c and call c.data.insert_many on a list[DataObject], each of which with the vector field set to a NumPy array, the upload returns without error but silently discards the vectors. The line that causes this behavior is here.

I would expect the NumPy array to be interpreted as a list of floats. Or, if this is undesirable for some reason, passing a NumPy array as a vector should result in an error.

@tsmith023
Copy link
Contributor

hi @kylrth, this is definitely a bug since we handle NumPy arrays gracefully in other areas of the API. I will make sure it's fixed for the next release. Thanks for raising it!

@tsmith023 tsmith023 added bug Something isn't working 24Q1 target quarter labels Apr 11, 2024
@manu156
Copy link

manu156 commented Apr 18, 2024

hi @tsmith023 Can I work on this?

@tsmith023
Copy link
Contributor

Yes thank you, that would be great!

@manu156
Copy link

manu156 commented Apr 20, 2024

@tsmith023 I have raised a PR, please review it.
I was not sure how to do it without importing numpy, I was having troubles with Pydantic throwing errors when specifying types without importing them. Also numpy.ndarray doesn't seem to implement Sequence from ABC, only closest thing it implements is Iterable, So I added a custom class for validation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
24Q1 target quarter bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants