Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doesn't work in Flask #96

Open
mpourvali opened this issue Apr 20, 2022 · 1 comment
Open

doesn't work in Flask #96

mpourvali opened this issue Apr 20, 2022 · 1 comment

Comments

@mpourvali
Copy link

@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

@mpourvali
Copy link
Author

it also doesn't work with globals()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant