Skip to content

Commit 7a2cb6a

Browse files
committed
remove arg from construct_array_type as no longer needed
1 parent 7dbd2f3 commit 7a2cb6a

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
@@ -325,13 +325,9 @@ def _hash_categories(categories, ordered=True):
325325
return np.bitwise_xor.reduce(hashed)
326326

327327
@classmethod
328-
def construct_array_type(cls, array=None):
328+
def construct_array_type(cls):
329329
"""Return the array type associated with this dtype
330330
331-
Parameters
332-
----------
333-
array : array-like, optional
334-
335331
Returns
336332
-------
337333
type

pandas/core/series.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4093,7 +4093,7 @@ def _try_cast(arr, take_fast_path):
40934093
ordered=dtype.ordered)
40944094
elif is_extension_array_dtype(dtype):
40954095
# create an extension array from its dtype
4096-
array_type = dtype.construct_array_type(subarr)
4096+
array_type = dtype.construct_array_type()
40974097
subarr = array_type(subarr, copy=copy)
40984098

40994099
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)