Skip to content

Commit f3d9b40

Browse files
committed
whatsnew, GH ref
1 parent 9b3891b commit f3d9b40

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

doc/source/whatsnew/v1.4.0.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,7 @@ Other Deprecations
529529
- Deprecated silent dropping of columns that raised a ``TypeError`` in :class:`Series.transform` and :class:`DataFrame.transform` when used with a dictionary (:issue:`43740`)
530530
- Deprecated silent dropping of columns that raised a ``TypeError``, ``DataError``, and some cases of ``ValueError`` in :meth:`Series.aggregate`, :meth:`DataFrame.aggregate`, :meth:`Series.groupby.aggregate`, and :meth:`DataFrame.groupby.aggregate` when used with a list (:issue:`43740`)
531531
- Deprecated casting behavior when setting timezone-aware value(s) into a timezone-aware :class:`Series` or :class:`DataFrame` column when the timezones do not match. Previously this cast to object dtype. In a future version, the values being inserted will be converted to the series or column's existing timezone (:issue:`37605`)
532-
- Deprecated casting behavior when passing an item with mismatched-timezone to :meth:`DatetimeIndex.insert`, :meth:`DatetimeIndex.putmask`, :meth:`DatetimeIndex.where` :meth:`DatetimeIndex.fillna`, :meth:`Series.mask`, :meth:`Series.where`, :meth:`Series.fillna`, :meth:`Series.shift`, :meth:`Series.replace`, :meth:`Series.reindex` (and :class:`DataFrame` column analogues). In the past this has cast to object dtype. In a future version, these will cast the passed item to the index or series's timezone (:issue:`37605`)
532+
- Deprecated casting behavior when passing an item with mismatched-timezone to :meth:`DatetimeIndex.insert`, :meth:`DatetimeIndex.putmask`, :meth:`DatetimeIndex.where` :meth:`DatetimeIndex.fillna`, :meth:`Series.mask`, :meth:`Series.where`, :meth:`Series.fillna`, :meth:`Series.shift`, :meth:`Series.replace`, :meth:`Series.reindex` (and :class:`DataFrame` column analogues). In the past this has cast to object dtype. In a future version, these will cast the passed item to the index or series's timezone (:issue:`37605`,:issue:`44940`)
533533
- Deprecated the 'errors' keyword argument in :meth:`Series.where`, :meth:`DataFrame.where`, :meth:`Series.mask`, and meth:`DataFrame.mask`; in a future version the argument will be removed (:issue:`44294`)
534534
- Deprecated the ``prefix`` keyword argument in :func:`read_csv` and :func:`read_table`, in a future version the argument will be removed (:issue:`43396`)
535535
- Deprecated :meth:`PeriodIndex.astype` to ``datetime64[ns]`` or ``DatetimeTZDtype``, use ``obj.to_timestamp(how).tz_localize(dtype.tz)`` instead (:issue:`44398`)
@@ -837,7 +837,7 @@ ExtensionArray
837837
- Bug in :func:`array` incorrectly raising when passed a ``ndarray`` with ``float16`` dtype (:issue:`44715`)
838838
- Bug in calling ``np.sqrt`` on :class:`BooleanArray` returning a malformed :class:`FloatingArray` (:issue:`44715`)
839839
- Bug in :meth:`Series.where` with ``ExtensionDtype`` when ``other`` is a NA scalar incompatible with the series dtype (e.g. ``NaT`` with a numeric dtype) incorrectly casting to a compatible NA value (:issue:`44697`)
840-
-
840+
- Fixed bug in :meth:`Series.replace` with ``FloatDtype``, ``string[python]``, or ``string[pyarrow]`` dtype not being preserved when possible (:issue:`33484`)
841841

842842
Styler
843843
^^^^^^

pandas/tests/frame/methods/test_replace.py

+1
Original file line numberDiff line numberDiff line change
@@ -1387,6 +1387,7 @@ def test_replace_dict_category_type(self):
13871387
Test to ensure category dtypes are maintained
13881388
after replace with dict values
13891389
"""
1390+
# GH#35268, GH#44940
13901391

13911392
# create input dataframe
13921393
input_dict = {"col1": ["a"], "col2": ["obj1"], "col3": ["cat1"]}

pandas/tests/indexing/test_coercion.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1206,7 +1206,7 @@ def test_replace_series_datetime_datetime(self, how, to_key, from_key, replacer)
12061206
and obj.dtype != rep_ser.dtype
12071207
):
12081208
# mismatched tz DatetimeArray behavior will change to cast
1209-
# for setitem-like methods with mismatched tzs
1209+
# for setitem-like methods with mismatched tzs GH#44940
12101210
warn = FutureWarning
12111211

12121212
msg = "explicitly cast to object"

pandas/tests/series/methods/test_replace.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,7 @@ def check_replace(to_rep, val, expected):
159159
tm.assert_series_equal(expected, result)
160160
tm.assert_series_equal(expected, sc)
161161

162-
# 3.0 can still be held in our int64 series, so we do not upcast
163-
# Note this matches what we get with the scalars 3 and 3.0
162+
# 3.0 can still be held in our int64 series, so we do not upcast GH#44940
164163
tr, v = [3], [3.0]
165164
check_replace(tr, v, ser)
166165
# Note this matches what we get with the scalars 3 and 3.0
@@ -260,7 +259,7 @@ def test_replace2(self):
260259
assert (ser[20:30] == -1).all()
261260

262261
def test_replace_with_dictlike_and_string_dtype(self, nullable_string_dtype):
263-
# GH 32621
262+
# GH 32621, GH#44940
264263
ser = pd.Series(["one", "two", np.nan], dtype=nullable_string_dtype)
265264
expected = pd.Series(["1", "2", np.nan], dtype=nullable_string_dtype)
266265
result = ser.replace({"one": "1", "two": "2"})
@@ -318,6 +317,7 @@ def test_replace_categorical(self, categorical, numeric):
318317
expected = pd.Series(numeric).astype("category")
319318
if 2 not in expected.cat.categories:
320319
# i.e. categories should be [1, 2] even if there are no "B"s present
320+
# GH#44940
321321
expected = expected.cat.add_categories(2)
322322
tm.assert_series_equal(expected, result)
323323

0 commit comments

Comments
 (0)