Skip to content

Commit 4e8a883

Browse files
Merge branch 'main' into feature/aherrera/SNOW-2443512-StringAndBinaryPart2
2 parents 2486e26 + a26070d commit 4e8a883

File tree

11 files changed

+390
-73
lines changed

11 files changed

+390
-73
lines changed

.github/workflows/create-test-branch-from-release.yml

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,11 @@
11
# This workflow automatically creates a test branch from a release tag
22
# For example, when release v1.40.0 is published, it creates test-v1.40.0 branch
3-
# Can also be triggered manually to create a test branch from any existing tag
43

54
name: Create Test Branch from Release
65

76
on:
87
release:
98
types: [published]
10-
workflow_dispatch:
11-
inputs:
12-
tag_name:
13-
description: 'Tag name to create test branch from (e.g., v1.40.0)'
14-
required: true
15-
type: string
16-
test_branch_name:
17-
description: 'Test branch name (optional, defaults to test-<tag_name>)'
18-
required: false
19-
type: string
209

2110
permissions:
2211
contents: write
@@ -29,18 +18,8 @@ jobs:
2918
- name: Extract tag name
3019
id: extract_tag
3120
run: |
32-
# Determine tag name based on trigger type
33-
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
34-
TAG_NAME=${{ inputs.tag_name }}
35-
if [ -n "${{ inputs.test_branch_name }}" ]; then
36-
TEST_BRANCH_NAME=${{ inputs.test_branch_name }}
37-
else
38-
TEST_BRANCH_NAME="test-${TAG_NAME}"
39-
fi
40-
else
41-
TAG_NAME=${{ github.event.release.tag_name }}
42-
TEST_BRANCH_NAME="test-${TAG_NAME}"
43-
fi
21+
TAG_NAME=${{ github.event.release.tag_name }}
22+
TEST_BRANCH_NAME="test-${TAG_NAME}"
4423
4524
echo "tag_name=${TAG_NAME}" >> $GITHUB_OUTPUT
4625
echo "test_branch_name=${TEST_BRANCH_NAME}" >> $GITHUB_OUTPUT

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,18 @@
3838
- Added support for mapping `np.percentile` with DataFrame and Series inputs to `Series.quantile`.
3939
- Added support for setting the `random_state` parameter to an integer when calling `DataFrame.sample` or `Series.sample`.
4040

41+
#### Improvements
42+
43+
- Enhanced autoswitching functionality from Snowflake to native Pandas for methods with unsupported argument combinations:
44+
- `shift()` with `suffix` or non-integer `periods` parameters
45+
- `sort_index()` with `axis=1` or `key` parameters
46+
- `sort_values()` with `axis=1`
47+
- `melt()` with `col_level` parameter
48+
- `apply()` with `result_type` parameter for DataFrame
49+
- `pivot_table()` with `sort=True`, non-string `index` list, non-string `columns` list, non-string `values` list, or `aggfunc` dict with non-string values
50+
- `fillna()` with `downcast` parameter or using `limit` together with `value`
51+
- `dropna()` with `axis=1`
52+
4153
#### Bug Fixes
4254

4355
- Fixed a bug in `DataFrameGroupBy.agg` where func is a list of tuples used to set the names of the output columns.

src/snowflake/snowpark/modin/plugin/_internal/pivot_utils.py

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1866,3 +1866,58 @@ def generate_column_prefix_groupings(
18661866
)
18671867

18681868
return list(zip(margin_data_column_prefixes, margin_data_column_groupings))
1869+
1870+
1871+
def check_pivot_table_unsupported_args(args: dict) -> Optional[str]:
1872+
"""
1873+
Validate pivot_table arguments for unsupported conditions.
1874+
1875+
This helper function checks various argument combinations that are not yet
1876+
supported by Snowpark pandas pivot_table implementation.
1877+
1878+
Args:
1879+
args : dictionary of arguments passed to pivot_table
1880+
1881+
Returns:
1882+
Error message if an unsupported condition is found, None otherwise
1883+
"""
1884+
# Check if index argument is a string or list of strings
1885+
index = args.get("index")
1886+
if (
1887+
index is not None
1888+
and not isinstance(index, str)
1889+
and not all(isinstance(v, str) for v in index)
1890+
and None not in index
1891+
):
1892+
return "index argument should be a string or a list of strings"
1893+
1894+
# Check if columns argument is a string or list of strings
1895+
columns = args.get("columns")
1896+
if (
1897+
columns is not None
1898+
and not isinstance(columns, str)
1899+
and not all(isinstance(v, str) for v in columns)
1900+
and None not in columns
1901+
):
1902+
return "columns argument should be a string or a list of strings"
1903+
1904+
# Check if values argument is a string or list of strings
1905+
values = args.get("values")
1906+
if (
1907+
values is not None
1908+
and not isinstance(values, str)
1909+
and not all(isinstance(v, str) for v in values)
1910+
and None not in values
1911+
):
1912+
return "values argument should be a string or a list of strings"
1913+
1914+
# Check for dictionary aggfunc with non-string functions when index is None
1915+
aggfunc = args.get("aggfunc")
1916+
if (
1917+
isinstance(aggfunc, dict)
1918+
and any(not isinstance(af, str) for af in aggfunc.values())
1919+
and args.get("index") is None
1920+
):
1921+
return "dictionary aggfunc with non-string aggregation functions is not yet supported for pivot_table when index is None"
1922+
1923+
return None

0 commit comments

Comments
 (0)