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
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "pydantic/main.py", line 262, in pydantic.main.ModelMetaclass.__new__
File "pydantic/fields.py", line 315, in pydantic.fields.ModelField.infer
File "pydantic/fields.py", line 284, in pydantic.fields.ModelField.__init__
File "pydantic/fields.py", line 356, in pydantic.fields.ModelField.prepare
File "pydantic/fields.py", line 492, in pydantic.fields.ModelField._type_analysis
IndexError: tuple index out of range
The text was updated successfully, but these errors were encountered:
Resolves issue found when using improved type annotations.
Looks like this may be the cause: pydantic/pydantic#2060
$ ./update_prevalence.py
Traceback (most recent call last):
File "/Users/broz/src/microCOVID/./update_prevalence.py", line 367, in <module>
class Place(pydantic.BaseModel):
File "/Users/broz/src/microCOVID/.venv/lib/python3.10/site-packages/pydantic/main.py", line 299, in __new__
fields[ann_name] = ModelField.infer(
File "/Users/broz/src/microCOVID/.venv/lib/python3.10/site-packages/pydantic/fields.py", line 411, in infer
return cls(
File "/Users/broz/src/microCOVID/.venv/lib/python3.10/site-packages/pydantic/fields.py", line 342, in __init__
self.prepare()
File "/Users/broz/src/microCOVID/.venv/lib/python3.10/site-packages/pydantic/fields.py", line 451, in prepare
self._type_analysis()
File "/Users/broz/src/microCOVID/.venv/lib/python3.10/site-packages/pydantic/fields.py", line 604, in _type_analysis
self.type_ = get_args(self.type_)[1]
IndexError: tuple index out of range
$
Checks
Bug
Output of
python -c "import pydantic.utils; print(pydantic.utils.version_info())"
:Minimal example:
Result:
The text was updated successfully, but these errors were encountered: