sqlalchemy-hana
sqlalchemy-hana copied to clipboard
Preview alembic dialect fails with alembic > 1.6
Creating a table fails with alembic > 1.6 and SA > 1.4
tests/conftest.py:116: in create_database_content
command.upgrade(config, revision="head")
venv/lib/python3.7/site-packages/alembic/command.py:294: in upgrade
script.run_env()
venv/lib/python3.7/site-packages/alembic/script/base.py:490: in run_env
util.load_python_file(self.dir, "env.py")
venv/lib/python3.7/site-packages/alembic/util/pyfiles.py:97: in load_python_file
module = load_module_py(module_id, path)
venv/lib/python3.7/site-packages/alembic/util/compat.py:182: in load_module_py
spec.loader.exec_module(module)
my_project/migration/env.py:61: in <module>
run_migrations_online()
my_project/migration/env.py:51: in run_migrations_online
context.run_migrations()
venv/lib/python3.7/site-packages/alembic/runtime/environment.py:813: in run_migrations
self.get_context().run_migrations(**kw)
venv/lib/python3.7/site-packages/alembic/runtime/migration.py:561: in run_migrations
step.migration_fn(**kw)
my_project/migration/versions/f1894d2b7029_create_service_tables.py:26: in upgrade
hana_table_type="COLUMN",
venv/lib/python3.7/site-packages/alembic/operations/ops.py:1072: in create_table
return operations.invoke(op)
venv/lib/python3.7/site-packages/alembic/operations/base.py:354: in invoke
return fn(self, operation)
venv/lib/python3.7/site-packages/alembic/operations/toimpl.py:101: in create_table
operations.impl.create_table(table)
venv/lib/python3.7/site-packages/alembic/ddl/impl.py:277: in create_table
self._exec(schema.CreateTable(table))
venv/lib/python3.7/site-packages/alembic/ddl/impl.py:146: in _exec
return conn.execute(construct, multiparams)
venv/lib/python3.7/site-packages/sqlalchemy/engine/base.py:1262: in execute
return meth(self, multiparams, params, _EMPTY_EXECUTION_OPTS)
venv/lib/python3.7/site-packages/sqlalchemy/sql/ddl.py:78: in _execute_on_connection
self, multiparams, params, execution_options
venv/lib/python3.7/site-packages/sqlalchemy/engine/base.py:1350: in _execute_ddl
dialect=dialect, schema_translate_map=schema_translate_map
venv/lib/python3.7/site-packages/sqlalchemy/sql/elements.py:522: in compile
return self._compiler(dialect, **kw)
venv/lib/python3.7/site-packages/sqlalchemy/sql/ddl.py:29: in _compiler
return dialect.ddl_compiler(dialect, self, **kw)
venv/lib/python3.7/site-packages/sqlalchemy/sql/compiler.py:455: in __init__
self.string = self.process(self.statement, **compile_kwargs)
venv/lib/python3.7/site-packages/sqlalchemy/sql/compiler.py:490: in process
return obj._compiler_dispatch(self, **kwargs)
venv/lib/python3.7/site-packages/sqlalchemy/sql/visitors.py:81: in _compiler_dispatch
return meth(self, **kw)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <sqlalchemy_hana.dialect.HANADDLCompiler object at 0x7fb4fcabf438>, create = <sqlalchemy.sql.ddl.CreateTable object at 0x7fb4fcabf3c8>
def visit_create_table(self, create):
table = create.element
# The table._prefixes list outlives the current compilation, meaning changing the list
# will change it globally. To prevent adding the same prefix multiple times, it is
# removed again after the super-class'es visit_create_table call, which consumes the
# table prefixes.
table_type = table.kwargs.get('hana_table_type')
appended_index = None
if table_type:
> appended_index = len(table._prefixes)
E TypeError: object of type 'NoneType' has no len()
venv/lib/python3.7/site-packages/sqlalchemy_hana/dialect.py:169: TypeError
See sqlalchemy/alembic#867
Moved to https://github.com/SAP/sqlalchemy-hana/issues/102