Skip to content

Commit 2f53e34

Browse files
committed
Unify repr
1 parent 84e2db1 commit 2f53e34

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

pandas/tests/extension/arrow/arrays.py

+3-6
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ def from_array(cls, arr):
7878
def _from_sequence(cls, scalars, dtype=None, copy=False):
7979
return cls.from_scalars(scalars)
8080

81+
def __repr__(self):
82+
return "{cls}({data})".format(cls=type(self).__name__, data=repr(self._data))
83+
8184
def __getitem__(self, item):
8285
if pd.api.types.is_scalar(item):
8386
return self._data.to_pandas()[item]
@@ -162,9 +165,6 @@ def __init__(self, values):
162165
self._data = values
163166
self._dtype = ArrowBoolDtype()
164167

165-
def __repr__(self):
166-
return "ArrowBoolArray({})".format(repr(self._data))
167-
168168

169169
class ArrowStringArray(ArrowExtensionArray):
170170
def __init__(self, values):
@@ -174,6 +174,3 @@ def __init__(self, values):
174174
assert values.type == pa.string()
175175
self._data = values
176176
self._dtype = ArrowStringDtype()
177-
178-
def __repr__(self):
179-
return "ArrowStringArray({})".format(repr(self._data))

0 commit comments

Comments
 (0)