Skip to content

Commit ccee49c

Browse files
committed
remove arg from construct_array_type as no longer needed
1 parent b92461c commit ccee49c

File tree

8 files changed

+8
-20
lines changed

8 files changed

+8
-20
lines changed

pandas/core/algorithms.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ def _reconstruct_data(values, dtype, original):
154154
"""
155155
from pandas import Index
156156
if is_extension_array_dtype(dtype):
157-
values = dtype.construct_array_type(values)._from_sequence(values)
157+
values = dtype.construct_array_type()._from_sequence(values)
158158
elif is_datetime64tz_dtype(dtype) or is_period_dtype(dtype):
159159
values = Index(original)._shallow_copy(values, name=None)
160160
elif is_bool_dtype(dtype):

pandas/core/dtypes/dtypes.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -323,13 +323,9 @@ def _hash_categories(categories, ordered=True):
323323
return np.bitwise_xor.reduce(hashed)
324324

325325
@classmethod
326-
def construct_array_type(cls, array=None):
326+
def construct_array_type(cls):
327327
"""Return the array type associated with this dtype
328328
329-
Parameters
330-
----------
331-
array : array-like, optional
332-
333329
Returns
334330
-------
335331
type

pandas/core/series.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4086,7 +4086,7 @@ def _try_cast(arr, take_fast_path):
40864086
ordered=dtype.ordered)
40874087
elif is_extension_array_dtype(dtype):
40884088
# create an extension array from its dtype
4089-
array_type = dtype.construct_array_type(subarr)
4089+
array_type = dtype.construct_array_type()
40904090
subarr = array_type(subarr, copy=copy)
40914091

40924092
elif dtype is not None and raise_cast_failure:

pandas/tests/extension/category/test_categorical.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def data_for_grouping():
6464
class TestDtype(base.BaseDtypeTests):
6565

6666
def test_array_type_with_arg(self, data, dtype):
67-
assert dtype.construct_array_type('foo') is Categorical
67+
assert dtype.construct_array_type() is Categorical
6868

6969

7070
class TestInterface(base.BaseInterfaceTests):

pandas/tests/extension/decimal/array.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,9 @@ class DecimalDtype(ExtensionDtype):
1616
na_value = decimal.Decimal('NaN')
1717

1818
@classmethod
19-
def construct_array_type(cls, array=None):
19+
def construct_array_type(cls):
2020
"""Return the array type associated with this dtype
2121
22-
Parameters
23-
----------
24-
array : array-like, optional
25-
2622
Returns
2723
-------
2824
type

pandas/tests/extension/decimal/test_decimal.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ def assert_frame_equal(self, left, right, *args, **kwargs):
102102
class TestDtype(BaseDecimal, base.BaseDtypeTests):
103103

104104
def test_array_type_with_arg(self, data, dtype):
105-
assert dtype.construct_array_type('foo') is DecimalArray
105+
assert dtype.construct_array_type() is DecimalArray
106106

107107

108108
class TestInterface(BaseDecimal, base.BaseInterfaceTests):

pandas/tests/extension/json/array.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,9 @@ class JSONDtype(ExtensionDtype):
3333
na_value = {}
3434

3535
@classmethod
36-
def construct_array_type(cls, array=None):
36+
def construct_array_type(cls):
3737
"""Return the array type associated with this dtype
3838
39-
Parameters
40-
----------
41-
array : array-like, optional
42-
4339
Returns
4440
-------
4541
type

pandas/tests/extension/json/test_json.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ def assert_frame_equal(self, left, right, *args, **kwargs):
109109
class TestDtype(BaseJSON, base.BaseDtypeTests):
110110

111111
def test_array_type_with_arg(self, data, dtype):
112-
assert dtype.construct_array_type('foo') is JSONArray
112+
assert dtype.construct_array_type() is JSONArray
113113

114114

115115
class TestInterface(BaseJSON, base.BaseInterfaceTests):

0 commit comments

Comments
 (0)