Skip to content

Commit a5bbfbe

Browse files
committed
Merge remote-tracking branch 'origin/main' into yixie-SNOW-2203826-flatten-filter-sort
2 parents fc75f21 + 8a555ef commit a5bbfbe

File tree

153 files changed

+2470
-298
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

153 files changed

+2470
-298
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: 62 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Release History
22

3-
## 1.42.0 (YYYY-MM-DD)
3+
## 1.43.0 (YYYY-MM-DD)
44

55
### Snowpark Python API Updates
66

@@ -26,13 +26,27 @@
2626
- Added support for mapping `np.percentile` with DataFrame and Series inputs to `Series.quantile`.
2727
- Added support for setting the `random_state` parameter to an integer when calling `DataFrame.sample` or `Series.sample`.
2828

29+
#### Improvements
30+
31+
- Enhanced autoswitching functionality from Snowflake to native Pandas for methods with unsupported argument combinations:
32+
- `shift()` with `suffix` or non-integer `periods` parameters
33+
- `sort_index()` with `axis=1` or `key` parameters
34+
- `sort_values()` with `axis=1`
35+
- `melt()` with `col_level` parameter
36+
- `apply()` with `result_type` parameter for DataFrame
37+
- `pivot_table()` with `sort=True`, non-string `index` list, non-string `columns` list, non-string `values` list, or `aggfunc` dict with non-string values
38+
- `fillna()` with `downcast` parameter or using `limit` together with `value`
39+
- `dropna()` with `axis=1`
40+
2941
#### Bug Fixes
3042

3143
- Fixed a bug in `DataFrameGroupBy.agg` where func is a list of tuples used to set the names of the output columns.
44+
- Fixed a bug where converting a modin datetime index with a timezone to a numpy array with `np.asarray` would cause a `TypeError`.
3245

3346
#### Improvements
3447

3548
- Add support for the following in faster pandas:
49+
- `groupby.apply`
3650
- `groupby.nunique`
3751
- `groupby.size`
3852
- `concat`
@@ -44,9 +58,50 @@
4458
- `str.lower`
4559
- `str.upper`
4660
- `str.title`
47-
61+
- `str.match`
62+
- `str.capitalize`
63+
- `str.__getitem__`
64+
- `str.center`
65+
- `str.count`
66+
- `str.get`
67+
- `str.pad`
68+
- `str.len`
69+
- `str.ljust`
70+
- `str.rjust`
71+
- `str.split`
72+
- `str.replace`
73+
- `str.strip`
74+
- `str.lstrip`
75+
- `str.rstrip`
76+
- `str.translate`
77+
- `dt.tz_localize`
78+
- `dt.tz_convert`
79+
- `dt.ceil`
80+
- `dt.round`
81+
- `dt.floor`
82+
- `dt.normalize`
83+
- `dt.month_name`
84+
- `dt.day_name`
85+
- `dt.strftime`
86+
- `rolling.min`
87+
- `rolling.max`
88+
- `rolling.count`
89+
- `rolling.sum`
90+
- `rolling.mean`
91+
- `rolling.std`
92+
- `rolling.var`
93+
- `rolling.sem`
94+
- `rolling.corr`
4895
- Make faster pandas disabled by default (opt-in instead of opt-out).
4996

97+
## 1.42.0 (2025-10-28)
98+
99+
### Snowpark Python API Updates
100+
101+
#### New Features
102+
103+
- Snowpark python DB-api is now generally available. Access this feature with `DataFrameReader.dbapi()` to read data from a database table or query into a DataFrame using a DBAPI connection.
104+
50105
## 1.41.0 (2025-10-23)
51106

52107
### Snowpark Python API Updates
@@ -143,6 +198,11 @@
143198
- `skew()` with `axis=1` or `numeric_only=False` parameters
144199
- `round()` with `decimals` parameter as a Series
145200
- `corr()` with `method!=pearson` parameter
201+
- `df.groupby()` with `axis=1`, `by!=None and level!=None`, or by containing any non-pandas hashable labels.
202+
- `groupby_fillna()` with `downcast` parameter
203+
- `groupby_first()` with `min_count>1`
204+
- `groupby_last()` with `min_count>1`
205+
- `shift()` with `freq` parameter
146206
- Set `cte_optimization_enabled` to True for all Snowpark pandas sessions.
147207
- Add support for the following in faster pandas:
148208
- `isin`

recipe/meta.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{% set name = "snowflake-snowpark-python" %}
2-
{% set version = "1.41.0" %}
2+
{% set version = "1.42.0" %}
33
{% set noarch_build = (os.environ.get('SNOWFLAKE_SNOWPARK_PYTHON_NOARCH_BUILD', 'false')) == 'true' %}
44
{% set build_number = os.environ.get('SNOWFLAKE_SNOWPARK_PYTHON_BUILD_NUMBER', 0) %}
55

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -962,7 +962,7 @@ def get_valid_col_pos_list_from_columns(
962962

963963
# convert float like keys to integers
964964
elif not is_integer_dtype(pos_array.dtype):
965-
assert is_float_dtype(
965+
assert pos_array.size == 0 or is_float_dtype(
966966
pos_array.dtype
967967
), "list-like key must be list of int or float"
968968
pos_list = pos_array.astype(int)

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)