-
Notifications
You must be signed in to change notification settings - Fork 201
6.x Changelog
Robsdedude edited this page Jul 21, 2025
·
1 revision
⭐️ New Features
- Introduce Bolt 6.0 support with vector types (#1214).
- Chain failure causes on routing table fetching failure (#1219).
When a routing driver (neo4j[+s[sc]]
URL scheme), fails to fetch a routing table, instead of swallowing all errors from the connection and RT fetching attempts that lead up to the failure, the errors are not attached as__cause__
of the raised error. - Introduce helper method
GqlError.find_by_gql_status
(#1216).
🔧️ Fixes
- Fix driver stuck on
RecursionError
onCOMMIT
SUCCESS
(#1192). ⚠️ make unsupported comparisons returnNotImplemented
instead ofFalse
or raising (#1199). This means that when comparing a driver type with another type is doesn't support, the other type gets the chance to handle the comparison.
Affected types:neo4j.Record
-
neo4j.graph.Node
,neo4j.graph.Relationship
,neo4j.graph.Path
-
neo4j.time.Date
,neo4j.time.Time
,neo4j.time.DateTime
-
neo4j.spatial.Point
(and subclasses)
👏️ Improvements
⚠️ Alignconnection_acquisition_timeout
configuration option with other drivers (#1215).
The timeout now spans anything required to acquire a working connection from the pool. This includes potential fetching of routing tables which in itself requires acquiring a connection. Previously, the timeout would be restarted for auxiliary connection acquisitions like those for fetching a routing table.⚠️ Make DNS error retryable (#1211).
Configuring the driver with a URL that cannot be DNS resolved will raise a (retryable)ServiceUnavailable
error instead of aValueError
.- Introduce new sub-logger
neo4j.session
(#1206).
This separates log entries that are session-related (including transaction retries) form sub-loggerneo4j.pool
. ⚠️ No longer implicitly closing drivers and sessions in__del__()
(finalizer/destructor) (#1183).
Make sure to call.close()
on them explicitly or use them in awith
statement.⚠️ Disallow using a closed driver (#1182).- Raise
DriverError
on using the closed driver. - Calling
driver.close()
again is now a no-op.
- Raise
⚠️ Slightly changeNeo4jError
andClientError
(#1179).- Properties
message
andcode
are always astr
(instead ofstr | None
). - Remove possibility to override/set
message
andcode
properties. - Remove undocumented, internal methods
Neo4jError.hydrate
,Neo4jError.invalidates_all_connections
, andNeo4jError.is_fatal_during_discovery
. - Remove deprecated method
Neo4jError.is_retriable
.
UseNeo4jError.is_retryable
instead. - Change string representation of
Neo4jError
to include GQL error information.
- Properties
⚠️ RaiseConfigurationError
instead of ignoring the routing context (URI query parameters) when creating a direct driver ("bolt[+s[sc]]://"
scheme) (#1178).⚠️ Raise newConnectionAcquisitionTimeoutError
(subclass ofDriverError
) instead ofClientError
(subclass ofNeo4jError
) theconnection_acquisition_timeout
is exceeded (#1169).- This improves the differentiation between
DriverError
for client-side errors andNeo4jError
for server-side errors.
- This improves the differentiation between
⚠️ RaiseTypeError
instead ofValueError
when passing aQuery
object toTransaction.run
(#1171).⚠️ RaiseTransactionError
(subclass ofDriverError
) instead ofClientError
(subclass ofNeo4jError
) when callingsession.run()
while an explicit transaction is active on that session (#1170).- This improves the differentiation between
DriverError
for client-side errors andNeo4jError
for server-side errors. - It is now the same error raised as when trying to start an explicit transaction while another explicit transaction is already active.
- This improves the differentiation between
⚠️ Improve validation ofconnection_acquisition_timeout
configuration option (#1168).- Raise
ValueError
on invalid values (instead ofClientError
). - Consistently restrict the value to be strictly positive.
- Raise
⚠️ Raiseneo4j.exceptions.UnsupportedServerProduct
if no common bolt protocol version could be negotiated with the server (instead of internalneo4j._exceptions.BoltHandshakeError
) (#1164, #1224).
UnsupportedServerProduct
is now a subclass ofConfigurationError
(instead ofException
directly).⚠️ Improve validation ofaccess_mode
configuration option (#1166).-
ValueError
on invalid value (instead ofClientError
). - Consistently check the value (also for non-routing drivers).
-
⚠️ RaiseConfigurationError
if the passedauth
parameters is not valid (instead ofAuthError
) (#1162).- This improves the differentiation between
DriverError
for client-side errors andNeo4jError
for server-side errors.
- This improves the differentiation between
📚️ Docs
- Document that
is_retryable
is not applicable to auto-commit transactions (#1217). - Fix formatting, wording, and minor updates for 6.0 (#1200).
🌳️ Maturing
- Stabilize GQL status objects (use these instead of notifications) (#1209).
Affected APIs:ResultSummary.gql_status_objects
neo4j.GqlStatusObject
- (
neo4j.exceptions.GqlError
,neo4j.exceptions.GqlErrorClassification
)
- Stabilize driver debug mode (#1205).
-
warn_notification_severity
config option - concurrency checker
-
🧹️ Clean-up
⚠️ Bump minimum supported Python version to 3.10 (#1153).- Drop support for Python 3.7 (end of life 2023-06-27)
- Drop support for Python 3.8 (end of life 2024-10-07)
- Drop support for Python 3.9 (end of life scheduled for 2025-10).
⚠️ Remove deprecatedBookmark
in favor orBookmarks
(#1175, #1196).- Remove deprecated class
neo4j.Bookmark
in favor ofneo4j.Bookmarks
. - Remove deprecated method
session.last_bookmark()
in favor oflast_bookmarks()
. - Deprecate passing raw sting bookmarks as
initial_bookmarks
toGraphDatabase.bookmark_manager()
.
Use aneo4j.Bookmarks
object instead. -
Driver.session()
no longer accepts raw string bookmarks asbookmarks
argument.
Use aneo4j.Bookmarks
object instead.
- Remove deprecated class
⚠️ Remove deprecatedServerInfo.connection_id
(#1193).
There is no replacement as this is considered internal information.⚠️ Make undocumented internal constants, helper functions, and other items private.-
neo4j.api
(#1176, #1186).DRIVER_BOLT
DRIVER_NEO4J
SECURITY_TYPE_NOT_SECURE
SECURITY_TYPE_SECURE
SECURITY_TYPE_SELF_SIGNED_CERTIFICATE
check_access_mode
parse_neo4j_uri
parse_routing_context
-
neo4j.exceptions
(#1176, #1195).CLASSIFICATION_CLIENT
CLASSIFICATION_DATABASE
CLASSIFICATION_TRANSIENT
ERROR_REWRITE_MAP
client_errors
transient_errors
- all other indirectly exposed items from imports (e.g.
typing
asneo4j.exceptions.t
)
-
neo4j.time
(#1191).DATE_ISO_PATTERN
TIME_ISO_PATTERN
DURATION_ISO_PATTERN
NANO_SECONDS
AVERAGE_SECONDS_IN_MONTH
AVERAGE_SECONDS_IN_DAY
FORMAT_F_REPLACE
IS_LEAP_YEAR
DAYS_IN_YEAR
DAYS_IN_MONTH
round_half_to_even
symmetric_divmod
DateTimeType
DateType
TimeType
- all other indirectly exposed items from imports (e.g.
re
asneo4j.time.re
)
-
neo4j.spatial
(#1188).hydrate_point
dehydrate_point
point_type
-
neo4j.GraphDatabase
(#1181)..bolt_driver
.neo4j_driver
-
neo4j.BoltDriver
andneo4j.Neo4jDriver
(#1181)..open
.parse_target
.default_host
.default_port
.default_target
-
neo4j.graph
,neo4j.addressing
,neo4j.api
(#1195).- indirectly exposed items from imports (e.g.
collections.abc.Mapping
asneo4j.graph.Mapping
).
- indirectly exposed items from imports (e.g.
-
BoltDriver
andNeo4jDriver
()..open
.parse_target
.default_host
.default_port
.default_target
-
neo4j.debug
(#1194).ColourFormatter
TaskIdFilter
- all other indirectly exposed items from imports (e.g.
asyncio
asneo4j.debug.asyncio
)
-
⚠️ Remove deprecated option to indexEntitySetView
byint
id (#1187).
Graph type sets (neo4j.graph.EntitySetView
) can no longer by indexed by legacyid
(int
, e.g.,graph.nodes[0]
). Use theelement_id
instead (str
, e.g.,graph.nodes["..."]
).⚠️ MakeSummary.summary_notifications
atuple
instead of alist
and type it withSequence
to signify that it should be treated as immutable (#1185).⚠️ Remove deprecatedsession.read_transaction
andsession.write_transaction
(#1184).
Instead, usesession.execute_read
andsession.execute_write
respectively.⚠️ Deprecate notifications (use GQL status objects instead) (#1209).
Deprecated APIs:ResultSummary.notifications
ResultSummary.summary_notifications
neo4j.SummaryNotification
neo4j.NotificationCategory
neo4j.NotificationDisabledCategory
⚠️ Remove deprecated driver configuration optiontrust
(#1177).
Usetrusted_certificates
instead.- Remove the associated constants
neo4j.TRUST_ALL_CERTIFICATES
andneo4j.TRUST_SYSTEM_CA_SIGNED_CERTIFICATES
.
- Remove the associated constants
⚠️ ReworkPreviewWarning
(#1173).- Remove
ExperimentalWarning
and turn the few left instances of it intoPreviewWarning
. - Deprecate importing
PreviewWarning
fromneo4j
.
Import it fromneo4j.warnings
instead.
- Remove
⚠️ Make undocumented classesResolvedAddress
,ResolvedIPv4Address
, andResolvedIPv6Address
private (#1174).⚠️ Remove deprecatedRecord.__getslice__
. This magic method has been removed in Python 3.0 (#1172).
If you were calling it directly, please useRecord.__getitem__(slice(...))
or simplyrecord[...]
instead.⚠️ ServerInfo.protocol_version
now is atuple[int, int]
insteadof aapi.Version
(#1164).- This should be drop-in replacement is most cases:
-
Version
was a sup-type oftuple[int, int]
. -
ServerInfo.protocol_version
was already documented and typed astuple[int, int]
. -
Version
's additional methods were undocumented and shouldn't have been used.
-
-
api.Version
has been removed as it's unused now.
- This should be drop-in replacement is most cases:
⚠️ Remove deprecated exports fromneo4j
(#1160).-
log
,Config
,PoolConfig
,SessionConfig
,WorkspaceConfig
(internal - no replacement). -
SummaryNotificationPosition
(useSummaryInputPosition
instead).
-
⚠️ Remove deprecated modules (#1159):neo4j.conf
neo4j.data
neo4j.meta
neo4j.packstream
neo4j.routing
neo4j.time.arithmetic
neo4j.time.clock_implementation
neo4j.time.hydration
neo4j.time.metaclasses
neo4j.work
neo4j.work.query
neo4j.work.summary
⚠️ DeprecateClockTime
and its accessors (#1191).- For each
neo4j.time.Date
,neo4j.time.DateTime
,neo4j.time.Time
-
from_clock_time
andto_clock_time
methods
-
-
neo4j.time.ClockTime
itself.
- For each
- Lift server agent string restrictions (#1208).
📦️ Packaging
⚠️ Remove deprecated package aliasneo4j-driver
(#1161).
Usepip install neo4j
instead.⚠️ Removesetup.py
.
Please use a recent enough packaging/build tool that supportspyproject.toml
(#1161).- PEP 639 style licensing metadata (#1207).
🧑️💻️ Development