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

本地debug,报pydantic的KeyError: 'UUID' #15

Open
fenglvming opened this issue Jul 8, 2024 · 3 comments
Open

本地debug,报pydantic的KeyError: 'UUID' #15

fenglvming opened this issue Jul 8, 2024 · 3 comments

Comments

@fenglvming
Copy link

启动方式,本地python app/main.py

File "/opt/anaconda3/envs/labelllm/lib/python3.11/site-packages/pydantic/_internal/_core_utils.py", line 197, in walk
return f(schema, self._walk)
^^^^^^^^^^^^^^^^^^^^^
File "/opt/anaconda3/envs/labelllm/lib/python3.11/site-packages/pydantic/_internal/_core_utils.py", line 441, in collect_refs
return recurse(s, collect_refs)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/anaconda3/envs/labelllm/lib/python3.11/site-packages/pydantic/_internal/_core_utils.py", line 200, in _walk
schema = self._schema_type_to_method[schema['type']](schema.copy(), f)
~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^
KeyError: 'UUID'

@lacia-hIE
Copy link
Collaborator

可以提供更多有效信息吗,例如完整的启动步骤

@ZhongQiyu
Copy link

UUID是百度的标记算法, 你看一下怎么弄

@HycJack
Copy link

HycJack commented Oct 14, 2024

根据 beanie 这个库的 issues,将models中各个类的id, Indexed(UUID, unique=True) 改成 Annotated[UUID, Indexed(unique=True)]可以解决这个问题。

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

4 participants