We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7131268 commit 149e193Copy full SHA for 149e193
pandas/tests/io/json/test_json_table_schema.py
@@ -789,3 +789,25 @@ def test_empty_frame_roundtrip(self):
789
out = df.to_json(orient="table")
790
result = pd.read_json(out, orient="table")
791
tm.assert_frame_equal(expected, result)
792
+
793
+ def test_read_json_orient_table_old_schema_version(self):
794
+ df_json = """
795
+ {
796
+ "schema":{
797
+ "fields":[
798
+ {"name":"index","type":"integer"},
799
+ {"name":"a","type":"string"}
800
+ ],
801
+ "primaryKey":["index"],
802
+ "pandas_version":"0.20.0"
803
+ },
804
+ "data":[
805
+ {"index":0,"a":1},
806
+ {"index":1,"a":2.0},
807
+ {"index":2,"a":"s"}
808
+ ]
809
+ }
810
+ """
811
+ expected = DataFrame({"a": [1, 2.0, "s"]})
812
+ result = pd.read_json(df_json, orient="table")
813
+ tm.assert_frame_equal(expected, result)
0 commit comments