From ad922ceafeb82d29550e1ceb3734151c7574c6ee Mon Sep 17 00:00:00 2001 From: vishwakftw Date: Fri, 26 Jul 2019 22:37:23 +0530 Subject: [PATCH 01/14] Move json_normalize to pd namespace - Added a whatsnew entry - Imported pandas.io.json.json_normalize in __init__.py --- doc/source/whatsnew/v1.0.0.rst | 2 +- pandas/__init__.py | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/doc/source/whatsnew/v1.0.0.rst b/doc/source/whatsnew/v1.0.0.rst index c352a36bf6de1..a9d7e13091b93 100644 --- a/doc/source/whatsnew/v1.0.0.rst +++ b/doc/source/whatsnew/v1.0.0.rst @@ -52,7 +52,7 @@ Other API changes Deprecations ~~~~~~~~~~~~ - +- Moved :func:`pandas.io.json.json_normalize` to the top-level namespace as :func:`pandas.json_normalize`. - - diff --git a/pandas/__init__.py b/pandas/__init__.py index 6351b508fb0e5..e985fa0241ca8 100644 --- a/pandas/__init__.py +++ b/pandas/__init__.py @@ -178,6 +178,10 @@ read_spss, ) +from pandas.io.json import ( + json_normalize +) + from pandas.util._tester import test import pandas.testing import pandas.arrays From ea57d9845ff24b43a540cddb887e0a904d52608d Mon Sep 17 00:00:00 2001 From: vishwakftw Date: Sun, 28 Jul 2019 22:13:32 +0530 Subject: [PATCH 02/14] Code review - I - json_normalize --> _json_normalize - json_normalize inside io.json._normalize is a deprecated method - update whatsnew docs - update io docs - fix broken test_api --- doc/source/user_guide/io.rst | 2 +- doc/source/whatsnew/v1.0.0.rst | 2 +- pandas/__init__.py | 2 +- pandas/io/json/__init__.py | 3 ++- pandas/io/json/_normalize.py | 11 ++++++++++- pandas/tests/api/test_api.py | 3 +++ 6 files changed, 18 insertions(+), 5 deletions(-) diff --git a/doc/source/user_guide/io.rst b/doc/source/user_guide/io.rst index ae288ba5bde16..299897da16393 100644 --- a/doc/source/user_guide/io.rst +++ b/doc/source/user_guide/io.rst @@ -2150,7 +2150,7 @@ into a flat table. .. ipython:: python - from pandas.io.json import json_normalize + from pandas import json_normalize data = [{'id': 1, 'name': {'first': 'Coleen', 'last': 'Volk'}}, {'name': {'given': 'Mose', 'family': 'Regner'}}, {'id': 2, 'name': 'Faye Raker'}] diff --git a/doc/source/whatsnew/v1.0.0.rst b/doc/source/whatsnew/v1.0.0.rst index a9d7e13091b93..61b01c2712c1f 100644 --- a/doc/source/whatsnew/v1.0.0.rst +++ b/doc/source/whatsnew/v1.0.0.rst @@ -52,7 +52,7 @@ Other API changes Deprecations ~~~~~~~~~~~~ -- Moved :func:`pandas.io.json.json_normalize` to the top-level namespace as :func:`pandas.json_normalize`. +- :func:`pandas.json_normalize` is now exposed in the top-level namespace. Usage of :func:`json_normalize` as :func:`pandas.io.json.json_normalize` is now deprecated and it is recommended to use :func:`json_normalize` as :func:`pandas.json_normalize` instead. (:issue:`27586`) - - diff --git a/pandas/__init__.py b/pandas/__init__.py index e985fa0241ca8..6397386e7ac87 100644 --- a/pandas/__init__.py +++ b/pandas/__init__.py @@ -179,7 +179,7 @@ ) from pandas.io.json import ( - json_normalize + _json_normalize as json_normalize ) from pandas.util._tester import test diff --git a/pandas/io/json/__init__.py b/pandas/io/json/__init__.py index 2382d993df96b..48febb086c302 100644 --- a/pandas/io/json/__init__.py +++ b/pandas/io/json/__init__.py @@ -1,5 +1,5 @@ from pandas.io.json._json import dumps, loads, read_json, to_json -from pandas.io.json._normalize import json_normalize +from pandas.io.json._normalize import _json_normalize, json_normalize from pandas.io.json._table_schema import build_table_schema __all__ = [ @@ -7,6 +7,7 @@ "loads", "read_json", "to_json", + "_json_normalize", "json_normalize", "build_table_schema", ] diff --git a/pandas/io/json/_normalize.py b/pandas/io/json/_normalize.py index 24a255c78f3c0..1ae17de4545b3 100644 --- a/pandas/io/json/_normalize.py +++ b/pandas/io/json/_normalize.py @@ -10,6 +10,7 @@ from pandas._libs.writers import convert_json_to_lines from pandas import DataFrame +from pandas.util._decorators import deprecate def convert_to_line_delimits(s): @@ -111,7 +112,7 @@ def nested_to_record( return new_ds -def json_normalize( +def _json_normalize( data: Union[Dict, List[Dict]], record_path: Optional[Union[str, List]] = None, meta: Optional[Union[str, List]] = None, @@ -341,3 +342,11 @@ def _recursive_extract(data, path, seen_meta, level=0): ) result[k] = np.array(v, dtype=object).repeat(lengths) return result + + +json_normalize = deprecate( + "pandas.io.json.json_normalize", + _json_normalize, + "1.0.0", + "pandas.json_normalize", + ) diff --git a/pandas/tests/api/test_api.py b/pandas/tests/api/test_api.py index 326bef7f4b480..6c0600387f751 100644 --- a/pandas/tests/api/test_api.py +++ b/pandas/tests/api/test_api.py @@ -168,6 +168,9 @@ class TestPDApi(Base): "read_spss", ] + # top-level json funcs + funcs_json = ["json_normalize"] + # top-level to_* funcs funcs_to = ["to_datetime", "to_msgpack", "to_numeric", "to_pickle", "to_timedelta"] From 84b05438c59ca356fd3375955e987bbbabb0ebb2 Mon Sep 17 00:00:00 2001 From: vishwakftw Date: Sun, 28 Jul 2019 22:18:10 +0530 Subject: [PATCH 03/14] Fix lint --- pandas/io/json/_normalize.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pandas/io/json/_normalize.py b/pandas/io/json/_normalize.py index 1ae17de4545b3..4dc93516c6007 100644 --- a/pandas/io/json/_normalize.py +++ b/pandas/io/json/_normalize.py @@ -345,8 +345,8 @@ def _recursive_extract(data, path, seen_meta, level=0): json_normalize = deprecate( - "pandas.io.json.json_normalize", - _json_normalize, - "1.0.0", - "pandas.json_normalize", - ) + "pandas.io.json.json_normalize", + _json_normalize, + "1.0.0", + "pandas.json_normalize", +) From 471d4570e6451852aef5ed3aa80188690d88e7a7 Mon Sep 17 00:00:00 2001 From: vishwakftw Date: Sun, 28 Jul 2019 23:31:51 +0530 Subject: [PATCH 04/14] Fix failing tests due to usage of deprecated function --- pandas/tests/api/test_api.py | 1 + pandas/tests/io/json/test_normalize.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/pandas/tests/api/test_api.py b/pandas/tests/api/test_api.py index 6c0600387f751..6d9e4f20cec85 100644 --- a/pandas/tests/api/test_api.py +++ b/pandas/tests/api/test_api.py @@ -209,6 +209,7 @@ def test_api(self): + self.funcs + self.funcs_option + self.funcs_read + + self.funcs_json + self.funcs_to + self.deprecated_funcs_in_future + self.deprecated_funcs diff --git a/pandas/tests/io/json/test_normalize.py b/pandas/tests/io/json/test_normalize.py index 3ceddfc3c1db4..fcc368f207287 100644 --- a/pandas/tests/io/json/test_normalize.py +++ b/pandas/tests/io/json/test_normalize.py @@ -8,7 +8,7 @@ from pandas import DataFrame, Index import pandas.util.testing as tm -from pandas.io.json import json_normalize +from pandas import json_normalize from pandas.io.json._normalize import nested_to_record From c28b63717ba6a07a84bce36e91279b6919d45d68 Mon Sep 17 00:00:00 2001 From: vishwakftw Date: Mon, 29 Jul 2019 09:48:35 +0530 Subject: [PATCH 05/14] Fix lint using black and isort, sorry --- pandas/__init__.py | 4 +--- pandas/io/json/_normalize.py | 7 ++----- pandas/tests/io/json/test_normalize.py | 3 +-- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/pandas/__init__.py b/pandas/__init__.py index 6397386e7ac87..5b7ab23b5588a 100644 --- a/pandas/__init__.py +++ b/pandas/__init__.py @@ -178,9 +178,7 @@ read_spss, ) -from pandas.io.json import ( - _json_normalize as json_normalize -) +from pandas.io.json import _json_normalize as json_normalize from pandas.util._tester import test import pandas.testing diff --git a/pandas/io/json/_normalize.py b/pandas/io/json/_normalize.py index 4dc93516c6007..b9913b30f9a68 100644 --- a/pandas/io/json/_normalize.py +++ b/pandas/io/json/_normalize.py @@ -8,9 +8,9 @@ import numpy as np from pandas._libs.writers import convert_json_to_lines +from pandas.util._decorators import deprecate from pandas import DataFrame -from pandas.util._decorators import deprecate def convert_to_line_delimits(s): @@ -345,8 +345,5 @@ def _recursive_extract(data, path, seen_meta, level=0): json_normalize = deprecate( - "pandas.io.json.json_normalize", - _json_normalize, - "1.0.0", - "pandas.json_normalize", + "pandas.io.json.json_normalize", _json_normalize, "1.0.0", "pandas.json_normalize" ) diff --git a/pandas/tests/io/json/test_normalize.py b/pandas/tests/io/json/test_normalize.py index fcc368f207287..46dbbdbec68e4 100644 --- a/pandas/tests/io/json/test_normalize.py +++ b/pandas/tests/io/json/test_normalize.py @@ -5,10 +5,9 @@ from pandas.compat import PY36 -from pandas import DataFrame, Index +from pandas import DataFrame, Index, json_normalize import pandas.util.testing as tm -from pandas import json_normalize from pandas.io.json._normalize import nested_to_record From 8b5dba4c16606bec73e63bba2082f1015bcde254 Mon Sep 17 00:00:00 2001 From: vishwakftw Date: Mon, 29 Jul 2019 19:34:30 +0530 Subject: [PATCH 06/14] Code Review - II - Update whatsnew entry --- doc/source/whatsnew/v1.0.0.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/whatsnew/v1.0.0.rst b/doc/source/whatsnew/v1.0.0.rst index 61b01c2712c1f..49fefd421747e 100644 --- a/doc/source/whatsnew/v1.0.0.rst +++ b/doc/source/whatsnew/v1.0.0.rst @@ -52,7 +52,7 @@ Other API changes Deprecations ~~~~~~~~~~~~ -- :func:`pandas.json_normalize` is now exposed in the top-level namespace. Usage of :func:`json_normalize` as :func:`pandas.io.json.json_normalize` is now deprecated and it is recommended to use :func:`json_normalize` as :func:`pandas.json_normalize` instead. (:issue:`27586`) +- :func:`pandas.json_normalize` is now exposed in the top-level namespace. Usage of ``json_normalize`` as ``pandas.io.json.json_normalize`` is now deprecated and it is recommended to use ``json_normalize`` as :func:`pandas.json_normalize` instead. (:issue:`27586`) - - From c023b689d396984830f6377bdfb1695d3323e22c Mon Sep 17 00:00:00 2001 From: vishwakftw Date: Mon, 29 Jul 2019 19:34:30 +0530 Subject: [PATCH 07/14] Code Review - II - Update whatsnew entry --- doc/source/whatsnew/v1.0.0.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/whatsnew/v1.0.0.rst b/doc/source/whatsnew/v1.0.0.rst index 61b01c2712c1f..49fefd421747e 100644 --- a/doc/source/whatsnew/v1.0.0.rst +++ b/doc/source/whatsnew/v1.0.0.rst @@ -52,7 +52,7 @@ Other API changes Deprecations ~~~~~~~~~~~~ -- :func:`pandas.json_normalize` is now exposed in the top-level namespace. Usage of :func:`json_normalize` as :func:`pandas.io.json.json_normalize` is now deprecated and it is recommended to use :func:`json_normalize` as :func:`pandas.json_normalize` instead. (:issue:`27586`) +- :func:`pandas.json_normalize` is now exposed in the top-level namespace. Usage of ``json_normalize`` as ``pandas.io.json.json_normalize`` is now deprecated and it is recommended to use ``json_normalize`` as :func:`pandas.json_normalize` instead. (:issue:`27586`) - - From 9ec93e889ca5ebe2d395415ef7f262fd4ee345b5 Mon Sep 17 00:00:00 2001 From: vishwakftw Date: Tue, 30 Jul 2019 11:06:11 +0530 Subject: [PATCH 08/14] Code Review - III - Update entry in reference/io.rst --- doc/redirects.csv | 2 +- doc/source/reference/io.rst | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/doc/redirects.csv b/doc/redirects.csv index a7886779c97d5..6dffbf11faad4 100644 --- a/doc/redirects.csv +++ b/doc/redirects.csv @@ -792,7 +792,6 @@ generated/pandas.io.formats.style.Styler.to_excel,../reference/api/pandas.io.for generated/pandas.io.formats.style.Styler.use,../reference/api/pandas.io.formats.style.Styler.use generated/pandas.io.formats.style.Styler.where,../reference/api/pandas.io.formats.style.Styler.where generated/pandas.io.json.build_table_schema,../reference/api/pandas.io.json.build_table_schema -generated/pandas.io.json.json_normalize,../reference/api/pandas.io.json.json_normalize generated/pandas.io.stata.StataReader.data,../reference/api/pandas.io.stata.StataReader.data generated/pandas.io.stata.StataReader.data_label,../reference/api/pandas.io.stata.StataReader.data_label generated/pandas.io.stata.StataReader.value_labels,../reference/api/pandas.io.stata.StataReader.value_labels @@ -800,6 +799,7 @@ generated/pandas.io.stata.StataReader.variable_labels,../reference/api/pandas.io generated/pandas.io.stata.StataWriter.write_file,../reference/api/pandas.io.stata.StataWriter.write_file generated/pandas.isna,../reference/api/pandas.isna generated/pandas.isnull,../reference/api/pandas.isnull +generated/pandas.json_normalize,../reference/api/pandas.json_normalize generated/pandas.melt,../reference/api/pandas.melt generated/pandas.merge_asof,../reference/api/pandas.merge_asof generated/pandas.merge,../reference/api/pandas.merge diff --git a/doc/source/reference/io.rst b/doc/source/reference/io.rst index 666220d390cdc..2d4f02a09ed14 100644 --- a/doc/source/reference/io.rst +++ b/doc/source/reference/io.rst @@ -52,12 +52,16 @@ JSON read_json +.. autosummary:: + :toctree: api/ + + json_normalize + .. currentmodule:: pandas.io.json .. autosummary:: :toctree: api/ - json_normalize build_table_schema .. currentmodule:: pandas From 94b195e487886d27b3b6ab4a849fbd22a2b1cbd9 Mon Sep 17 00:00:00 2001 From: vishwakftw Date: Tue, 27 Aug 2019 12:20:48 -0400 Subject: [PATCH 09/14] Possible doc failure fix --- doc/source/reference/io.rst | 4 ---- doc/source/whatsnew/v0.25.0.rst | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/doc/source/reference/io.rst b/doc/source/reference/io.rst index 6864c0aba61df..e6349cc173bb1 100644 --- a/doc/source/reference/io.rst +++ b/doc/source/reference/io.rst @@ -51,10 +51,6 @@ JSON :toctree: api/ read_json - -.. autosummary:: - :toctree: api/ - json_normalize .. currentmodule:: pandas.io.json diff --git a/doc/source/whatsnew/v0.25.0.rst b/doc/source/whatsnew/v0.25.0.rst index fe1e2d7826d62..d600fdff12e37 100644 --- a/doc/source/whatsnew/v0.25.0.rst +++ b/doc/source/whatsnew/v0.25.0.rst @@ -172,7 +172,7 @@ The repr now looks like this: .. ipython:: python - from pandas.io.json import json_normalize + from pandas import json_normalize data = [{ 'CreatedBy': {'Name': 'User001'}, 'Lookup': {'TextField': 'Some text', From d8ed09e160606cf7a4979592ea982e26bb25f4b6 Mon Sep 17 00:00:00 2001 From: vishwakftw Date: Fri, 13 Sep 2019 18:00:02 -0400 Subject: [PATCH 10/14] Code Review - IV --- doc/redirects.csv | 2 +- doc/source/user_guide/io.rst | 7 +++---- doc/source/whatsnew/v0.25.0.rst | 4 ++-- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/doc/redirects.csv b/doc/redirects.csv index 6dffbf11faad4..26d0fce42ef8b 100644 --- a/doc/redirects.csv +++ b/doc/redirects.csv @@ -792,6 +792,7 @@ generated/pandas.io.formats.style.Styler.to_excel,../reference/api/pandas.io.for generated/pandas.io.formats.style.Styler.use,../reference/api/pandas.io.formats.style.Styler.use generated/pandas.io.formats.style.Styler.where,../reference/api/pandas.io.formats.style.Styler.where generated/pandas.io.json.build_table_schema,../reference/api/pandas.io.json.build_table_schema +generated/pandas.io.json.json_normalize,../reference/api/pandas.json_normalize generated/pandas.io.stata.StataReader.data,../reference/api/pandas.io.stata.StataReader.data generated/pandas.io.stata.StataReader.data_label,../reference/api/pandas.io.stata.StataReader.data_label generated/pandas.io.stata.StataReader.value_labels,../reference/api/pandas.io.stata.StataReader.value_labels @@ -799,7 +800,6 @@ generated/pandas.io.stata.StataReader.variable_labels,../reference/api/pandas.io generated/pandas.io.stata.StataWriter.write_file,../reference/api/pandas.io.stata.StataWriter.write_file generated/pandas.isna,../reference/api/pandas.isna generated/pandas.isnull,../reference/api/pandas.isnull -generated/pandas.json_normalize,../reference/api/pandas.json_normalize generated/pandas.melt,../reference/api/pandas.melt generated/pandas.merge_asof,../reference/api/pandas.merge_asof generated/pandas.merge,../reference/api/pandas.merge diff --git a/doc/source/user_guide/io.rst b/doc/source/user_guide/io.rst index 0eb87480d6f75..fd537cac9a520 100644 --- a/doc/source/user_guide/io.rst +++ b/doc/source/user_guide/io.rst @@ -2153,11 +2153,10 @@ into a flat table. .. ipython:: python - from pandas import json_normalize data = [{'id': 1, 'name': {'first': 'Coleen', 'last': 'Volk'}}, {'name': {'given': 'Mose', 'family': 'Regner'}}, {'id': 2, 'name': 'Faye Raker'}] - json_normalize(data) + pd.json_normalize(data) .. ipython:: python @@ -2173,7 +2172,7 @@ into a flat table. 'counties': [{'name': 'Summit', 'population': 1234}, {'name': 'Cuyahoga', 'population': 1337}]}] - json_normalize(data, 'counties', ['state', 'shortname', ['info', 'governor']]) + pd.json_normalize(data, 'counties', ['state', 'shortname', ['info', 'governor']]) The max_level parameter provides more control over which level to end normalization. With max_level=1 the following snippet normalizes until 1st nesting level of the provided dict. @@ -2186,7 +2185,7 @@ With max_level=1 the following snippet normalizes until 1st nesting level of the 'Name': 'Name001'}}, 'Image': {'a': 'b'} }] - json_normalize(data, max_level=1) + pd.json_normalize(data, max_level=1) .. _io.jsonl: diff --git a/doc/source/whatsnew/v0.25.0.rst b/doc/source/whatsnew/v0.25.0.rst index d600fdff12e37..0f7331e7151cb 100644 --- a/doc/source/whatsnew/v0.25.0.rst +++ b/doc/source/whatsnew/v0.25.0.rst @@ -170,9 +170,9 @@ which level to end normalization (:issue:`23843`): The repr now looks like this: -.. ipython:: python +.. code-block:: ipython - from pandas import json_normalize + from pandas.io.json import json_normalize data = [{ 'CreatedBy': {'Name': 'User001'}, 'Lookup': {'TextField': 'Some text', From 1513bf55d1371db42cbd449fa74c632aac213e47 Mon Sep 17 00:00:00 2001 From: vishwakftw Date: Fri, 13 Sep 2019 18:30:54 -0400 Subject: [PATCH 11/14] Fix lint --- doc/source/user_guide/io.rst | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/source/user_guide/io.rst b/doc/source/user_guide/io.rst index fd537cac9a520..789dc5676f323 100644 --- a/doc/source/user_guide/io.rst +++ b/doc/source/user_guide/io.rst @@ -2163,16 +2163,16 @@ into a flat table. data = [{'state': 'Florida', 'shortname': 'FL', 'info': {'governor': 'Rick Scott'}, - 'counties': [{'name': 'Dade', 'population': 12345}, - {'name': 'Broward', 'population': 40000}, - {'name': 'Palm Beach', 'population': 60000}]}, + 'county': [{'name': 'Dade', 'population': 12345}, + {'name': 'Broward', 'population': 40000}, + {'name': 'Palm Beach', 'population': 60000}]}, {'state': 'Ohio', 'shortname': 'OH', 'info': {'governor': 'John Kasich'}, - 'counties': [{'name': 'Summit', 'population': 1234}, - {'name': 'Cuyahoga', 'population': 1337}]}] + 'county': [{'name': 'Summit', 'population': 1234}, + {'name': 'Cuyahoga', 'population': 1337}]}] - pd.json_normalize(data, 'counties', ['state', 'shortname', ['info', 'governor']]) + pd.json_normalize(data, 'county', ['state', 'shortname', ['info', 'governor']]) The max_level parameter provides more control over which level to end normalization. With max_level=1 the following snippet normalizes until 1st nesting level of the provided dict. From 194d1e5e042838e1afa6c84ae1ba734cd7812418 Mon Sep 17 00:00:00 2001 From: vishwakftw Date: Mon, 30 Sep 2019 11:38:25 -0400 Subject: [PATCH 12/14] Code Review - V --- pandas/tests/io/json/test_normalize.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pandas/tests/io/json/test_normalize.py b/pandas/tests/io/json/test_normalize.py index 46dbbdbec68e4..8179223ee7abb 100644 --- a/pandas/tests/io/json/test_normalize.py +++ b/pandas/tests/io/json/test_normalize.py @@ -691,3 +691,12 @@ def test_with_large_max_level(self): ] output = nested_to_record(input_data, max_level=max_level) assert output == expected + + def test_deprecated_import(self): + with tm.assert_produces_warning(FutureWarning) as w: + from pandas.io.json import json_normalize + recs = [ + {"a": 1, "b": 2, "c": 3}, + {"a": 4, "b": 5, "c": 6}, + ] + json_normalize(recs) From 3af6f038581a85977e7ce5450ee4d7d58ac9ab95 Mon Sep 17 00:00:00 2001 From: vishwakftw Date: Fri, 8 Nov 2019 14:30:01 -0500 Subject: [PATCH 13/14] Fix lint error --- pandas/tests/io/json/test_normalize.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/tests/io/json/test_normalize.py b/pandas/tests/io/json/test_normalize.py index 01f13d0383ec6..69343d736dccc 100644 --- a/pandas/tests/io/json/test_normalize.py +++ b/pandas/tests/io/json/test_normalize.py @@ -701,7 +701,7 @@ def test_with_large_max_level(self): assert output == expected def test_deprecated_import(self): - with tm.assert_produces_warning(FutureWarning) as w: + with tm.assert_produces_warning(FutureWarning): from pandas.io.json import json_normalize recs = [ {"a": 1, "b": 2, "c": 3}, From 6476942c0c64f8946004490390c21b3223f7ec1f Mon Sep 17 00:00:00 2001 From: vishwakftw Date: Sat, 9 Nov 2019 01:36:12 -0500 Subject: [PATCH 14/14] Black reformat --- pandas/tests/io/json/test_normalize.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pandas/tests/io/json/test_normalize.py b/pandas/tests/io/json/test_normalize.py index 69343d736dccc..e8fb03b4315cd 100644 --- a/pandas/tests/io/json/test_normalize.py +++ b/pandas/tests/io/json/test_normalize.py @@ -703,8 +703,6 @@ def test_with_large_max_level(self): def test_deprecated_import(self): with tm.assert_produces_warning(FutureWarning): from pandas.io.json import json_normalize - recs = [ - {"a": 1, "b": 2, "c": 3}, - {"a": 4, "b": 5, "c": 6}, - ] + + recs = [{"a": 1, "b": 2, "c": 3}, {"a": 4, "b": 5, "c": 6}] json_normalize(recs)