Skip to content

Commit a30e1d2

Browse files
Merge remote-tracking branch 'upstream/2.3.x' into auto-backport-of-pr-59906-on-2.3.x
2 parents e565fb5 + 6e5ccd8 commit a30e1d2

File tree

9 files changed

+31
-18
lines changed

9 files changed

+31
-18
lines changed

.github/actions/setup-conda/action.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ runs:
99
- name: Install ${{ inputs.environment-file }}
1010
uses: mamba-org/setup-micromamba@v1
1111
with:
12+
# Pinning to avoid 2.0 failures
13+
micromamba-version: '1.5.10-0'
1214
environment-file: ${{ inputs.environment-file }}
1315
environment-name: test
1416
condarc-file: ci/.condarc

.github/workflows/code-checks.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ on:
44
push:
55
branches:
66
- main
7-
- 2.2.x
7+
- 2.3.x
88
pull_request:
99
branches:
1010
- main
11-
- 2.2.x
11+
- 2.3.x
1212

1313
env:
1414
ENV_FILE: environment.yml

.github/workflows/docbuild-and-upload.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ on:
44
push:
55
branches:
66
- main
7-
- 2.2.x
7+
- 2.3.x
88
tags:
99
- '*'
1010
pull_request:
1111
branches:
1212
- main
13-
- 2.2.x
13+
- 2.3.x
1414

1515
env:
1616
ENV_FILE: environment.yml

.github/workflows/package-checks.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ on:
44
push:
55
branches:
66
- main
7-
- 2.2.x
7+
- 2.3.x
88
pull_request:
99
branches:
1010
- main
11-
- 2.2.x
11+
- 2.3.x
1212
types: [ labeled, opened, synchronize, reopened ]
1313

1414
permissions:

.github/workflows/unit-tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ on:
44
push:
55
branches:
66
- main
7-
- 2.2.x
7+
- 2.3.x
88
pull_request:
99
branches:
1010
- main
11-
- 2.2.x
11+
- 2.3.x
1212
paths-ignore:
1313
- "doc/**"
1414
- "web/**"

pandas/_testing/contexts.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -78,14 +78,15 @@ def set_timezone(tz: str) -> Generator[None, None, None]:
7878
import time
7979

8080
def setTZ(tz) -> None:
81-
if tz is None:
82-
try:
83-
del os.environ["TZ"]
84-
except KeyError:
85-
pass
86-
else:
87-
os.environ["TZ"] = tz
88-
time.tzset()
81+
if hasattr(time, "tzset"):
82+
if tz is None:
83+
try:
84+
del os.environ["TZ"]
85+
except KeyError:
86+
pass
87+
else:
88+
os.environ["TZ"] = tz
89+
time.tzset()
8990

9091
orig_tz = os.environ.get("TZ")
9192
setTZ(tz)

pandas/core/internals/blocks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1218,7 +1218,7 @@ def _replace_coerce(
12181218
putmask_inplace(nb.values, mask, value)
12191219
return [nb]
12201220
if using_cow:
1221-
return [self]
1221+
return [self.copy(deep=False)]
12221222
return [self] if inplace else [self.copy()]
12231223
return self.replace(
12241224
to_replace=to_replace,

pandas/tests/copy_view/test_replace.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,15 @@ def test_replace_list_none(using_copy_on_write):
384384

385385
assert not np.shares_memory(get_array(df, "a"), get_array(df2, "a"))
386386

387+
# replace multiple values that don't actually replace anything with None
388+
# https://github.com/pandas-dev/pandas/issues/59770
389+
df3 = df.replace(["d", "e", "f"], value=None)
390+
tm.assert_frame_equal(df3, df_orig)
391+
if using_copy_on_write:
392+
assert tm.shares_memory(get_array(df, "a"), get_array(df3, "a"))
393+
else:
394+
assert not tm.shares_memory(get_array(df, "a"), get_array(df3, "a"))
395+
387396

388397
def test_replace_list_none_inplace_refs(using_copy_on_write, warn_copy_on_write):
389398
df = DataFrame({"a": ["a", "b", "c"]})

pandas/tests/tslibs/test_parsing.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
from pandas._libs.tslibs.parsing import parse_datetime_string_with_reso
1818
from pandas.compat import (
1919
ISMUSL,
20+
is_platform_arm,
2021
is_platform_windows,
2122
)
2223
import pandas.util._test_decorators as td
@@ -26,7 +27,7 @@
2627

2728

2829
@pytest.mark.skipif(
29-
is_platform_windows() or ISMUSL,
30+
is_platform_windows() or ISMUSL or is_platform_arm(),
3031
reason="TZ setting incorrect on Windows and MUSL Linux",
3132
)
3233
def test_parsing_tzlocal_deprecated():

0 commit comments

Comments
 (0)