Skip to content

[Bug]: spec.get() error #16

@longbingljw

Description

@longbingljw

Describe the bug

When I use ob as vector db to create document indexs in dify,"'str' object has no attribute 'get' " occured.The error occurs in the reflection.py file of the pyobvector library, where the spec variable is a string instead of a dictionary in certain cases, but the code directly calls spec.get().

Environment

pyobvector 0.2.14 latest

Fast reproduce steps

When using ob as vector db to create document indexs in dify,"'str' object has no attribute 'get' " occured.

Expected behavior

No response

Actual behavior

worker-1 | File "/app/api/.venv/lib/python3.12/site-packages/pyobvector/schema/reflection.py", line 79, in _par
se_constraints
worker-1 | if spec.get("onupdate", "").lower() == "restrict":
worker-1 | ^^^^^^^^
worker-1 | AttributeError: 'str' object has no attribute 'get'

Additional context

'str' object has no attribute 'get'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions