Skip to content

Remove experimental marking of Result.to_df #787

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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