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 06e6954 commit 04ff50eCopy full SHA for 04ff50e
pandas/tests/io/json/test_normalize.py
@@ -927,3 +927,14 @@ def test_series_non_zero_index(self):
927
index=[1, 2, 3],
928
)
929
tm.assert_frame_equal(result, expected)
930
+
931
+ def test_json_normalize_non_str_keys(self):
932
+ # Test that json_normalize handles non-string meta
933
+ # keys correctly when record_path is used
934
935
+ data_list = [{"a": 1, 12: "meta_value", "nested": [{"b": 2}]}]
936
937
+ result = json_normalize(data_list, record_path=["nested"], meta=[12])
938
+ expected = DataFrame({"b": [2], 12: ["meta_value"]})
939
940
+ tm.assert_frame_equal(result, expected)
0 commit comments