Skip to content

Commit 608489d

Browse files
authored
Remove experimental marking of Result.to_df (#787)
1 parent b273101 commit 608489d

File tree

4 files changed

+12
-34
lines changed

4 files changed

+12
-34
lines changed

neo4j/_async/work/result.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -509,8 +509,6 @@ async def graph(self) -> Graph:
509509
in the result. After calling this method, the result becomes
510510
detached, buffering all remaining records.
511511
512-
**This is experimental.** (See :ref:`filter-warnings-ref`)
513-
514512
:raises ResultConsumedError: if the transaction from which this result
515513
was obtained has been closed or the Result has been explicitly
516514
consumed.
@@ -583,8 +581,6 @@ async def data(self, *keys: _T_ResultKey) -> t.List[t.Any]:
583581
"""
584582
return [record.data(*keys) async for record in self]
585583

586-
@experimental("pandas support is experimental and might be changed or "
587-
"removed in future versions")
588584
async def to_df(
589585
self,
590586
expand: bool = False,
@@ -674,10 +670,6 @@ async def to_df(
674670
:raises ResultConsumedError: if the transaction from which this result
675671
was obtained has been closed or the Result has been explicitly
676672
consumed.
677-
678-
**This is experimental.**
679-
``pandas`` support might be changed or removed in future versions
680-
without warning. (See :ref:`filter-warnings-ref`)
681673
"""
682674
import pandas as pd # type: ignore[import]
683675

neo4j/_sync/work/result.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -509,8 +509,6 @@ def graph(self) -> Graph:
509509
in the result. After calling this method, the result becomes
510510
detached, buffering all remaining records.
511511
512-
**This is experimental.** (See :ref:`filter-warnings-ref`)
513-
514512
:raises ResultConsumedError: if the transaction from which this result
515513
was obtained has been closed or the Result has been explicitly
516514
consumed.
@@ -583,8 +581,6 @@ def data(self, *keys: _T_ResultKey) -> t.List[t.Any]:
583581
"""
584582
return [record.data(*keys) for record in self]
585583

586-
@experimental("pandas support is experimental and might be changed or "
587-
"removed in future versions")
588584
def to_df(
589585
self,
590586
expand: bool = False,
@@ -674,10 +670,6 @@ def to_df(
674670
:raises ResultConsumedError: if the transaction from which this result
675671
was obtained has been closed or the Result has been explicitly
676672
consumed.
677-
678-
**This is experimental.**
679-
``pandas`` support might be changed or removed in future versions
680-
without warning. (See :ref:`filter-warnings-ref`)
681673
"""
682674
import pandas as pd # type: ignore[import]
683675

tests/unit/async_/work/test_result.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -725,11 +725,10 @@ async def test_to_df(keys, values, types, instances, test_default_expand):
725725
connection = AsyncConnectionStub(records=Records(keys, values))
726726
result = AsyncResult(connection, 1, noop, noop)
727727
await result._run("CYPHER", {}, None, None, "r", None)
728-
with pytest.warns(ExperimentalWarning, match="pandas"):
729-
if test_default_expand:
730-
df = await result.to_df()
731-
else:
732-
df = await result.to_df(expand=False)
728+
if test_default_expand:
729+
df = await result.to_df()
730+
else:
731+
df = await result.to_df(expand=False)
733732

734733
assert isinstance(df, pd.DataFrame)
735734
assert df.keys().to_list() == keys
@@ -883,8 +882,7 @@ async def test_to_df_expand(keys, values, expected_columns, expected_rows,
883882
connection = AsyncConnectionStub(records=Records(keys, values))
884883
result = AsyncResult(connection, 1, noop, noop)
885884
await result._run("CYPHER", {}, None, None, "r", None)
886-
with pytest.warns(ExperimentalWarning, match="pandas"):
887-
df = await result.to_df(expand=True)
885+
df = await result.to_df(expand=True)
888886

889887
assert isinstance(df, pd.DataFrame)
890888
assert len(set(expected_columns)) == len(expected_columns)
@@ -1083,8 +1081,7 @@ async def test_to_df_parse_dates(keys, values, expected_df, expand):
10831081
connection = AsyncConnectionStub(records=Records(keys, values))
10841082
result = AsyncResult(connection, 1, noop, noop)
10851083
await result._run("CYPHER", {}, None, None, "r", None)
1086-
with pytest.warns(ExperimentalWarning, match="pandas"):
1087-
df = await result.to_df(expand=expand, parse_dates=True)
1084+
df = await result.to_df(expand=expand, parse_dates=True)
10881085

10891086
pd.testing.assert_frame_equal(df, expected_df)
10901087

tests/unit/sync/work/test_result.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -725,11 +725,10 @@ def test_to_df(keys, values, types, instances, test_default_expand):
725725
connection = ConnectionStub(records=Records(keys, values))
726726
result = Result(connection, 1, noop, noop)
727727
result._run("CYPHER", {}, None, None, "r", None)
728-
with pytest.warns(ExperimentalWarning, match="pandas"):
729-
if test_default_expand:
730-
df = result.to_df()
731-
else:
732-
df = result.to_df(expand=False)
728+
if test_default_expand:
729+
df = result.to_df()
730+
else:
731+
df = result.to_df(expand=False)
733732

734733
assert isinstance(df, pd.DataFrame)
735734
assert df.keys().to_list() == keys
@@ -883,8 +882,7 @@ def test_to_df_expand(keys, values, expected_columns, expected_rows,
883882
connection = ConnectionStub(records=Records(keys, values))
884883
result = Result(connection, 1, noop, noop)
885884
result._run("CYPHER", {}, None, None, "r", None)
886-
with pytest.warns(ExperimentalWarning, match="pandas"):
887-
df = result.to_df(expand=True)
885+
df = result.to_df(expand=True)
888886

889887
assert isinstance(df, pd.DataFrame)
890888
assert len(set(expected_columns)) == len(expected_columns)
@@ -1083,8 +1081,7 @@ def test_to_df_parse_dates(keys, values, expected_df, expand):
10831081
connection = ConnectionStub(records=Records(keys, values))
10841082
result = Result(connection, 1, noop, noop)
10851083
result._run("CYPHER", {}, None, None, "r", None)
1086-
with pytest.warns(ExperimentalWarning, match="pandas"):
1087-
df = result.to_df(expand=expand, parse_dates=True)
1084+
df = result.to_df(expand=expand, parse_dates=True)
10881085

10891086
pd.testing.assert_frame_equal(df, expected_df)
10901087

0 commit comments

Comments
 (0)