'How to change column type in SQLAlchemy table?

I'm copying table from SQL Server to Firebird. I have a column of type BIT in SQL Server, but Firebird doesn't know this type. How can I change the type of the column to create table in my Firebird database?

from sqlalchemy import create_engine, MetaData, Table
from sqlalchemy.orm import Session

# Get table from SQL Server
source_engine = create_engine(connection_url_source)
dest_engine = create_engine(connection_url_dest)
metadata = MetaData()
table = Table('my_table', metadata,  autoload=True, autoload_with=source_engine, schema='my_schema')
session = Session(source_engine)
query =session.query(table)
   
# Create table in firebird database
new_metadata = MetaData(bind=dest_engine)
columns = [Column(desc['name'], desc['type']) for desc in query.column_descriptions]
column_names = [desc['name'] for desc in query.column_descriptions]
table_new = Table("my_table", new_metadata, *columns)
table_new.create(dest_engine)

Here I receive the error:

raise exception sqlalchemy.exc.CompileError: (in table 'my_table', column 'my_column'): Compiler <sqlalchemy_firebird.base.FBTypeCompiler object at 0x00000061ADAC8D60> can't render element of type BIT



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source