Skip to content

Commit

Permalink
Remove experimental marking of Result.to_df (#787)
Browse files Browse the repository at this point in the history
  • Loading branch information
robsdedude authored Aug 31, 2022
1 parent b273101 commit 608489d
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 34 deletions.
8 changes: 0 additions & 8 deletions neo4j/_async/work/result.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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]

Expand Down
8 changes: 0 additions & 8 deletions neo4j/_sync/work/result.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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]

Expand Down
15 changes: 6 additions & 9 deletions tests/unit/async_/work/test_result.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)

Expand Down
15 changes: 6 additions & 9 deletions tests/unit/sync/work/test_result.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit 608489d

Please sign in to comment.