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

[DOC] fast-api ext demo: "non-annotated attribute was detected" #775

Open
jseguillon opened this issue Jan 30, 2025 · 0 comments
Open

[DOC] fast-api ext demo: "non-annotated attribute was detected" #775

jseguillon opened this issue Jan 30, 2025 · 0 comments
Labels
kind/bug Something isn't working

Comments

@jseguillon
Copy link

Expected Behavior

Open dapr fastapi ext doc, copy paste example and make it work

Actual Behavior

Pydantic refuses example:

== APP == Traceback (most recent call last):
== APP ==   File "/home/jse/python-sdk/test.py", line 9, in <module>
== APP ==     class User(BaseModel):
== APP ==   File "/home/jse/python-sdk/venv/lib/python3.10/site-packages/pydantic/_internal/_model_construction.py", line 113, in __new__
== APP ==     private_attributes = inspect_namespace(
== APP ==   File "/home/jse/python-sdk/venv/lib/python3.10/site-packages/pydantic/_internal/_model_construction.py", line 450, in inspect_namespace
== APP ==     raise PydanticUserError(
== APP == pydantic.errors.PydanticUserError: A non-annotated attribute was detected: `name = 'Jane Doe'`. All model fields require a type annotation; if `name` is not meant to be a field, you may be able to resolve this error by annotating it as a `ClassVar` or updating `model_config['ignored_types']`.
== APP == 
== APP == For further information visit https://errors.pydantic.dev/2.10/u/model-field-missing-annotation

Steps to Reproduce the Problem

Copy paste example and run

Release Note

Release note not applicable I think.

@jseguillon jseguillon added the kind/bug Something isn't working label Jan 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant