From e0f52c31ccca2c1741b3393491b04a9e74c647a6 Mon Sep 17 00:00:00 2001 From: Rouven Bauer Date: Wed, 31 Aug 2022 12:13:41 +0200 Subject: [PATCH] Remove experimental marking of `Result.to_df` --- neo4j/_async/work/result.py | 8 -------- neo4j/_sync/work/result.py | 8 -------- tests/unit/async_/work/test_result.py | 15 ++++++--------- tests/unit/sync/work/test_result.py | 15 ++++++--------- 4 files changed, 12 insertions(+), 34 deletions(-) diff --git a/neo4j/_async/work/result.py b/neo4j/_async/work/result.py index b469bd25d..ffe901fee 100644 --- a/neo4j/_async/work/result.py +++ b/neo4j/_async/work/result.py @@ -509,8 +509,6 @@ async def graph(self) -> Graph: in the result. After calling this method, the result becomes detached, buffering all remaining records. - **This is experimental.** (See :ref:`filter-warnings-ref`) - :raises ResultConsumedError: if the transaction from which this result was obtained has been closed or the Result has been explicitly consumed. @@ -583,8 +581,6 @@ async def data(self, *keys: _T_ResultKey) -> t.List[t.Any]: """ return [record.data(*keys) async for record in self] - @experimental("pandas support is experimental and might be changed or " - "removed in future versions") async def to_df( self, expand: bool = False, @@ -674,10 +670,6 @@ async def to_df( :raises ResultConsumedError: if the transaction from which this result was obtained has been closed or the Result has been explicitly consumed. - - **This is experimental.** - ``pandas`` support might be changed or removed in future versions - without warning. (See :ref:`filter-warnings-ref`) """ import pandas as pd # type: ignore[import] diff --git a/neo4j/_sync/work/result.py b/neo4j/_sync/work/result.py index e86305caa..de7a7deb5 100644 --- a/neo4j/_sync/work/result.py +++ b/neo4j/_sync/work/result.py @@ -509,8 +509,6 @@ def graph(self) -> Graph: in the result. After calling this method, the result becomes detached, buffering all remaining records. - **This is experimental.** (See :ref:`filter-warnings-ref`) - :raises ResultConsumedError: if the transaction from which this result was obtained has been closed or the Result has been explicitly consumed. @@ -583,8 +581,6 @@ def data(self, *keys: _T_ResultKey) -> t.List[t.Any]: """ return [record.data(*keys) for record in self] - @experimental("pandas support is experimental and might be changed or " - "removed in future versions") def to_df( self, expand: bool = False, @@ -674,10 +670,6 @@ def to_df( :raises ResultConsumedError: if the transaction from which this result was obtained has been closed or the Result has been explicitly consumed. - - **This is experimental.** - ``pandas`` support might be changed or removed in future versions - without warning. (See :ref:`filter-warnings-ref`) """ import pandas as pd # type: ignore[import] diff --git a/tests/unit/async_/work/test_result.py b/tests/unit/async_/work/test_result.py index 178b0cc63..4c46e3c12 100644 --- a/tests/unit/async_/work/test_result.py +++ b/tests/unit/async_/work/test_result.py @@ -725,11 +725,10 @@ async def test_to_df(keys, values, types, instances, test_default_expand): connection = AsyncConnectionStub(records=Records(keys, values)) result = AsyncResult(connection, 1, noop, noop) await result._run("CYPHER", {}, None, None, "r", None) - with pytest.warns(ExperimentalWarning, match="pandas"): - if test_default_expand: - df = await result.to_df() - else: - df = await result.to_df(expand=False) + if test_default_expand: + df = await result.to_df() + else: + df = await result.to_df(expand=False) assert isinstance(df, pd.DataFrame) assert df.keys().to_list() == keys @@ -883,8 +882,7 @@ async def test_to_df_expand(keys, values, expected_columns, expected_rows, connection = AsyncConnectionStub(records=Records(keys, values)) result = AsyncResult(connection, 1, noop, noop) await result._run("CYPHER", {}, None, None, "r", None) - with pytest.warns(ExperimentalWarning, match="pandas"): - df = await result.to_df(expand=True) + df = await result.to_df(expand=True) assert isinstance(df, pd.DataFrame) assert len(set(expected_columns)) == len(expected_columns) @@ -1083,8 +1081,7 @@ async def test_to_df_parse_dates(keys, values, expected_df, expand): connection = AsyncConnectionStub(records=Records(keys, values)) result = AsyncResult(connection, 1, noop, noop) await result._run("CYPHER", {}, None, None, "r", None) - with pytest.warns(ExperimentalWarning, match="pandas"): - df = await result.to_df(expand=expand, parse_dates=True) + df = await result.to_df(expand=expand, parse_dates=True) pd.testing.assert_frame_equal(df, expected_df) diff --git a/tests/unit/sync/work/test_result.py b/tests/unit/sync/work/test_result.py index cc8434e7e..cc65a17c2 100644 --- a/tests/unit/sync/work/test_result.py +++ b/tests/unit/sync/work/test_result.py @@ -725,11 +725,10 @@ def test_to_df(keys, values, types, instances, test_default_expand): connection = ConnectionStub(records=Records(keys, values)) result = Result(connection, 1, noop, noop) result._run("CYPHER", {}, None, None, "r", None) - with pytest.warns(ExperimentalWarning, match="pandas"): - if test_default_expand: - df = result.to_df() - else: - df = result.to_df(expand=False) + if test_default_expand: + df = result.to_df() + else: + df = result.to_df(expand=False) assert isinstance(df, pd.DataFrame) assert df.keys().to_list() == keys @@ -883,8 +882,7 @@ def test_to_df_expand(keys, values, expected_columns, expected_rows, connection = ConnectionStub(records=Records(keys, values)) result = Result(connection, 1, noop, noop) result._run("CYPHER", {}, None, None, "r", None) - with pytest.warns(ExperimentalWarning, match="pandas"): - df = result.to_df(expand=True) + df = result.to_df(expand=True) assert isinstance(df, pd.DataFrame) assert len(set(expected_columns)) == len(expected_columns) @@ -1083,8 +1081,7 @@ def test_to_df_parse_dates(keys, values, expected_df, expand): connection = ConnectionStub(records=Records(keys, values)) result = Result(connection, 1, noop, noop) result._run("CYPHER", {}, None, None, "r", None) - with pytest.warns(ExperimentalWarning, match="pandas"): - df = result.to_df(expand=expand, parse_dates=True) + df = result.to_df(expand=expand, parse_dates=True) pd.testing.assert_frame_equal(df, expected_df)