collerek / ormar

python async orm with fastapi in mind and pydantic validation
https://collerek.github.io/ormar/
MIT License
1.68k stars 89 forks source link

Random error when prefetching models #1381

Open cadlagtrader opened 4 months ago

cadlagtrader commented 4 months ago

Describe the bug I am seeing random errors when prefetching a model with ormar 0.20.1 Identified the bug in translate_list_to_dict using a dict as a default argument

To Reproduce translate_list_to_dict(["aa", "aa__inner", "bb"], default={})

Expected behavior ret = {"aa": {"inner": {}}, "bb": {}}

cadlagtrader commented 4 months ago

https://github.com/collerek/ormar/pull/1382