Skip to content

Commit d04b80a

Browse files
authored
Remove experimental marking of the async driver (#783)
1 parent 12c65ad commit d04b80a

File tree

11 files changed

+17
-80
lines changed

11 files changed

+17
-80
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
Remark: It's recommended to import everything needed directly from `noe4j` if
1010
available, not its submodules or subpackages.
1111
- Experimental pipelines feature has been removed.
12-
- Experimental async driver has been added.
12+
- Async driver (i.e., support for asyncio) has been added.
1313
- `ResultSummary.server.version_info` has been removed.
1414
Use `ResultSummary.server.agent`, `ResultSummary.server.protocol_version`,
1515
or call the `dbms.components` procedure instead.

docs/source/async_api.rst

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,6 @@
44
Async API Documentation
55
#######################
66

7-
.. warning::
8-
The whole async API is currently in experimental phase.
9-
10-
This means everything documented on this page might be removed or change
11-
its API at any time (including in patch releases).
12-
13-
(See :ref:`filter-warnings-ref`)
14-
157
.. versionadded:: 5.0
168

179
.. warning::

neo4j/_async/driver.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,6 @@ def driver(
110110
else:
111111

112112
@classmethod
113-
@AsyncUtil.experimental_async(
114-
"neo4j async is in experimental phase. It might be removed or "
115-
"changed at any time (including patch releases)."
116-
)
117113
def driver(cls, uri, *, auth=None, **config) -> AsyncDriver:
118114
"""Create a driver.
119115

neo4j/_async_compat/util.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,6 @@ async def callback(cb, *args, **kwargs):
5151
return await res
5252
return res
5353

54-
experimental_async = experimental
55-
5654
@staticmethod
5755
def shielded(coro_function):
5856
assert asyncio.iscoroutinefunction(coro_function)
@@ -76,12 +74,6 @@ def callback(cb, *args, **kwargs):
7674
if callable(cb):
7775
return cb(*args, **kwargs)
7876

79-
@staticmethod
80-
def experimental_async(message):
81-
def f_(f):
82-
return f
83-
return f_
84-
8577
@staticmethod
8678
def shielded(coro_function):
8779
return coro_function

neo4j/_sync/driver.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,6 @@ def driver(
110110
else:
111111

112112
@classmethod
113-
@Util.experimental_async(
114-
"neo4j is in experimental phase. It might be removed or "
115-
"changed at any time (including patch releases)."
116-
)
117113
def driver(cls, uri, *, auth=None, **config) -> Driver:
118114
"""Create a driver.
119115

tests/conftest.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -94,28 +94,25 @@ def neo4j_driver(neo4j_uri, auth):
9494

9595

9696
@wraps(AsyncGraphDatabase.driver)
97-
def get_async_driver_no_warning(*args, **kwargs):
98-
# with warnings.catch_warnings():
99-
# warnings.filterwarnings("ignore", "neo4j async", ExperimentalWarning)
100-
with pytest.warns(ExperimentalWarning, match="neo4j async"):
101-
return AsyncGraphDatabase.driver(*args, **kwargs)
97+
def get_async_driver(*args, **kwargs):
98+
return AsyncGraphDatabase.driver(*args, **kwargs)
10299

103100

104101
@pytest_asyncio.fixture
105102
async def async_driver(uri, auth):
106-
async with get_async_driver_no_warning(uri, auth=auth) as driver:
103+
async with get_async_driver(uri, auth=auth) as driver:
107104
yield driver
108105

109106

110107
@pytest_asyncio.fixture
111108
async def async_bolt_driver(bolt_uri, auth):
112-
async with get_async_driver_no_warning(bolt_uri, auth=auth) as driver:
109+
async with get_async_driver(bolt_uri, auth=auth) as driver:
113110
yield driver
114111

115112

116113
@pytest_asyncio.fixture
117114
async def async_neo4j_driver(neo4j_uri, auth):
118-
async with get_async_driver_no_warning(neo4j_uri, auth=auth) as driver:
115+
async with get_async_driver(neo4j_uri, auth=auth) as driver:
119116
yield driver
120117

121118

tests/integration/async_/test_custom_ssl_context.py

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,8 @@
2121
import pytest
2222

2323
import neo4j
24-
from neo4j._async_compat.util import AsyncUtil
2524

2625
from ..._async_compat import mark_async_test
27-
from ...conftest import get_async_driver_no_warning
2826

2927

3028
@mark_async_test
@@ -42,15 +40,9 @@ def wrap_fail(*_, **__):
4240
fake_ssl_context.wrap_socket.side_effect = wrap_fail
4341
fake_ssl_context.wrap_bio.side_effect = wrap_fail
4442

45-
if AsyncUtil.is_async_code:
46-
driver = get_async_driver_no_warning(
47-
uri, auth=auth, ssl_context=fake_ssl_context
48-
)
49-
else:
50-
driver = neo4j.GraphDatabase.driver(
51-
uri, auth=auth, ssl_context=fake_ssl_context
52-
)
53-
async with driver:
43+
async with neo4j.AsyncGraphDatabase.driver(
44+
uri, auth=auth, ssl_context=fake_ssl_context
45+
) as driver:
5446
async with driver.session() as session:
5547
with pytest.raises(NoNeedToGoFurtherException):
5648
await session.run("RETURN 1")

tests/integration/mixed/test_async_cancellation.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
from neo4j import exceptions as neo4j_exceptions
2727

2828
from ..._async_compat import mark_async_test
29-
from ...conftest import get_async_driver_no_warning
29+
from ...conftest import get_async_driver
3030

3131

3232
def _get_work():
@@ -118,7 +118,7 @@ async def _do_the_read(session_, i=1):
118118
async def test_async_cancellation(
119119
uri, auth, mocker, read_func, waits, cancel_count, i
120120
):
121-
async with get_async_driver_no_warning(
121+
async with get_async_driver(
122122
uri, auth=auth, connection_acquisition_timeout=10
123123
) as driver:
124124
async with driver.session() as session:
@@ -181,7 +181,7 @@ async def test_async_cancellation(
181181

182182
@mark_async_test
183183
async def test_async_cancellation_does_not_leak(uri, auth):
184-
async with get_async_driver_no_warning(
184+
async with get_async_driver(
185185
uri, auth=auth,
186186
connection_acquisition_timeout=10,
187187
# driver needs to cope with a single connection in the pool!

tests/integration/sync/test_custom_ssl_context.py

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,8 @@
2121
import pytest
2222

2323
import neo4j
24-
from neo4j._async_compat.util import Util
2524

2625
from ..._async_compat import mark_sync_test
27-
from ...conftest import get_async_driver_no_warning
2826

2927

3028
@mark_sync_test
@@ -42,15 +40,9 @@ def wrap_fail(*_, **__):
4240
fake_ssl_context.wrap_socket.side_effect = wrap_fail
4341
fake_ssl_context.wrap_bio.side_effect = wrap_fail
4442

45-
if Util.is_async_code:
46-
driver = get_async_driver_no_warning(
47-
uri, auth=auth, ssl_context=fake_ssl_context
48-
)
49-
else:
50-
driver = neo4j.GraphDatabase.driver(
51-
uri, auth=auth, ssl_context=fake_ssl_context
52-
)
53-
with driver:
43+
with neo4j.GraphDatabase.driver(
44+
uri, auth=auth, ssl_context=fake_ssl_context
45+
) as driver:
5446
with driver.session() as session:
5547
with pytest.raises(NoNeedToGoFurtherException):
5648
session.run("RETURN 1")

tests/unit/async_/test_driver.py

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -44,17 +44,7 @@
4444

4545
@wraps(AsyncGraphDatabase.driver)
4646
def create_driver(*args, **kwargs):
47-
if AsyncUtil.is_async_code:
48-
with pytest.warns(ExperimentalWarning, match="async") as warnings:
49-
driver = AsyncGraphDatabase.driver(*args, **kwargs)
50-
print(warnings)
51-
return driver
52-
else:
53-
return AsyncGraphDatabase.driver(*args, **kwargs)
54-
55-
56-
def driver(*args, **kwargs):
57-
return AsyncNeo4jDriver(*args, **kwargs)
47+
return AsyncGraphDatabase.driver(*args, **kwargs)
5848

5949

6050
@pytest.mark.parametrize("protocol", ("bolt://", "bolt+s://", "bolt+ssc://"))

0 commit comments

Comments
 (0)