seanharr11 / etlalchemy

Extract, Transform, Load: Any SQL Database in 4 lines of Code.
MIT License
556 stars 83 forks source link

TypeError from mssql to mysql, using column_schema_transformation_file #35

Open agustincl opened 6 years ago

agustincl commented 6 years ago

Hello there,

I'm trying to use the tool to move some data from mssql to mysql with a transformation on some columns.

To simplify the case I'm using just one table.

Here the code.

# coding: utf-8
from etlalchemy import ETLAlchemySource, ETLAlchemyTarget
from os import getcwd
from tomoney import *
import os

mssql_db_source = ETLAlchemySource(
    conn_string="mssql+pymssql://user:password@192.168.56.4:51870/Test",
    included_tables=['Clients'],
    column_schema_transformation_file=getcwd() + "/column_mappings.csv",
)

mysql_db_target = ETLAlchemyTarget("mysql://root:toor@192.168.56.5/test", drop_database=True)
mysql_db_target.addSource(mssql_db_source)
mysql_db_target.migrate()
  1. For a transformation from varchar(25) to text

Here column_mappings.csv

Column Name,Table Name,New Column Name,New Column Type,Delete
Username,Clients,,Text,False

And the response

TypeError: unbound method _compiler_dispatch() must be called with Text instance as first argument (got MySQLTypeCompiler instance instead)

And no matter how I configure the column_mappings.csv I get this error always.

Some help will be appreciated.

mdubit commented 6 years ago

Hi,

Have you solved this problem ? I have exactly the same. Except with the PostgreSQL driver:

TypeError: unbound method dialect_impl() must be called with TEXT instance as first argument (got PGDialect_psycopg2 instance instead)

agustincl commented 6 years ago

@mdubit No solution until now. But using SQLAlchemy directly has been quite good. I have some code to share if you need it!.