BUG: to_sql fails with datetime.time values with sqlite fallback mode · Issue #8341 · pandas-dev/pandas (original) (raw)

Columns of datetime.time were not yet supported in sqlite fallback mode (as noted in #7567, and do work for sqlalchemy), but it now seems to fail silently with master (instead of raising an error).

Using:

import sqlite3
con = sqlite3.connect(':memory:')
dt = pd.date_range('2014-01-01', periods=10, freq='10h')
df = pd.DataFrame({'date':dt.date, 'time':dt.time})
df.to_sql('test_datetime', con, index=False, if_exists='replace')

gives:

In [37]: pd.read_sql_query('select * from test_datetime', con)
Out[37]: 
Empty DataFrame
Columns: [date, time]
Index: []