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

annotations bug #89

Open
GrafLearnt opened this issue Feb 22, 2024 · 2 comments
Open

annotations bug #89

GrafLearnt opened this issue Feb 22, 2024 · 2 comments
Assignees
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@GrafLearnt
Copy link

When
from __future__ import annotations
is imported got following error:

        **{
            key: value
            for key, value in query_params.to_dict(flat=False).items()
>           if key in model.__fields__ and model.__fields__[key].is_complex()
        },
    }
E   AttributeError: 'str' object has no attribute '__fields__'

local model variable became str instead of pydantic class

Virtualenv
Python: 3.11.7
Implementation: CPython

System
Platform: darwin
OS: posix
Python: 3.11.7

@yctomwang
Copy link
Collaborator

@GrafLearnt Hi there, thank you for your bug report. Can you please include some more details? Like the model you are trying to verify against? it be nice if you could include a minimal example for us to look into!

@yctomwang yctomwang added the bug Something isn't working label Feb 23, 2024
@yctomwang yctomwang self-assigned this Feb 23, 2024
@yctomwang
Copy link
Collaborator

This is my understanding of the problem, is that if you have from future import annotations anywhere in the code, the package will have problem like
image

@yctomwang yctomwang added the help wanted Extra attention is needed label Feb 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants