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'
reproduction:
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.
Workaround:
create another file and place your data classes in them
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