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 function alembic.autogenerate.render_python_code doesn't work when you use server_default=func.current_timestamp()) in a column.
It used to work in alembic<=1.0.10 but it seems to be broken in any version since 1.0.11 up to 1.3.1. I'm using python 3.8, postgres 11.4 on ubuntu 18.10.
File ".virtualenv/lib/python3.8/site-packages/alembic/autogenerate/api.py", line 164, in render_python_code
render._render_cmd_body(up_or_down_op, autogen_context)
File ".virtualenv/lib/python3.8/site-packages/alembic/autogenerate/render.py", line 71, in _render_cmd_body
lines = render_op(autogen_context, op)
File ".virtualenv/lib/python3.8/site-packages/alembic/autogenerate/render.py", line 87, in render_op
lines = util.to_list(renderer(autogen_context, op))
File ".virtualenv/lib/python3.8/site-packages/alembic/autogenerate/render.py", line 172, in _add_table
forcolin [
File ".virtualenv/lib/python3.8/site-packages/alembic/autogenerate/render.py", line 173, in<listcomp>
_render_column(col, autogen_context) forcolin table.columns
File ".virtualenv/lib/python3.8/site-packages/alembic/autogenerate/render.py", line 601, in _render_column
rendered = _render_server_default(
File ".virtualenv/lib/python3.8/site-packages/alembic/autogenerate/render.py", line 650, in _render_server_default
return _render_potential_expr(
File ".virtualenv/lib/python3.8/site-packages/alembic/autogenerate/render.py", line 509, in _render_potential_expr
"sql": autogen_context.migration_context.impl.render_ddl_sql_expr(
AttributeError: 'NoneType' object has no attribute 'impl'
Not sure if I'm doing something wrong or if this was accidentally broken in release 1.0.11.
The text was updated successfully, but these errors were encountered:
this will be in the next release. there is no workaround other than using the private APIs directly and passing in your migration context, as in this patch:
The function
alembic.autogenerate.render_python_code
doesn't work when you useserver_default=func.current_timestamp())
in a column.It used to work in alembic<=1.0.10 but it seems to be broken in any version since 1.0.11 up to 1.3.1. I'm using python 3.8, postgres 11.4 on ubuntu 18.10.
This is how to reproduce the problem:
This is the output on alembic <= 1.0.10:
And in alembic >= 1.0.11 it fails on this line:
This is the output:
Not sure if I'm doing something wrong or if this was accidentally broken in release 1.0.11.
The text was updated successfully, but these errors were encountered: