Open mpourvali opened 2 years ago
@app.route("/query", methods= ["GET", 'POST']) def query(): pysqldf = lambda q: sqldf(q, locals()) csv_data = pd.read_csv('./for_download/for_query.csv', index_col=[0]) query = "select * from csv_data" trows = pysqldf(query)
I can't get the table in this way, and face this error: pandasql.sqldf.PandaSQLException: (sqlite3.OperationalError) no such table: csv_data
it also doesn't work with globals()
@app.route("/query", methods= ["GET", 'POST']) def query(): pysqldf = lambda q: sqldf(q, locals()) csv_data = pd.read_csv('./for_download/for_query.csv', index_col=[0]) query = "select * from csv_data" trows = pysqldf(query)
I can't get the table in this way, and face this error: pandasql.sqldf.PandaSQLException: (sqlite3.OperationalError) no such table: csv_data