Skip to content

Commit 44e2d43

Browse files
committed
minor
1 parent ed906ef commit 44e2d43

File tree

2 files changed

+0
-54
lines changed

2 files changed

+0
-54
lines changed

db_dtypes/json.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -202,18 +202,6 @@ def dtype(self) -> JSONDtype:
202202
def __contains__(self, key) -> bool:
203203
return super().__contains__(JSONArray._seralizate_json(key))
204204

205-
# def __contains__(self, key) -> bool:
206-
# # https://github.com/pandas-dev/pandas/pull/51307#issuecomment-1426372604
207-
# if pd.isna(key) and key is not self.dtype.na_value:
208-
# if self.dtype.kind == "f" and lib.is_float(key):
209-
# return pc.any(pc.is_nan(self._pa_array)).as_py()
210-
211-
# # e.g. date or timestamp types we do not allow None here to match pd.NA
212-
# return False
213-
# # TODO: maybe complex? object?
214-
215-
# return bool(super().__contains__(key))
216-
217205
def insert(self, loc: int, item) -> JSONArray:
218206
val = JSONArray._seralizate_json(item)
219207
return super().insert(loc, val)

tests/compliance/json/test_json_compliance.py

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -402,45 +402,3 @@ def test_getitem_scalar(self, data):
402402

403403
result = pd.Series(data)[0]
404404
assert isinstance(result, dict)
405-
406-
407-
def custom_assert_frame_equal(left, right, *args, **kwargs):
408-
obj_type = kwargs.get("obj", "DataFrame")
409-
tm.assert_index_equal(
410-
left.columns,
411-
right.columns,
412-
exact=kwargs.get("check_column_type", "equiv"),
413-
check_names=kwargs.get("check_names", True),
414-
check_exact=kwargs.get("check_exact", False),
415-
check_categorical=kwargs.get("check_categorical", True),
416-
obj=f"{obj_type}.columns",
417-
)
418-
419-
jsons = (left.dtypes == "json").index
420-
421-
for col in jsons:
422-
tm.assert_series_equal(left[col], right[col], *args, **kwargs)
423-
424-
left = left.drop(columns=jsons)
425-
right = right.drop(columns=jsons)
426-
tm.assert_frame_equal(left, right, *args, **kwargs)
427-
428-
429-
def test_custom_asserts():
430-
data = JSONArray._from_sequence(
431-
[
432-
{"a": 1},
433-
{"b": 2},
434-
{"c": 3},
435-
]
436-
)
437-
a = pd.Series(data)
438-
tm.assert_series_equal(a, a)
439-
custom_assert_frame_equal(a.to_frame(), a.to_frame())
440-
441-
b = pd.Series(data.take([0, 0, 1]))
442-
with pytest.raises(AssertionError):
443-
tm.assert_series_equal(a, b)
444-
445-
with pytest.raises(AssertionError):
446-
custom_assert_frame_equal(a.to_frame(), b.to_frame())

0 commit comments

Comments
 (0)