Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ArrayManager] TST: enable JSON tests (except for table schema) #41075

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions pandas/tests/io/json/test_compression.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
import pandas as pd
import pandas._testing as tm

pytestmark = td.skip_array_manager_not_yet_implemented


def test_compression_roundtrip(compression):
df = pd.DataFrame(
Expand Down
4 changes: 0 additions & 4 deletions pandas/tests/io/json/test_deprecated_kwargs.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,11 @@
Tests for the deprecated keyword arguments for `read_json`.
"""

import pandas.util._test_decorators as td

import pandas as pd
import pandas._testing as tm

from pandas.io.json import read_json

pytestmark = td.skip_array_manager_not_yet_implemented


def test_deprecated_kwargs():
df = pd.DataFrame({"A": [2, 4, 6], "B": [3, 6, 9]}, index=[0, 1, 2])
Expand Down
6 changes: 4 additions & 2 deletions pandas/tests/io/json/test_normalize.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@

from pandas.io.json._normalize import nested_to_record

pytestmark = td.skip_array_manager_not_yet_implemented


@pytest.fixture
def deep_nested():
Expand Down Expand Up @@ -153,6 +151,8 @@ def test_simple_records(self):

tm.assert_frame_equal(result, expected)

# TODO(ArrayManager) sanitize S/U numpy dtypes to object
@td.skip_array_manager_not_yet_implemented
def test_simple_normalize(self, state_data):
result = json_normalize(state_data[0], "counties")
expected = DataFrame(state_data[0]["counties"])
Expand Down Expand Up @@ -372,6 +372,8 @@ def test_meta_parameter_not_modified(self):
for val in ["metafoo", "metabar", "foo", "bar"]:
assert val in result

# TODO(ArrayManager) sanitize S/U numpy dtypes to object
@td.skip_array_manager_not_yet_implemented
def test_record_prefix(self, state_data):
result = json_normalize(state_data[0], "counties")
expected = DataFrame(state_data[0]["counties"])
Expand Down
13 changes: 9 additions & 4 deletions pandas/tests/io/json/test_pandas.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@
)
import pandas._testing as tm

pytestmark = td.skip_array_manager_not_yet_implemented


_seriesd = tm.getSeriesData()

_frame = DataFrame(_seriesd)
Expand Down Expand Up @@ -318,7 +315,13 @@ def test_roundtrip_mixed(self, request, orient, convert_axes, numpy):
'{"columns":["A","B"],'
'"index":["2","3"],'
'"data":[[1.0,"1"],[2.0,"2"],[null,"3"]]}',
r"Shape of passed values is \(3, 2\), indices imply \(2, 2\)",
"|".join(
[
r"Shape of passed values is \(3, 2\), indices imply \(2, 2\)",
"Passed arrays should have the same length as the rows Index: "
"3 vs 2 rows",
]
),
"split",
),
# too many columns
Expand Down Expand Up @@ -854,6 +857,8 @@ def test_convert_dates_infer(self, infer_word):
result = read_json(dumps(data))[["id", infer_word]]
tm.assert_frame_equal(result, expected)

# TODO(ArrayManager) JSON
@td.skip_array_manager_not_yet_implemented
@pytest.mark.parametrize(
"date,date_unit",
[
Expand Down
4 changes: 0 additions & 4 deletions pandas/tests/io/json/test_readlines.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@

import pytest

import pandas.util._test_decorators as td

import pandas as pd
from pandas import (
DataFrame,
Expand All @@ -14,8 +12,6 @@

from pandas.io.json._json import JsonReader

pytestmark = td.skip_array_manager_not_yet_implemented


@pytest.fixture
def lines_json_df():
Expand Down
3 changes: 0 additions & 3 deletions pandas/tests/io/json/test_ujson.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
IS64,
is_platform_windows,
)
import pandas.util._test_decorators as td

from pandas import (
DataFrame,
Expand All @@ -32,8 +31,6 @@
)
import pandas._testing as tm

pytestmark = td.skip_array_manager_not_yet_implemented


def _clean_dict(d):
"""
Expand Down