Skip to content

Commit f896f59

Browse files
committed
Remove deprecated exports from neo4j
1 parent 9d1efce commit f896f59

File tree

2 files changed

+4
-39
lines changed

2 files changed

+4
-39
lines changed

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
See also https://github.com/neo4j/neo4j-python-driver/wiki for a full changelog.
44

55
## NEXT RELEASE
6-
- No breaking or major changes.
6+
- Remove deprecated exports from `neo4j`:
7+
- `log`, `Config`, `PoolConfig`, `SessionConfig`, `WorkspaceConfig` (internal - no replacement)
8+
- `SummaryNotificationPosition` (use `SummaryInputPosition` instead)
79

810

911
## Version 5.28

src/neo4j/__init__.py

Lines changed: 1 addition & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515

1616

1717
import typing as _t
18-
from logging import getLogger as _getLogger
1918

2019
from ._api import ( # noqa: F401 dynamic attributes
2120
NotificationCategory,
@@ -37,13 +36,10 @@
3736
AsyncSession,
3837
AsyncTransaction,
3938
)
40-
from ._conf import ( # noqa: F401 dynamic attribute
41-
Config as _Config,
42-
SessionConfig as _SessionConfig,
39+
from ._conf import (
4340
TrustAll,
4441
TrustCustomCAs,
4542
TrustSystemCAs,
46-
WorkspaceConfig as _WorkspaceConfig,
4743
)
4844
from ._data import Record
4945
from ._meta import (
@@ -55,9 +51,6 @@
5551
PreviewWarning,
5652
version as __version__,
5753
)
58-
from ._sync.config import ( # noqa: F401 dynamic attribute
59-
PoolConfig as _PoolConfig,
60-
)
6154
from ._sync.driver import (
6255
BoltDriver,
6356
Driver,
@@ -88,7 +81,6 @@
8881
from ._work import (
8982
GqlStatusObject, # noqa: TCH004 false positive (dynamic attribute)
9083
NotificationClassification, # noqa: TCH004 false positive (dynamic attribute)
91-
SummaryInputPosition as SummaryNotificationPosition, # noqa: TCH004 false positive (dynamic attribute)
9284
)
9385

9486
from .addressing import (
@@ -139,7 +131,6 @@
139131
"BoltDriver",
140132
"Bookmark",
141133
"Bookmarks",
142-
"Config", # noqa: F822 dynamic attribute
143134
"Driver",
144135
"EagerResult",
145136
"ExperimentalWarning",
@@ -155,7 +146,6 @@
155146
"NotificationDisabledClassification",
156147
"NotificationMinimumSeverity",
157148
"NotificationSeverity",
158-
"PoolConfig", # noqa: F822 dynamic attribute
159149
"PreviewWarning",
160150
"Query",
161151
"Record",
@@ -164,53 +154,26 @@
164154
"RoutingControl",
165155
"ServerInfo",
166156
"Session",
167-
"SessionConfig", # noqa: F822 dynamic attribute
168157
"SummaryCounters",
169158
"SummaryInputPosition",
170159
"SummaryNotification",
171-
"SummaryNotificationPosition",
172160
"Transaction",
173161
"TrustAll",
174162
"TrustCustomCAs",
175163
"TrustSystemCAs",
176164
"Version",
177-
"WorkspaceConfig", # noqa: F822 dynamic attribute
178165
"__version__",
179166
"basic_auth",
180167
"bearer_auth",
181168
"custom_auth",
182169
"get_user_agent",
183170
"kerberos_auth",
184-
"log", # noqa: F822 dynamic attribute
185171
"unit_of_work",
186172
]
187173

188174

189-
_log = _getLogger("neo4j")
190-
191-
192175
def __getattr__(name) -> _t.Any:
193176
# TODO: 6.0 - remove this
194-
if name in {
195-
"log",
196-
"Config",
197-
"PoolConfig",
198-
"SessionConfig",
199-
"WorkspaceConfig",
200-
}:
201-
_deprecation_warn(
202-
f"Importing {name} from neo4j is deprecated without replacement. "
203-
"It's internal and will be removed in a future version.",
204-
stack_level=2,
205-
)
206-
return globals()[f"_{name}"]
207-
if name == "SummaryNotificationPosition":
208-
_deprecation_warn(
209-
"SummaryNotificationPosition is deprecated. "
210-
"Use SummaryInputPosition instead.",
211-
stack_level=2,
212-
)
213-
return SummaryInputPosition
214177
if name in {
215178
"NotificationClassification",
216179
"GqlStatusObject",

0 commit comments

Comments
 (0)