You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The first migration and table creation will work as expected.
But running alembic revision --autogenerate after table created, something weird will happen:
INFO [alembic.autogenerate.compare] Detected type change from DateTime64(timezone="'UTC'") to DateTime64(timezone='UTC') on 'test_table.time'
After tracing the code, it seems that _parse_detetime64_params did not handle the quotes correctly; when the inner spec is 3, 'UTC', it will return [3, "'UTC'"] thus hit the issue. In my own code I create patch to clickhouse_sqlalchemy.drivers.base.ClickHouseDialect._parse_detetime64_params:
Describe the bug
Table reflection for DateTime64 timezone will be extra quoted
To Reproduce
If you have a table like
The first migration and table creation will work as expected.
But running
alembic revision --autogenerate
after table created, something weird will happen:After tracing the code, it seems that
_parse_detetime64_params
did not handle the quotes correctly; when the inner spec is3, 'UTC'
, it will return[3, "'UTC'"]
thus hit the issue. In my own code I create patch toclickhouse_sqlalchemy.drivers.base.ClickHouseDialect._parse_detetime64_params
:It looks dirty but the autogenerate works correctly.
Expected behavior
_parse_detetime64_params
shall return[3, "UTC"]
for inner spec like3, 'UTC'
, not resulting weird detected type change.Versions
The text was updated successfully, but these errors were encountered: