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

[Bug]: PropertyGraphIndex Value for metadata features must be one of (str, int, float, None) #17288

Open
haoyuhan1 opened this issue Dec 16, 2024 · 1 comment
Labels
bug Something isn't working triage Issue needs to be triaged/prioritized

Comments

@haoyuhan1
Copy link

haoyuhan1 commented Dec 16, 2024

Bug Description

I am using the DynamicLLMPathExtractor with allowed_entity_props=[]. It will generate some properties for iPad like: {'generation': '10th', 'storage': '64GB', 'price': '$349',
'features': ['Liquid Retina display', 'A14 Bionic chip', 'USB-C
charging'],

In the _insert_nodes_to_vector_index function, the self.vector_store.add(llama_nodes) will raise error as it requires "Value for metadata features must be one of (str, int, float, None)"

Version

0.12.2

Steps to Reproduce

DynamicLLMPathExtractor with allowed_entity_props=[]

Relevant Logs/Tracbacks

No response

@haoyuhan1 haoyuhan1 added bug Something isn't working triage Issue needs to be triaged/prioritized labels Dec 16, 2024
Copy link

dosubot bot commented Dec 16, 2024

Hey @haoyuhan1! I'm here to help you with any bugs, questions, or contributions you have. If you need assistance, feel free to ask!

The error you're encountering is due to the self.vector_store.add(llama_nodes) method, which requires metadata feature values to be of type str, int, float, or None. The list data type in your metadata (e.g., features: ['Liquid Retina display', 'A14 Bionic chip', 'USB-C charging']) is causing the issue.

To resolve this, you can convert list data types in your metadata to a string format before inserting them into the vector store. For example, you can join the list items into a single string:

metadata['features'] = ', '.join(metadata['features'])

This conversion will ensure that all metadata values are of an acceptable type for the vector store.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage Issue needs to be triaged/prioritized
Projects
None yet
Development

No branches or pull requests

1 participant