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

fixing extractAdditionalPropsFromMetadata not using linkedClassName #6279

Closed
1 task done
paul7Junior opened this issue Nov 9, 2024 · 0 comments
Closed
1 task done
Labels

Comments

@paul7Junior
Copy link
Contributor

paul7Junior commented Nov 9, 2024

How to reproduce this bug?

This would setup 2 collections with named vectors and query vectors on hasRef reference

from weaviate.classes.query import MetadataQuery, Filter, QueryReference
client = weaviate.connect_to_local()

clt_source = client.collections.create(
    name='CltSource',
    properties=[
        Property(name="name", data_type=DataType.TEXT),
    ],
    vectorizer_config=[Configure.NamedVectors.none(name="bringYourOwnFromSource1")]
)

clt_target = client.collections.create(
    name='CltTarget',
    properties=[
        Property(name="name", data_type=DataType.TEXT),
    ],
    vectorizer_config=[Configure.NamedVectors.none(name="bringYourOwn1"),
                        Configure.NamedVectors.none(name="bringYourOwn2")]
)

clt_source.config.add_reference(ReferenceProperty(name="hasRef",target_collection='CltTarget'))

uuid_target=clt_target.data.insert(properties = {'name': 'name_val_target'}, vector={'bringYourOwn1':[1,2,3],'bringYourOwn2':[4,5,6]})
uuid_source=clt_source.data.insert(properties = {'name': 'name_val_source'}, references={'hasRef':uuid_target})

include_vector_boolean=clt_source.query.fetch_objects(
    return_references=QueryReference(
    link_on='hasRef', 
    include_vector=True))

include_vector_boolean.objects[0].references['hasRef'].objects[0].vector

What is the expected behavior?

This should return all the vectors in the reference bringYourOwn1 and bringYourOwn2

What is the actual behavior?

Returns a dict where the keys are the source collection vector names and the values are empty.

Supporting information

I am still not sure if this is a bug or if this is me not using the library correctly.

As I would expect lots of people trying to get the vectors associated with a reference, but maybe others are using workaround just like I was.

Also I am fairly new to Go and gRPC, so it was an opportunity for me to deep dive into Weaviate code and managed to get Weaviate code running locally on my laptop and learning the basics of Go and gRPC which is really good. Also the fact that I managed to find that within a day shows that its easy for newbies to deep dive into weaviate code base.

I created a new draft pull request and with some guidance, I am happy add a couple tests for this.

#6278

Server Version

1.27.0

Weaviate Setup

Single Node

Nodes count

1

Code of Conduct

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants