Skip to content

Commit 57f20ec

Browse files
authored
CI: Get rid of some warnings (#48628)
1 parent 782037d commit 57f20ec

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

pandas/core/dtypes/cast.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -1841,8 +1841,10 @@ def maybe_cast_to_integer_array(
18411841
f"casted to the dtype {dtype}"
18421842
) from err
18431843

1844-
if np.array_equal(arr, casted):
1845-
return casted
1844+
with warnings.catch_warnings():
1845+
warnings.filterwarnings("ignore")
1846+
if np.array_equal(arr, casted):
1847+
return casted
18461848

18471849
# We do this casting to allow for proper
18481850
# data and dtype checking.

pandas/tests/frame/methods/test_combine_first.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,11 @@ def test_combine_first_string_dtype_only_na(self, nullable_string_dtype):
400400
pa_version_under7p0 and nullable_string_dtype == "string[pyarrow]",
401401
):
402402
df2.set_index(["a", "b"], inplace=True)
403-
result = df.combine_first(df2)
403+
with tm.maybe_produces_warning(
404+
PerformanceWarning,
405+
pa_version_under7p0 and nullable_string_dtype == "string[pyarrow]",
406+
):
407+
result = df.combine_first(df2)
404408
with tm.maybe_produces_warning(
405409
PerformanceWarning,
406410
pa_version_under7p0 and nullable_string_dtype == "string[pyarrow]",

0 commit comments

Comments
 (0)