sqlalchemy-diff icon indicating copy to clipboard operation
sqlalchemy-diff copied to clipboard

_process_type should call the compile of the dialect

Open YaPeL opened this issue 6 years ago • 0 comments

Hi, I'm using sqlalchemy-diff with pybigquery, and it seems sqlalchemy-diff is having issues when attempting to process custom types, like an array, I get this error:

 File "/env/lib/python3.7/site-packages/sqlalchemydiff/comparer.py", line 349, in _process_types
    column_dict[column]['type'])
  File "/env/lib/python3.7/site-packages/sqlalchemydiff/comparer.py", line 359, in _process_type
    return type_.compile()
  File "/env/lib/python3.7/site-packages/sqlalchemy/sql/type_api.py", line 580, in compile
    return dialect.type_compiler.process(self)
  File "/env/lib/python3.7/site-packages/sqlalchemy/sql/compiler.py", line 400, in process
    return type_._compiler_dispatch(self, **kw)
  File "/env/lib/python3.7/site-packages/sqlalchemy/sql/visitors.py", line 89, in _compiler_dispatch
    raise exc.UnsupportedCompilationError(visitor, cls)
sqlalchemy.exc.UnsupportedCompilationError: Compiler <sqlalchemy.sql.compiler.GenericTypeCompiler object at 0x7f932a51ffd0> can't render element of type <class 'sqlalchemy.sql.sqltypes.ARRAY'> (Background on this error at: http://sqlalche.me/e/l7de)

which comes from the fact that, [I assume], _process_type is calling the default compiler and not the one from the dialect

YaPeL avatar Jun 14 '19 21:06 YaPeL