Skip to content

Instantly share code, notes, and snippets.

@3onyc
Last active December 28, 2015 08:09
Show Gist options
  • Save 3onyc/7469546 to your computer and use it in GitHub Desktop.
Save 3onyc/7469546 to your computer and use it in GitHub Desktop.
SQLAlchemy Issue
CREATE TABLE "test" (
"date" datetime
);
INSERT INTO test VALUES(1384008289278);
from sqlalchemy import create_engine
from sqlalchemy.schema import MetaData, Table
engine = create_engine('sqlite:///test.db', echo=False)
metadata = MetaData()
metadata.reflect(bind=engine)
print engine.execute(metadata.sorted_tables[0].select()).fetchall()
[Traceback (most recent call last):
File "test.py", line 8, in <module>
print engine.execute(metadata.sorted_tables[0].select()).fetchall()
File "build/bdist.linux-x86_64/egg/sqlalchemy/engine/result.py", line 135, in __repr__
ValueError: Couldn't parse datetime string '1384008289278' - value is not a string.
@zzzeek
Copy link

zzzeek commented Nov 14, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment