Skip to content

Commit 1790f6c

Browse files
Merge branch 'main' into nsorted
2 parents 0e79e2b + eca6bd3 commit 1790f6c

33 files changed

+331
-205
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ repos:
140140
pass_filenames: false
141141
types: [python]
142142
stages: [manual]
143-
- id: mypy
143+
- id: stubtest
144144
# note: assumes python env is setup and activated
145145
# note: requires pandas dev to be installed
146146
name: mypy (stubtest)

doc/source/whatsnew/v2.3.0.rst

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,20 @@ Notable bug fixes
5050

5151
These are bug fixes that might have notable behavior changes.
5252

53-
.. _whatsnew_230.notable_bug_fixes.notable_bug_fix1:
53+
.. _whatsnew_230.notable_bug_fixes.string_comparisons:
5454

55-
notable_bug_fix1
56-
^^^^^^^^^^^^^^^^
55+
Comparisons between different string dtypes
56+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
57+
58+
In previous versions, comparing Series of different string dtypes (e.g. ``pd.StringDtype("pyarrow", na_value=pd.NA)`` against ``pd.StringDtype("python", na_value=np.nan)``) would result in inconsistent resulting dtype or incorrectly raise. pandas will now use the hierarchy
59+
60+
object < (python, NaN) < (pyarrow, NaN) < (python, NA) < (pyarrow, NA)
61+
62+
in determining the result dtype when there are different string dtypes compared. Some examples:
63+
64+
- When ``pd.StringDtype("pyarrow", na_value=pd.NA)`` is compared against any other string dtype, the result will always be ``boolean[pyarrow]``.
65+
- When ``pd.StringDtype("python", na_value=pd.NA)`` is compared against ``pd.StringDtype("pyarrow", na_value=np.nan)``, the result will be ``boolean``, the NumPy-backed nullable extension array.
66+
- When ``pd.StringDtype("python", na_value=pd.NA)`` is compared against ``pd.StringDtype("python", na_value=np.nan)``, the result will be ``boolean``, the NumPy-backed nullable extension array.
5767

5868
.. _whatsnew_230.api_changes:
5969

doc/source/whatsnew/v3.0.0.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -905,6 +905,7 @@ Other
905905
- Bug in ``Series.list`` methods not preserving the original name. (:issue:`60522`)
906906
- Bug in printing a :class:`DataFrame` with a :class:`DataFrame` stored in :attr:`DataFrame.attrs` raised a ``ValueError`` (:issue:`60455`)
907907
- Bug in printing a :class:`Series` with a :class:`DataFrame` stored in :attr:`Series.attrs` raised a ``ValueError`` (:issue:`60568`)
908+
- Fixed bug where the :class:`DataFrame` constructor misclassified array-like objects with a ``.name`` attribute as :class:`Series` or :class:`Index` (:issue:`61443`)
908909
- Fixed regression in :meth:`DataFrame.from_records` not initializing subclasses properly (:issue:`57008`)
909910

910911
.. ***DO NOT USE THIS SECTION***

pandas/_libs/arrays.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import Sequence
1+
from collections.abc import Sequence
22

33
import numpy as np
44

pandas/_libs/hashtable.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
from collections.abc import Hashable
12
from typing import (
23
Any,
3-
Hashable,
44
Literal,
55
overload,
66
)

pandas/_libs/internals.pyi

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
from typing import (
1+
from collections.abc import (
22
Iterator,
33
Sequence,
4+
)
5+
from typing import (
46
final,
57
overload,
68
)

pandas/_libs/json.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
from collections.abc import Callable
12
from typing import (
23
Any,
3-
Callable,
44
)
55

66
def ujson_dumps(

pandas/_libs/lib.pyi

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
# TODO(npdtypes): Many types specified here can be made more specific/accurate;
22
# the more specific versions are specified in comments
3+
from collections.abc import (
4+
Callable,
5+
Generator,
6+
Hashable,
7+
)
38
from decimal import Decimal
49
from typing import (
510
Any,
6-
Callable,
711
Final,
8-
Generator,
9-
Hashable,
1012
Literal,
1113
TypeAlias,
1214
overload,

pandas/_libs/ops.pyi

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
from typing import (
2-
Any,
1+
from collections.abc import (
32
Callable,
43
Iterable,
4+
)
5+
from typing import (
6+
Any,
57
Literal,
68
TypeAlias,
79
overload,

pandas/_libs/parsers.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
from collections.abc import Hashable
12
from typing import (
2-
Hashable,
33
Literal,
44
)
55

0 commit comments

Comments
 (0)