vmware-archive / sql_magic

Magic functions for using Jupyter Notebook with Apache Spark and a variety of SQL databases.
Apache License 2.0
172 stars 21 forks source link

% in query #8

Open lukeorland opened 6 years ago

lukeorland commented 6 years ago

Would it be possible for sql_magic to automatically run the SQL string through sqlalchemy.text(), or do we need to replace any instance of % in a regular SQL statement with %%?

For reference:

https://stackoverflow.com/questions/8657508/strange-sqlalchemy-error-message-typeerror-dict-object-does-not-support-inde

crawles commented 6 years ago

are you using postgres? use psycopg2 instead - see https://github.com/pivotal-legacy/sql_magic/issues/7#issuecomment-384939085 and you shouldn't have an issue. will look into sqlalchemy.text() - should be pretty straight forward