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

variant rendering is missing the "dialect-specific variant first" use case #1585

Closed
zzzeek opened this issue Dec 24, 2024 Discussed in #1584 · 1 comment
Closed

variant rendering is missing the "dialect-specific variant first" use case #1585

zzzeek opened this issue Dec 24, 2024 Discussed in #1584 · 1 comment
Labels
autogenerate - rendering bug Something isn't working

Comments

@zzzeek
Copy link
Member

zzzeek commented Dec 24, 2024

Discussed in #1584

    def test_render_reverse_variant(self):
        self.autogen_context.opts["user_module_prefix"] = None

        type_ = (
            LONGTEXT().with_variant(String(10), "oracle")
        )

        eq_ignore_whitespace(
            autogenerate.render._repr_type(type_, self.autogen_context),
            "mysql.LONGTEXT()."
            "with_variant(sa.String(length=10), 'oracle')",
        )

skips the variants due to dialect check first

@zzzeek zzzeek added bug Something isn't working autogenerate - rendering labels Dec 24, 2024
@sqla-tester
Copy link
Collaborator

Mike Bayer has proposed a fix for this issue in the main branch:

check for variants (recursion branch) first in all cases https://gerrit.sqlalchemy.org/c/sqlalchemy/alembic/+/5639

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autogenerate - rendering bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants