SNOW-1843881: Change StructType columns to return Row objects#2820
SNOW-1843881: Change StructType columns to return Row objects#2820sfc-gh-jrose merged 27 commits intomainfrom
Conversation
) 1. Which Jira issue is this PR addressing? Make sure that there is an accompanying issue to your PR. Fixes SNOW-1852779 2. Fill out the following pre-review checklist: - [ ] I am adding a new automated test(s) to verify correctness of my new code - [ ] If this test skips Local Testing mode, I'm requesting review from @snowflakedb/local-testing - [ ] I am adding new logging messages - [ ] I am adding a new telemetry message - [ ] I am adding new credentials - [ ] I am adding a new dependency - [ ] If this is a new feature/behavior, I'm adding the Local Testing parity changes. - [x] I acknowledge that I have ensured my changes to be thread-safe. Follow the link for more information: [Thread-safe Developer Guidelines](https://github.com/snowflakedb/snowpark-python/blob/main/CONTRIBUTING.md#thread-safe-development) 3. Please describe how your code solves the related issue. Fixed AST encoding for Column `in_`, `asc`, and `desc`. Removed an unused entity and renamed `sp_column_in__seq` to `sp_column_in`. Changed the `nulls_first` optional boolean param to be an enum.
| ) -> Tuple[Optional[List[str]], Optional[List[Callable]]]: | ||
| if not result_meta: |
There was a problem hiding this comment.
can we add a small description of what this returns.
| ({"x": 1}, {"A": "a", "b": 1}, [1, 1, 1]), | ||
| ({"x": 2}, {"A": "b", "b": 2}, [2, 2, 2]), | ||
| ({"x": 1}, Row(A="a", b=1), [1, 1, 1]), | ||
| ({"x": 2}, Row(A="b", b=2), [2, 2, 2]), |
There was a problem hiding this comment.
is this considered a breaking change or this feature is not rolled out yet?
There was a problem hiding this comment.
Yes, this is a breaking change. It only gets applied when the feature flag in snowflake.snowpark.context is set though so won't break current users until that flag is rolled out. The structured type tests have the flag enabled.
There was a problem hiding this comment.
I assume that flag is _should_use_structured_type_semantics.
just for my understanding, we will do a BCR release when rolling out this parameter?
There was a problem hiding this comment.
That is the correct flag. I believe we will release the change in a BCR release, but for now this unblocks sas and customers that want to enabled it if we do PrPr
Which Jira issue is this PR addressing? Make sure that there is an accompanying issue to your PR.
Fixes SNOW-1843881
Fill out the following pre-review checklist:
Please describe how your code solves the related issue.
In pyspark struct type objects are collected as Rows instead of dicts. Another recent change allowed creating struct type columns by creating a dataframe from nested Row objects. These two changes together allow round trip structured objects without manually specifying the schema.