Skip to content

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

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

Open
jseguillon opened this issue Jan 30, 2025 · 1 comment
Open

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

jseguillon opened this issue Jan 30, 2025 · 1 comment
Labels
kind/bug Something isn't working stale Issue marked as stale by Dapr Bot
Milestone

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
@elena-kolevska elena-kolevska added this to the v1.16 milestone Mar 11, 2025
@dapr-bot
Copy link
Collaborator

This issue has been automatically marked as stale because it has not had activity in the last 60 days. It will be closed in the next 7 days unless it is tagged (pinned, good first issue, help wanted or triaged/resolved) or other activity occurs. Thank you for your contributions.

@dapr-bot dapr-bot added the stale Issue marked as stale by Dapr Bot label May 10, 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 stale Issue marked as stale by Dapr Bot
Projects
None yet
Development

No branches or pull requests

3 participants