Skip to content

Commit b92461c

Browse files
committed
review comments
1 parent b6a454d commit b92461c

File tree

6 files changed

+13
-16
lines changed

6 files changed

+13
-16
lines changed

doc/source/whatsnew/v0.24.0.txt

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@ ExtensionType Changes
7777
- ``ExtensionDtype`` has gained the ability to instantiate from string dtypes, e.g. ``decimal`` would instantiate a registered ``DecimalDtype``; furthermore
7878
the dtype has gained the ``construct_array_type`` (:issue:`21185`)
7979
- The ``ExtensionArray`` constructor, ``_from_sequence`` now take the keyword arg ``copy=False`` (:issue:`21185`)
80+
- :meth:`Series.combine()` works correctly with :class:`~pandas.api.extensions.ExtensionArray` inside of :class:`Series` (:issue:`20825`)
81+
- :meth:`Series.combine()` with scalar argument now works for any function type (:issue:`21248`)
82+
-
8083

8184
.. _whatsnew_0240.api.other:
8285

@@ -228,12 +231,6 @@ Reshaping
228231
-
229232
-
230233

231-
ExtensionArray
232-
^^^^^^^^^^^^^^
233-
234-
- :meth:`Series.combine()` works correctly with :class:`~pandas.api.extensions.ExtensionArray` inside of :class:`Series` (:issue:`20825`)
235-
- :meth:`Series.combine()` with scalar argument now works for any function type (:issue:`21248`)
236-
-
237234
-
238235

239236
Other

pandas/core/arrays/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def _from_sequence(cls, scalars, copy=False):
9292
scalars : Sequence
9393
Each element will be an instance of the scalar type for this
9494
array, ``cls.dtype.type``.
95-
copy : boolean, default True
95+
copy : boolean, default False
9696
if True, copy the underlying data
9797
Returns
9898
-------

pandas/core/dtypes/base.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,6 @@ def construct_array_type(cls, array=None):
173173
-------
174174
type
175175
"""
176-
if array is None:
177-
return cls
178176
raise NotImplementedError
179177

180178
@classmethod

pandas/core/dtypes/dtypes.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,14 @@
99

1010

1111
class Registry(object):
12-
""" Registry for dtype inference
12+
"""
13+
Registry for dtype inference
1314
14-
We can directly construct dtypes in pandas_dtypes if they are
15-
a type; the registry allows us to register an extension dtype
16-
to try inference from a string or a dtype class
15+
The registry allows one to map a string repr of a extension
16+
dtype to an extenstion dtype.
1717
18-
These are tried in order for inference.
18+
Multiple extension types can be registered.
19+
These are tried in order.
1920
2021
Examples
2122
--------

pandas/tests/dtypes/test_dtypes.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -788,6 +788,7 @@ def test_registry(dtype):
788788
[('int64', None),
789789
('interval', IntervalDtype()),
790790
('interval[int64]', IntervalDtype()),
791+
('interval[datetime64[ns]]', IntervalDtype('datetime64[ns]')),
791792
('category', CategoricalDtype()),
792793
('period[D]', PeriodDtype('D')),
793794
('datetime64[ns, US/Eastern]', DatetimeTZDtype('ns', 'US/Eastern'))])

pandas/tests/extension/base/constructors.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ def test_from_dtype(self, data):
5252
dtype = data.dtype
5353

5454
expected = pd.Series(data)
55-
result = pd.Series(np.array(data), dtype=dtype)
55+
result = pd.Series(list(data), dtype=dtype)
5656
self.assert_series_equal(result, expected)
5757

58-
result = pd.Series(np.array(data), dtype=str(dtype))
58+
result = pd.Series(list(data), dtype=str(dtype))
5959
self.assert_series_equal(result, expected)

0 commit comments

Comments
 (0)