Skip to content

Commit 7cf9716

Browse files
author
Albert Villanova del Moral
committed
Add tests (pandas-dev#25435)
1 parent 98333da commit 7cf9716

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

pandas/tests/io/json/test_pandas.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -1202,10 +1202,12 @@ def test_data_frame_size_after_to_json(self):
12021202

12031203
assert size_before == size_after
12041204

1205-
@pytest.mark.parametrize('index', [None, [1., 2.], ['1', '2'],
1206-
['1.', '2.']])
1207-
def test_from_json_to_json_table_index(self, index):
1208-
expected = DataFrame({'a': [1, 2]}, index=index)
1205+
@pytest.mark.parametrize('index', [None, [1, 2], [1., 2.], ['a', 'b'],
1206+
['1', '2'], ['1.', '2.']])
1207+
@pytest.mark.parametrize('columns', [['a', 'b'], ['1', '2'], ['1.', '2.']])
1208+
def test_from_json_to_json_table_index_and_columns(self, index, columns):
1209+
# GH25433 GH25435
1210+
expected = DataFrame([[1, 2], [3, 4]], index=index, columns=columns)
12091211
dfjson = expected.to_json(orient='table')
12101212
result = pd.read_json(dfjson, orient='table')
12111213
assert_frame_equal(result, expected)

0 commit comments

Comments
 (0)