Skip to content

Commit 6504ed3

Browse files
authored
TEST-#7643: Fix residual failures from pandas 2.3 (#7644)
This PR fixes 2 failures I missed while adding support for pandas 2.3: - `DataFrame.insert` apparently is now typed with `pandas-stubs==2.3`, but was not typed before. Since pandas 2.3 is compatible with Python 3.9 all CI runs should pick up this change, but if it continues to be an issue I'll look into a workaround for seeing if it's possible to conditionally add the `type: ignore` directive. - `np.cumproduct` was [deprecated](https://numpy.org/doc/1.26/release/1.25.0-notes.html#deprecations) some time ago, and removed in numpy>2. We've supported numpy>2 for a while, so it's unclear why this issue only just triggered. Signed-off-by: Jonathan Shi <jonathan.shi@snowflake.com>
1 parent e3724b6 commit 6504ed3

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

modin/core/dataframe/base/dataframe/utils.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,12 @@ def join_columns(
105105
left_on = []
106106
right_on = []
107107
# in other cases, we can simply add the index name to columns and proceed as normal
108+
# on python 3.9 with pandas-stubs 2.2, these lines will warn about insert being an untyped call,
109+
# but this error is no longer present on higher versions
108110
elif left_on[0] not in left:
109-
left = left.insert(loc=0, item=left_on[0]) # type: ignore
111+
left = left.insert(loc=0, item=left_on[0]) # type: ignore[no-untyped-call, unused-ignore]
110112
elif right_on[0] not in right:
111-
right = right.insert(loc=0, item=right_on[0]) # type: ignore
113+
right = right.insert(loc=0, item=right_on[0]) # type: ignore[no-untyped-call, unused-ignore]
112114

113115
if any(col not in left for col in left_on) or any(
114116
col not in right for col in right_on

modin/tests/pandas/dataframe/test_udf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ def test_aggregate_error_checking():
130130
modin_df.aggregate({modin_df.columns[0]: "sum", modin_df.columns[1]: "mean"})
131131

132132
with warns_that_defaulting_to_pandas():
133-
modin_df.aggregate("cumproduct")
133+
modin_df.aggregate("arcsin")
134134

135135

136136
@pytest.mark.parametrize(

0 commit comments

Comments
 (0)