Skip to content

Commit 48ee67d

Browse files
committed
fix lint
1 parent 60da570 commit 48ee67d

File tree

2 files changed

+12
-18
lines changed

2 files changed

+12
-18
lines changed

db_dtypes/json.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,18 @@ def _from_sequence_of_strings(
139139
"""Construct a new ExtensionArray from a sequence of strings."""
140140
return cls._from_sequence(strings, dtype=dtype, copy=copy)
141141

142+
@classmethod
143+
def _concat_same_type(cls, to_concat) -> JSONArray:
144+
"""Concatenate multiple JSONArray."""
145+
chunks = [array for ea in to_concat for array in ea._pa_array.iterchunks()]
146+
arr = pa.chunked_array(chunks, type=pa.large_string())
147+
return cls(arr)
148+
149+
@classmethod
150+
def _from_factorized(cls, values, original):
151+
"""Reconstruct an ExtensionArray after factorization."""
152+
return cls._from_sequence(values, dtype=original.dtype)
153+
142154
@staticmethod
143155
def _seralizate_json(value):
144156
"""A static method that converts a JSON value into a string representation."""
@@ -174,11 +186,6 @@ def insert(self, loc: int, item) -> JSONArray:
174186
val = JSONArray._seralizate_json(item)
175187
return super().insert(loc, val)
176188

177-
@classmethod
178-
def _from_factorized(cls, values, original):
179-
"""Reconstruct an ExtensionArray after factorization."""
180-
return cls._from_sequence(values, dtype=original.dtype)
181-
182189
def __getitem__(self, item):
183190
"""Select a subset of self."""
184191
item = check_array_indexer(self, item)
@@ -237,10 +244,3 @@ def __iter__(self):
237244
yield self._dtype.na_value
238245
else:
239246
yield val
240-
241-
@classmethod
242-
def _concat_same_type(cls, to_concat) -> JSONArray:
243-
"""Concatenate multiple JSONArray."""
244-
chunks = [array for ea in to_concat for array in ea._pa_array.iterchunks()]
245-
arr = pa.chunked_array(chunks, type=pa.large_string())
246-
return cls(arr)

tests/compliance/json/test_json_compliance.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@
2222
from pandas.tests.extension import base
2323
import pytest
2424

25-
from db_dtypes import JSONArray
26-
2725

2826
class TestJSONArray(base.ExtensionTests):
2927
@pytest.mark.xfail(reason="Unhashable")
@@ -88,10 +86,6 @@ def test_arith_frame_with_scalar(self, data, all_arithmetic_operators):
8886
def test_arith_series_with_scalar(self, data, all_arithmetic_operators):
8987
super().test_arith_series_with_scalar(data, all_arithmetic_operators)
9088

91-
@pytest.mark.xfail(reason="Arithmetic functions is not supported for json")
92-
def test_arith_series_with_scalar(self, data, all_arithmetic_operators):
93-
super().test_arith_series_with_scalar(data, all_arithmetic_operators)
94-
9589
@pytest.mark.xfail(reason="Arithmetic functions is not supported for json")
9690
def test_arith_series_with_array(self, data, all_arithmetic_operators):
9791
super().test_arith_series_with_array(data, all_arithmetic_operators)

0 commit comments

Comments
 (0)