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

GenericModel (aliased import) not replaced #63

Open
mbbyn opened this issue Jul 9, 2023 · 1 comment
Open

GenericModel (aliased import) not replaced #63

mbbyn opened this issue Jul 9, 2023 · 1 comment

Comments

@mbbyn
Copy link

mbbyn commented Jul 9, 2023

Hello,

I ran the migration script, and promptly ran our tests, and they failed due to the following error:

ImportError while importing test module '/.....py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib/python3.10/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/......py:6: in <module>
    from api.common.model import AppException
api/.......py:12: in <module>
    from pydantic.generics import GenericModel as PyGenericModel  # noqa
E   ImportError: cannot import name 'GenericModel' from 'pydantic.generics' (/...../lib/python3.10/site-packages/pydantic/generics.py)

My guess is that perhaps the migration script doesn't handle as imports?

If any more details or repro case is useful, I'll be happy to oblige.

@mbbyn mbbyn changed the title GenericModel not replaced GenericModel (aliased import) not replaced Jul 9, 2023
@Kludex
Copy link
Member

Kludex commented Jul 18, 2023

Yeah, your guess is correct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants