You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm experiencing issues when using the pytradfri library in an app with Gunicorn.
However, the issue seems to be related to pydantic in first place.
I get this error while bootstrapping:
File "/usr/local/lib/python3.11/site-packages/pydantic/_internal/_model_construction.py", line 171, in __new__
set_model_fields(cls, bases, config_wrapper, types_namespace)
File "/usr/local/lib/python3.11/site-packages/pydantic/_internal/_model_construction.py", line 361, in set_model_fields
fields, class_vars = collect_model_fields(cls, bases, config_wrapper, types_namespace, typevars_map=typevars_map)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/pydantic/_internal/_fields.py", line 112, in collect_model_fields
raise NameError(f'Field "{ann_name}" has conflict with protected namespace "{protected_namespace}"')
NameError: Field "model_number" has conflict with protected namespace "model_"
I did an upgrade to 2.0 in another library and apparently, in order to be able to transition smoothly into the new version, you can selectively import from v1 of the library under v2. This is a potential way to move forward and keep the current field name.
Hi there,
I'm experiencing issues when using the pytradfri library in an app with Gunicorn.
However, the issue seems to be related to pydantic in first place.
I get this error while bootstrapping:
The root cause seems to be this class:
pytradfri/pytradfri/device/__init__.py
Line 43 in 58efa75
Having field names prefixed with
model
seems to be discouraged now:(see: Model Namespace Cleanup)
Not sure how/if this could/should be fixed in the pytradfri library though.
Thanks for reading. 😄
The text was updated successfully, but these errors were encountered: