-
Notifications
You must be signed in to change notification settings - Fork 112
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-1651234: Fix create_dataframe throwing an exception for structured dtypes #2240
SNOW-1651234: Fix create_dataframe throwing an exception for structured dtypes #2240
Conversation
Seems like your changes contain some Local Testing changes, please request review from @snowflakedb/local-testing |
pytest.skip("Test requires iceberg support and structured type support.") | ||
|
||
_, __, expected_schema = STRUCTURED_TYPES_EXAMPLES[True] | ||
table_name = f"snowpark_structured_dtypes_{uuid.uuid4().hex[:5]}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just curious, any reason why we are using this naming format instead os standard function Utils.random_table_name()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No particular reason. Other tests in this file did it this way so I was mostly just copying style.
Defering this change until structured type support is rolled out completely. |
We can continue to merge this PR since it doesn't hurt anything. |
CHANGELOG.md
Outdated
@@ -49,6 +49,7 @@ | |||
- Fixed a bug where calling `DataFrame.to_snowpark_pandas_dataframe` without explicitly initializing the Snowpark pandas plugin caused an error. | |||
- Fixed a bug where using the `explode` function in dynamic table creation caused a SQL compilation error due to improper boolean type casting on the `outer` parameter. | |||
- Fixed a bug where using `to_pandas_batches` with async jobs caused an error due to improper handling of waiting for asynchronous query completion. | |||
- Fixed a bug in `session.create_dataframe` that caused a sql error when creating an iceberg table with structured datatypes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better remove this one because there are other problems with create_dataframe.
Which Jira issue is this PR addressing? Make sure that there is an accompanying issue to your PR.
Fixes SNOW-1651234
Fill out the following pre-review checklist:
Please describe how your code solves the related issue.
This change modifies the logic for
session.create_dataframe
to add support for StructType object as well as removes it's dependency onto_object
andto_array
. Those calls create semi-structured columns which are incompatible with iceberg. By switching to a cast full type information is retained instead.