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

Alembic automatic migration scripts with compare_type=True fails for Float types #215

Closed
AntonFriberg opened this issue Nov 10, 2022 · 0 comments · Fixed by #216
Closed

Comments

@AntonFriberg
Copy link
Contributor

Describe the bug

If you enable Alembic's optional detection of column type changes (https://alembic.sqlalchemy.org/en/latest/autogenerate.html#what-does-autogenerate-detect-and-what-does-it-not-detect) it would generate a change that changes a sqlalchemy.sql.sqltypes.FLOAT column into a clickhouse_sqlalchemy.types.common.Float64 column despite the model specifying a clickhouse_sqlalchemy.types.common.Float64 and the table having a Float64 type.

Expected behavior
The generated alembic migration should not contain changes of FLOAT into Float64 if the type is Float64 already.

Versions

  • Version of package with the problem.
  • Current master clickhouse-sqlalchemy @ git+https://github.com/xzkostyan/clickhouse-sqlalchemy@c69984feb7b210553969b21505f4495ffb5a4b77

I believe I have found the source of the problem in https://github.com/xzkostyan/clickhouse-sqlalchemy/blob/master/clickhouse_sqlalchemy/drivers/base.py#L40 . The inconsistency with the type converter definitions seems to cause this. I will upload a PR which solves my problem and removes the inconsistency.

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 a pull request may close this issue.

1 participant