-
Notifications
You must be signed in to change notification settings - Fork 473
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
SNOW-841996: multi-statement count parameter support doesnt seem to be working... #1604
Comments
The following executes without error when i dont attempt to select the variables (which doesn't solve my problem above)...but im not able to get any results.
simply prints out: Ultimately, i would like to load this data into pandas using code that work fine for single statement queries such as this:
but when i try this with the above query, i get the following exception:
|
Hi @dss010101, first your pip list doesn't capture This works for me as an example: query = "set( var1, var2) = ('test1', 'test2'); select $var1, $var2"
cur.execute(query, num_statements=2)
print(cur.fetchone())
while cur.nextset():
print(cur.fetchone()) I get back:
|
It is a known bug that
@sfc-gh-mkeller : This is the issue we talked about last week :p |
@dss010101 Do you have any other questions? Otherwise we can close this issue. |
the goal is to fetch it into a pandas dataframe with fetch_pandas_all. i am pointing out that that does not work without the sql as is. it would seem i need to use declare instead of set when trying to use variables. i am trying to avoid having to run different sql in snowflake vs what i run in python. so was trying to figure out what is the cconsistent way of doing this. |
so it is a bug then for fetch_pandas_all or just plain not supported? i guess that is the clarification needed. |
In short for the clarification, it is not supported. The reality is a bit complicated:
In an ideal world, the backend should return the result in |
got it. thanks for the clarification. And yes, i would personally like to see it happen also :) |
closing this issue as I see the original question has been answered (how to enable multi-statement support for a particular query) and also secondary request has been answered (multi-statement query vs. fetch_pandas not supported due to backend limitation) we can take on the remaining topic (enhancement for working around the backend limitation) as resources permit, if possible please open a new request for that, being a different topic. Thank you in advance! |
Python version
3.11
Operating system and processor architecture
Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.31
Installed packages
What did you do?
the exception this produces is:
Is there a proper way to handle this use case?
The text was updated successfully, but these errors were encountered: