Skip to content

Commit fbf000c

Browse files
authored
NO-SNOW: Bump pandas dependency ceiling to <=2.4 (#4173)
1 parent 4d1c2b2 commit fbf000c

3 files changed

Lines changed: 47 additions & 30 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@
99
- Fixed a bug where CTE optimization incorrectly deduplicated subtrees containing non-deterministic data generation functions (e.g. `uuid_string()`).
1010
- Fixed a bug where vectorized UDFs using non-anaconda package repositories did not specify the pandas package by default.
1111

12+
### Snowpark pandas API Updates
13+
14+
#### Dependency Updates
15+
16+
- Updated the supported `pandas` versions to <=2.4 (was previously <=2.3.1).
17+
1218
## 1.49.0 (TBD)
1319

1420
### Snowpark Python API Updates

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
MODIN_REQUIREMENTS = [
4444
*PANDAS_REQUIREMENTS,
4545
f"modin{MODIN_DEPENDENCY_VERSION}",
46-
"pandas<=2.3.1",
46+
"pandas<=2.4",
4747
"tqdm", # For progress bars during backend switching
4848
"ipywidgets", # For enhanced progress bars in Jupyter notebooks
4949
]

tests/integ/modin/frame/test_select_dtypes.py

Lines changed: 40 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -137,36 +137,47 @@ def test_select_dtypes_duplicate_col_names(include, exclude):
137137
)
138138

139139

140-
@pytest.mark.parametrize(
141-
"include, exclude, exc, exc_match",
142-
[
143-
([], [], ValueError, "at least one of include or exclude must be nonempty"),
144-
(None, None, ValueError, "at least one of include or exclude must be nonempty"),
145-
# python `int` is equivalent to any np.int dtype, but it is fine for an type in
146-
# `include` to be a strict subtype of a type in `exclude` or vice versa
147-
(int, int, ValueError, "include and exclude overlap"),
148-
([int], ["O", int], ValueError, "include and exclude overlap"),
149-
(["O", int], [int], ValueError, "include and exclude overlap"),
150-
(int, np.int32, ValueError, "include and exclude overlap"),
151-
(int, np.int64, ValueError, "include and exclude overlap"),
152-
("datetime", np.datetime64, ValueError, "include and exclude overlap"),
153-
("O", object, ValueError, "include and exclude overlap"),
154-
# string dtypes are prohibited by pandas
155-
(str, None, TypeError, "string dtypes are not allowed, use 'object' instead"),
156-
(None, str, TypeError, "string dtypes are not allowed, use 'object' instead"),
157-
(
158-
"timedelta64[s]",
159-
None,
160-
ValueError,
161-
"'timedelta64[s]' is too specific of a frequency, try passing 'timedelta64'",
140+
# Error message differs slightly across pandas patch versions
141+
STR_DTYPE_ERROR = r"string dtypes are not allowed, use ('str' or )?'object' instead"
142+
143+
SELECT_DTYPES_INVALID_PARAMS = [
144+
([], [], ValueError, "at least one of include or exclude must be nonempty"),
145+
(None, None, ValueError, "at least one of include or exclude must be nonempty"),
146+
# python `int` is equivalent to any np.int dtype, but it is fine for an type in
147+
# `include` to be a strict subtype of a type in `exclude` or vice versa
148+
(int, int, ValueError, "include and exclude overlap"),
149+
([int], ["O", int], ValueError, "include and exclude overlap"),
150+
(["O", int], [int], ValueError, "include and exclude overlap"),
151+
(int, np.int32, ValueError, "include and exclude overlap"),
152+
(int, np.int64, ValueError, "include and exclude overlap"),
153+
("datetime", np.datetime64, ValueError, "include and exclude overlap"),
154+
("O", object, ValueError, "include and exclude overlap"),
155+
# string dtypes are prohibited by pandas
156+
(str, None, TypeError, STR_DTYPE_ERROR),
157+
(None, str, TypeError, STR_DTYPE_ERROR),
158+
(
159+
"timedelta64[s]",
160+
None,
161+
ValueError,
162+
re.escape(
163+
"'timedelta64[s]' is too specific of a frequency, try passing 'timedelta64'"
162164
),
163-
(
164-
None,
165-
"timedelta64[s]",
166-
ValueError,
167-
"'timedelta64[s]' is too specific of a frequency, try passing 'timedelta64'",
165+
),
166+
(
167+
None,
168+
"timedelta64[s]",
169+
ValueError,
170+
re.escape(
171+
"'timedelta64[s]' is too specific of a frequency, try passing 'timedelta64'"
168172
),
169-
],
173+
),
174+
]
175+
176+
177+
@pytest.mark.parametrize(
178+
"include, exclude, exc, exc_match",
179+
SELECT_DTYPES_INVALID_PARAMS,
180+
ids=[f"include_{a[0]}-exclude_{a[1]}" for a in SELECT_DTYPES_INVALID_PARAMS],
170181
)
171182
@sql_count_checker(query_count=0)
172183
def test_select_dtypes_invalid_args(include, exclude, exc, exc_match):
@@ -178,6 +189,6 @@ def test_select_dtypes_invalid_args(include, exclude, exc, exc_match):
178189
lambda df: df.select_dtypes(include, exclude),
179190
expect_exception=True,
180191
expect_exception_type=exc,
181-
expect_exception_match=re.escape(exc_match),
192+
expect_exception_match=exc_match,
182193
assert_exception_equal=True,
183194
)

0 commit comments

Comments
 (0)