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

Import all 3rd party modules with an extra _module prefix #332

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dominusmi
Copy link

This solves an issue which specifically affects the uuid classes (as explained here #331), but can generally affect any conflict in field name vs import.
What this PR do is add the prefix _module to any third-party imports, so for the case of uuid, it would result in a schema like:

import uuid as uuid_module
[...]
class SomeTable(Base):
  uuid: Mapped[uuid_module.uuid] = mapped_column(Uuid)

The third-party modules are used in two locations as can be seen in the compare. A better way to solve this would be to have some mapping instead a set, such as:

{"real module name": "imported as module name"}

but it would require bigger changes - this method works and is simple

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

Successfully merging this pull request may close these issues.

1 participant