Skip to content

Commit c299ff5

Browse files
authored
Remove deprecated ServerInfo.connection_id. (#1193)
There is no replacement as this is considered internal information.
1 parent 410f0bf commit c299ff5

File tree

4 files changed

+5
-27
lines changed

4 files changed

+5
-27
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ See also https://github.com/neo4j/neo4j-python-driver/wiki for a full changelog.
6464
If you were calling it directly, please use `Record.__getitem__(slice(...))` or simply `record[...]` instead.
6565
- Remove deprecated class `neo4j.Bookmark` in favor of `neo4j.Bookmarks`.
6666
- Remove deprecated class `session.last_bookmark()` in favor of `last_bookmarks()`.
67+
- Remove deprecated `ServerInfo.connection_id`.
68+
There is no replacement as this is considered internal information.
6769
- Remove deprecated driver configuration option `trust`.
6870
Use `trusted_certificates` instead.
6971
- Remove the associated constants `neo4j.TRUST_ALL_CERTIFICATES` and `neo4j.TRUST_SYSTEM_CA_SIGNED_CERTIFICATES`.

src/neo4j/api.py

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,10 @@
2424

2525
if t.TYPE_CHECKING:
2626
import typing_extensions as te
27-
from typing_extensions import (
28-
deprecated,
29-
Protocol as _Protocol,
30-
)
27+
from typing_extensions import Protocol as _Protocol
3128

3229
from ._addressing import Address
3330
else:
34-
from ._warnings import deprecated
35-
3631
_Protocol = object
3732

3833

@@ -311,15 +306,6 @@ def agent(self) -> str:
311306
"""Server agent string by which the remote server identifies itself."""
312307
return str(self._metadata.get("server"))
313308

314-
@property # type: ignore
315-
@deprecated(
316-
"The connection id is considered internal information "
317-
"and will no longer be exposed in future versions."
318-
)
319-
def connection_id(self):
320-
"""Unique identifier for the remote server connection."""
321-
return self._metadata.get("connection_id")
322-
323309
def update(self, metadata: dict) -> None:
324310
"""
325311
Update server information with extra metadata.

tests/integration/test_bolt_driver.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,3 @@ def server_info(driver):
3030
with driver.session() as session:
3131
summary = session.run("RETURN 1").consume()
3232
yield summary.server
33-
34-
35-
# TODO: 6.0 -
36-
# This test will stay as python is currently the only driver exposing
37-
# the connection id. This will be removed in 6.0
38-
def test_server_connection_id(driver):
39-
server_info = driver.get_server_info()
40-
with pytest.warns(DeprecationWarning):
41-
cid = server_info.connection_id
42-
assert cid.startswith("bolt-") and cid[5:].isdigit()

tests/unit/common/test_api.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,8 @@ def test_serverinfo_initialization() -> None:
137137
server_info = neo4j.ServerInfo(address, version)
138138
assert server_info.address is address
139139
assert server_info.protocol_version is version
140-
with pytest.warns(DeprecationWarning):
141-
assert server_info.connection_id is None
140+
with pytest.raises(AttributeError):
141+
_ = server_info.connection_id # type: ignore # expected to fail
142142

143143

144144
@pytest.mark.parametrize(

0 commit comments

Comments
 (0)