-
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-1331404: fetch_pandas_all converts arrays into strings #1922
Comments
Hello @lostkamp , Thanks for raising the issue, we are checking it, will update. Regards, |
Hello @lostkamp , This is currently the expected behavior. Adding support for returning structured data is currently being worked on. Regards, |
this should be now resolved i suppose, now that v3.10.0 is released |
Hi @sfc-gh-sghosh and @sfc-gh-dszmolka , thanks for the update. Unfortunately I am getting exactly the same behavior as before when using v3.10.0. |
reopened and we'll look further |
Hi, |
@lostkamp I believe this is caused by the fact that we don't support unstructured objects. You can however work around this by telling Snowflake the type yourself. Check the following example out:
produces:
So your code could work this way:
|
@sfc-gh-mkeller thank you for the explanation! However your code still gives me strings: >>> query = 'select array_construct(10, 20, 30)::array(number) as col'
>>> df = cursor.execute(query).fetch_pandas_all()
>>> df
COL
0 [\n 10,\n 20,\n 30\n]
>>> type(df['COL'].iloc[0])
<class 'str'> using v3.12.3 |
Unfortunately @lostkamp as it turns out the code works, but it requires some Snowflake features that are not released yet. One caveat that I want pass along is that as things are now this only works with Iceberg tables. Let's keep this ticket open to track this feature request! |
Python version
Python 3.11.7 (main, Mar 12 2024, 09:54:34) [GCC 13.2.0]
Operating system and processor architecture
Linux-6.5.0-27-generic-x86_64-with-glibc2.38
Installed packages
What did you do?
What did you expect to see?
I would expect arrays to be represented as a list or tuple of values in the dataframe cell.
Can you set logging to DEBUG and collect the logs?
The text was updated successfully, but these errors were encountered: