Skip to content

Commit d845306

Browse files
committed
Apply Ruff and Ruff-format auto-fixes
1 parent e8edcea commit d845306

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

doc/source/whatsnew/v3.0.0.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -811,11 +811,11 @@ ExtensionArray
811811
- Bug in :class:`Categorical` when constructing with an :class:`Index` with :class:`ArrowDtype` (:issue:`60563`)
812812
- Bug in :meth:`.arrays.ArrowExtensionArray.__setitem__` which caused wrong behavior when using an integer array with repeated values as a key (:issue:`58530`)
813813
- Bug in :meth:`ArrowExtensionArray.factorize` where NA values were dropped when input was dictionary-encoded even when dropna was set to False(:issue:`60567`)
814+
- Bug in :meth:`Series.map` and :meth:`Series.apply` where applying functions to a Series with an :class:`Int32Dtype` or other :class:`ExtensionDtype` would convert elements to float and ``pd.NA`` to ``np.nan``, instead of preserving the original types (:issue:`60766`)
814815
- Bug in :meth:`api.types.is_datetime64_any_dtype` where a custom :class:`ExtensionDtype` would return ``False`` for array-likes (:issue:`57055`)
815816
- Bug in comparison between object with :class:`ArrowDtype` and incompatible-dtyped (e.g. string vs bool) incorrectly raising instead of returning all-``False`` (for ``==``) or all-``True`` (for ``!=``) (:issue:`59505`)
816817
- Bug in constructing pandas data structures when passing into ``dtype`` a string of the type followed by ``[pyarrow]`` while PyArrow is not installed would raise ``NameError`` rather than ``ImportError`` (:issue:`57928`)
817818
- Bug in various :class:`DataFrame` reductions for pyarrow temporal dtypes returning incorrect dtype when result was null (:issue:`59234`)
818-
- Bug in :meth:`Series.map` and :meth:`Series.apply` where applying functions to a Series with an :class:`Int32Dtype` or other :class:`ExtensionDtype` would convert elements to float and ``pd.NA`` to ``np.nan``, instead of preserving the original types (:issue:`60766`)
819819

820820

821821
Styler
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
import pandas as pd
22

3+
34
def test_basemaskedarray_map():
45
for dtype, data, expected_data in [
5-
("Int32", [1, 2, None, 4], [2, 3, pd.NA, 5]),
6-
6+
("Int32", [1, 2, None, 4], [2, 3, pd.NA, 5]),
77
]:
88
s = pd.Series(data, dtype=dtype)
99

1010
def transform(x):
11-
if x is None:
11+
if x is None:
1212
return x
1313
return x + 1
1414

1515
result = s.map(transform)
16-
expected = pd.Series(expected_data, dtype=result.dtype)
16+
expected = pd.Series(expected_data, dtype=result.dtype)
1717

1818
assert result.tolist() == expected.tolist()

pandas/tests/extension/test_masked.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ def test_map(self, data_missing, na_action):
176176
if result[i] is pd.NA:
177177
result[i] = "nan"
178178
result = result.astype("float64")
179-
179+
180180
if data_missing.dtype == Float32Dtype():
181181
# map roundtrips through objects, which converts to float64
182182
expected = data_missing.to_numpy(dtype="float64", na_value=np.nan)
@@ -187,7 +187,7 @@ def test_map(self, data_missing, na_action):
187187
def test_map_na_action_ignore(self, data_missing_for_sorting):
188188
zero = data_missing_for_sorting[2]
189189
result = data_missing_for_sorting.map(lambda x: zero, na_action="ignore")
190-
190+
191191
if data_missing_for_sorting.dtype.kind == "b":
192192
expected = np.array([False, pd.NA, False], dtype=object)
193193
else:

0 commit comments

Comments
 (0)