Skip to content
New issue

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

Python 3.9.8 causes TypeError #3423

Closed
3 tasks done
ahopkins opened this issue Nov 16, 2021 · 2 comments
Closed
3 tasks done

Python 3.9.8 causes TypeError #3423

ahopkins opened this issue Nov 16, 2021 · 2 comments
Labels
bug V1 Bug related to Pydantic V1.X

Comments

@ahopkins
Copy link

Checks

  • I added a descriptive title to this issue
  • I have searched (google, github) for similar issues and couldn't find anything
  • I have read and followed the docs and still think this is a bug

Bug

Our CI upgraded to v3.9.9. It comes back with the following error. It appears the problem was introduced in 3.9.8. It seems okay in 3.9.7.

pydantic/main.py:299: in pydantic.main.ModelMetaclass.__new__
pydantic/fields.py:411: in pydantic.fields.ModelField.infer
pydantic/fields.py:342: in pydantic.fields.ModelField.__init__
pydantic/fields.py:456: in pydantic.fields.ModelField.prepare
pydantic/fields.py:670: in pydantic.fields.ModelField.populate_validators
pydantic/validators.py:675: in find_validators
pydantic/dataclasses.py:266: in make_dataclass_validator
pydantic/dataclasses.py:255: in pydantic.dataclasses.dataclass
pydantic/dataclasses.py:250: in pydantic.dataclasses.dataclass.wrap
pydantic/dataclasses.py:148: in pydantic.dataclasses._process_class
pydantic/typing.py:287: in pydantic.typing.resolve_annotations
/usr/lib/python3.9/typing.py:292: in _eval_type
    return t._evaluate(globalns, localns, recursive_guard)
/usr/lib/python3.9/typing.py:553: in _evaluate
    type_ = _type_check(
/usr/lib/python3.9/typing.py:158: in _type_check
    raise TypeError(f"{arg} is not valid as type argument")
E   TypeError: typing.ClassVar[typing.Pattern[str]] is not valid as type argument
pydantic==1.8.2
@ahopkins ahopkins added the bug V1 Bug related to Pydantic V1.X label Nov 16, 2021
@hellocoldworld
Copy link

This might be related to #3401 and #3403

@ahopkins
Copy link
Author

@hellocoldworld Perfect! Thanks. Closing in favor of the alternative.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug V1 Bug related to Pydantic V1.X
Projects
None yet
Development

No branches or pull requests

2 participants