SAWarning: Could not instantiate type <class 'sqlalchemy.sql.sqltypes.INTEGER'> when I use sqlalchemy and pd.io.sql.read_sql
Question: I try to read pandas DataFrame from my SQLite table. When I run the code below

    
    
    import pandas as pd
    import sqlalchemy
    
    dbname = "sqlite:////Users/leda/home/Magnetic_stars/SQLite/Magnetic_stars.sqlite"
    engine = sqlalchemy.create_engine(dbname)
    res = pd.io.sql.read_sql("SELECT * FROM Resolved;", engine)
    

I get SAWarning:

    
    
    /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/sqlalchemy/dialects/sqlite/base.py:860: SAWarning: Could not instantiate type <class 'sqlalchemy.sql.sqltypes.INTEGER'> with reflected arguments [u'4']; using no arguments.
     coltype = self._resolve_type_affinity(type_)
    /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/sqlalchemy/dialects/sqlite/base.py:860: SAWarning: Could not instantiate type <class 'sqlalchemy.sql.sqltypes.INTEGER'> with reflected arguments [u'2']; using no arguments.
     coltype = self._resolve_type_affinity(type_)
    

see my [issue on github](https://github.com/pydata/pandas/issues/7380) for
more details.

What am I doing wrong? Is this a bug?


Answer: Ok, so looking at [github](https://github.com/pydata/pandas/issues/7380) it
seems like your problem is solved. For the record, let me just shortly
summarize what happend.

As we know from [#7396](https://github.com/pydata/pandas/issues/7396), pandas
is introspecting _all_ the tables per _every_ read_sql_table call.

Another thing is that your database contains a table with a column of a type
reported by sqlite as "INT(4)".

SqlAlchemy (which is used by pandas under the hood) sqlite dialect [interprets
the "(4)" part as an argument to be passed to its type
constructor](https://github.com/zzzeek/sqlalchemy/blob/rel_0_9_4/lib/sqlalchemy/dialects/sqlite/base.py#L915).
But constructor of
[sqlalchemy.sql.sqltypes.INTEGER](https://github.com/zzzeek/sqlalchemy/blob/rel_0_9_4/lib/sqlalchemy/sql/sqltypes.py#L1445)
doesn't take any arguments and that [causes a
warning](https://github.com/zzzeek/sqlalchemy/blob/rel_0_9_4/lib/sqlalchemy/dialects/sqlite/base.py#L917)
and effectively ignoring these arguments, treating INT(4) as INT.

