from pandas.io import sql
print sql.execute('SELECT * FROM testTable WHERE testColumn IN ("테스트1", "테스트2")', engine).fetchall()
When I try the test code above, it's works like a charm.
But because of the reason that the query should work dynamically, somehow I did think about the code below(But not works).
I think the problem related with escape character of unicode, but I have no idea how could I solve this problem despite of searching & trying many cases in stackoverflow.
testss = [u"테스트1", u"테스트2"]
print sql.execute('SELECT * FROM testTable WHERE testColumn IN {}'.format(tuple(tests)), engine).fetchall()
sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) near "'\uc774\ud130\ub110 \uc120\uc0e4\uc778'": syntax error [SQL: "SELECT * FROM boxOffice WHERE movieNm IN (u'\\ud14c\\uc2a4\\ud2b81', u'\\ud14c\\uc2a4\\ud2b82')"]
If possible, please let me know how could it be applicable to read_sql_query, or read_sql related with sqlalchemy.text().
Any advice would be most welcome! Thank you for your help.
cf. http://pandas.pydata.org/pandas-docs/stable/io.html#sql-queries