We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
get_type_hints is used by Pydantic, dacite etc. to create their model classes, so it'S kinda important.
Currentliy, this is broken in main.py:
Traceback (most recent call last): File "***\main.py", line 40, in ar_v4 data = dacite.from_dict(RequestData2, message) File "***\venv\lib\site-packages\dacite\core.py", line 43, in from_dict data_class_hints = get_type_hints(data_class, globalns=config.forward_references) File "C:\dev\python3.8\lib\typing.py", line 1220, in get_type_hints base_globals = sys.modules[base.__module__].__dict__ KeyError: 'main'
install dacite in main.py
import dacite import dataclasses @dataclasses.dataclass class RequestData2: product_number: int def hello_world(request): message = request.get_json() data = dacite.from_dict(RequestData2, message) return ""
post some data to it and observe the error.
create another file and place your data classes in them
The text was updated successfully, but these errors were encountered:
Thanks for the bug report! This is fixed in functions-framework==1.4.3.
functions-framework==1.4.3
Sorry, something went wrong.
Thanks!
Successfully merging a pull request may close this issue.
get_type_hints is used by Pydantic, dacite etc. to create their model classes, so it'S kinda important.
Currentliy, this is broken in main.py:
reproduction:
install dacite
in main.py
post some data to it and observe the error.
Workaround:
create another file and place your data classes in them
The text was updated successfully, but these errors were encountered: