-
Notifications
You must be signed in to change notification settings - Fork 188
5.x Changelog
🔧 Fixes
- Fix type hints of auth token shorthand (#1121).
("<user_name>", "<password>")
tuples must betuple[str, str]
, but were typedtuple[Any, Any]
.
👏 Improvements
- Setting the
TCP_NODELAY
option on TCP sockets were possible to slightly improve network latency (#1122).
📚 Docs
- Restore accidentally deleted word (#1119).
- Mention Rust Extensions in the installation section (#1124).
🌳 Maturing
- Stabilize the mTLS feature from preview (#1118).
⭐ New Features
- Add support for Python 3.13 (#1106).
🔮 New Preview Features
- GQL compliant errors (#1096).
This PR introduces a new base class for Neo4jError and DriverError called GqlError.
For details on the usage, please check the PR description or the API documentation.
We are actively looking for feedback: https://github.com/neo4j/neo4j-python-driver/discussions/1113
🔧 Fixes
- Fix race condition when installing the package concurrently (#1111).
- Fix bugs in
neo4j.time.DateTime
(#1100).- Fix
DateTime
+/-Duration
computation being wildly off by considering the days of theDateTime
since UNIX epoch twice. - Fix
(Async)Result.to_df
not correctly convertingDateTime
s withtzinfo
ifparse_dates=True
is passed. - Fix
DateTime.__ne__
(inequality operator) always falling back toobject.__ne__
(comparison byid
).
- Fix
👏 Improvements
- Improve logging of connection errors (#1109):
- Lower severity of connection errors occurring during connection shut-down as the error will be ignored anyway.
- Unify logging format.
📚 Docs
- API docs: elaborate on
(Async)Result.to_df
parameters (#1098). - Improve API docs on temporal types (#1104):
- Clarify that the driver's temporal types are meant to be used with pytz only.
- Remove outdated remark on issues with
pytz.utc
.
- Fix
(Async)AuthManagers.basic
example showing off out-dated signature ofExpiringAuth
(#1110).
🧹Clean-up
⚠️ Prefix(Async)NonConcurrentMethodChecker
methods with underscore (#1099).
These base classes were introduced in version5.15.0
. All their methods are internal and undocumented and therefore should not be used.
🔧 Fixes
⚠️ Reverting an accidental minor breaking change introduced in 5.22.0 (#1093):
When polyfillingResultSummary.notifications
from new-style GQL compliant statuses (i.e., when connected via Bolt version 5.6+/server version 5.23+) the driver used to setnotifications
to[]
if no notifications are available. However, on older protocol versions this field would beNone
in such case. We unified the behavior to makenotifications
beNone
in both scenarios.
📚 Docs
- API docs: fix examples with incorrect driver creation calls (#1092).
⭐ New Features
- Add notification classification
SCHEMA
(#1086).
👏 Improvements
- Add
__all__
to all public modules to clean-up start imports and to help differentiate names that are meant to be public API (#1075). - Refine TLS certificate handling (#1079)
⚠️ Makeneo4j.auth_management.RotatingClientCertificateProvider
(part of mTLS preview feature) an abstract class.
This means it can no longer be instantiated directly. Please use the factory methodneo4j.auth_management.RotatingClientCertificateProvider.rotating
instead.
Analogously for the async APIs.- Fix missing type hint for the parameter of
TrustCustomCAs.__init__
.
📚 Docs
- Fix broken references in API docs (#1078).
- README: update link to the Rust extensions after the repository has been moved to https://github.com/neo4j/neo4j-python-driver-rust-ext (:crab: #1082).
- Improve API docs around mTLS (#1079).
- Fix wrong parameter names for
driver.execute_query
in docs (trailing underscores were not rendered) (#1087).
🔧 Fixes
- Fix notification polyfill from incomplete GQL status (#1080).
When connected to a server sending GQL compliant statuses, the driver would not show some of that as translated notifications (ResultSummary.summary_notifications
/.notifications
). In particular, statuses without position would not be translated to notifications.
⭐ New Features
- Adding support for Bolt 5.6 which fixes backward compatibility of notification descriptions (#1071).
Bolt 5.5 (with breaking notification description) was never release with any server version, so user will not encounter the altered notification descriptions.
📚 Docs
- Fix API docs formatting (#1068).
🔮 New Preview Features
- Exposing GQL statuses of queries through the
ResultSummary
(#1060).
⚠️ As part of this work,SummaryNotificationPosition
has been deprecated in favor ofSummaryInputPosition
.
For details on the usage, please check the PR description or the API documentation.
We are actively looking for feedback: https://github.com/neo4j/neo4j-python-driver/discussions/1067
👏 Improvements
- Simplify usage of raw bookmarks by making
(Async)Neo4jBookmarkManager
'sinitial_bookmarks
parameter andBookmarks.from_raw_values
'svalues
parameter not interpret a singlestr
as an iterator ofstr
(yielding characters), but automatically wrap it into an iterator yielding only the passed instr
(#1065).
🔮 New Preview Features
- More convenient handling of server-side warnings and notifications (#1059).
The driver can be configured to emit warnings on notifications and/or to log them. For details on the usage, please check the PR description or the API documentation.
We are actively looking for feedback: https://github.com/neo4j/neo4j-python-driver/discussions/1064
📚 Docs
- Fix typos and cross references (#1054).
- Complete version history of stabilized auth manager APIs (#1054).
- Amend preview remark to some mTLS APIs that already emitted a preview warning, but weren't clearly marked as preview in the API docs (#1054).
- Extend details around the static and basic auth provider implementations (#1054).
📦 Packaging
- The package
neo4j
is now also available as pure-Python wheel distribution (#1063).
🔧 Fixes
- Mitigate errors during resource warning on interpreter shutdown (#1037).
👏 Improvements
- Improve performance of
from_ordinal
of temporal types (#1046).
Speeds up the function by about a factor of 100.
🔮 New Preview Features
- Mutual TLS (mTLS) as second authentication factor (2FA) (#1025).
Allows for configuring client side TLS certificates to authenticate against the server.
We are actively looking for feedback: https://github.com/neo4j/neo4j-python-driver/discussions/1031
🔧 Fixes
- Fix metadata, e.g.,
__qualname__
, of internally forwarded methods ofTransaction
andAsyncTransaction
(#1017).
📚 Docs
- Fix broken cross references in the API docs (#1021).
- Advertise Rust extensions in the README for a performance improvement (#1023).
See also https://github.com/neo4j/neo4j-python-driver-rust-ext.
🔧 Fixes
- Fix
from neo4j import *
statement (#1009).
📚 Docs
- Improve API documentation of result streams (#1010).
⭐ New Features
- New driver config option
liveness_check_timeout
(#992). - Enable/fix (deep)copying and pickling support for custom temporal and spatial types (#1002).
Thanks to @Sopalinge for this contribution.
🔧 Fixes
- Fix exporting
Duration
s withResult.data
resulting inTypeError: unsupported operand type(s) for *: 'int' and 'map'
(#1000).
Also: 1000th PR 🎂 - Also cover
Session.last_bookmarks
with the optional concurrency misuse checks introduced in version 5.15.0 (#1004). - Harden the driver against unexpected server responses following
RESET
(#1006).
Under certain circumstances, can the server respond withFAILURE
and evenIGNORED
when the driver attempts toRESET
a failed connection. It's arguable whether it should, but the driver needs to handle to it, let alone to be compatible with older server versions. The driver did not handle this situation gracefully and could even get stuck in an infinite loop. Instead, it will now close such connections and raise the original error the connection failed with.
👏 Improvements
- Implemented a hierarchical logger structure to improve log source identification and traceability (#997).
Thanks to @OliverFarren for this contribution.
Introduced child loggers:-
neo4j.io
: For socket and bolt protocol related logging. -
neo4j.pool
: For logs pertaining to connection pooling and routing. -
neo4j.auth_management
: For logging inside the providedAuthManager
implementations.
-
📚 Docs
- Fix signature of
Driver.execute_query
(#998). - Fix wrong
await
in async API docs (#1003). - Fix wrong minimum required server version for some notification filters (#1007).
⭐ New Features
-
Driver.execute_query
now accepts aQuery
object to specify transaction config like metadata and transaction timeout (#991). - For local development, run your application with
python -X dev ...
or set the environment variablePYTHONNEO4JDEBUG
to anything non-empty to get additional concurrency misuse checks. Some driver primitives (e.g., sessions) are not safe to be used concurrently. By default, using them concurrently will lead to hard to debug errors. This feature helps to identify such code paths. Note that detection is still inherently racy, hence not guaranteed to always work (#989, #995).
🔧 Fixes
- Fix trying to await socket closure on async cancellation during initial connection (#987).
👏 Improvements
- Materialize experimental Rust extensions in bolt-agent and user-agent string (#993).
🧹Clean-up
⚠️ Deprecated passing multiple targets to the undocumented methodGraphDatabase.neo4j_driver
(#986).
🌱 Groundwork
- Prepare the driver to pick up Rust extensions for a better performing PackStream implementation (#979).
This change is 100% transparent and doesn't affect the operation of the driver unless the user takes extra steps to install Rust extensions separately.
⭐ New Features
🔧 Fixes
- Properly propagate errors across results within a transaction (#973).
If any record stream fails, the transaction as a whole, including all other results, cannot be recovered. A new errorResultFailedError
is introduced to signal this condition.
📚 Docs
- Migrated API Docs layout to corporate design (#968).
🌳 Maturing
- Stabilize the re-authentication feature from preview (#977).
⭐ New Features
- Support for bolt protocol 5.4 (#965).
Starting with Bolt 5.4, the driver will, by default, send anonymous API usage statistics to the server if requested. Please see the linked pull request for more details like how to opt-out.
🔧 Fixes
- Fix suppression of warnings inside the driver. This is now concurrency-safe (#961).
⚠️ Usingneo4j.Driver
/neo4j.AsyncDriver
objects after calling.close()
on them, except for calling.close()
again, is deprecated and will throw an Exception in a future version (#962, #964).
📚 Docs
- Improve typing information in the API docs (#963).
- Improve API docs around transaction timeouts (#966, #970).
🌳 Maturing
- The driver configuration option
keep_alive
to control the TCP keep alive option on the sockets is no longer marked experimental (#967).
🔧 Fixes
- Fix potential datarace when handling routing tables (#952).
- Fix pool closing connections too aggressively. In autonomous clustering scenarios where a given database might not be present on all cluster members, the driver could've closed all connections to such members even if they were still useful for other databases (#955).
- Fix driver dropping write servers from the routing table too aggressively (#959).
👏 Improvements
-
driver.execute_query
is now more efficient by saving a round trip (#956). ⚠️ Changes were made to the re-auth feature in preview (#957, 8b35bd86):- Removed
TokenExpiredRetryable
exception.
Even though it wasn't marked preview, it was introduced with and only used for re-auth. It no longer serves any purpose. - The
AuthManager
andAsyncAuthManager
abstract classes were changed.
The methodon_auth_expired(self, auth: _TAuth) -> None
was removed in favor ofhandle_security_exception(self, auth: _TAuth, error: Neo4jError) -> bool
.
See the API docs for more details. - The factories in
AsyncAuthManagers
andAuthManagers
were changed.-
expiration_based
was renamed tobearer
. -
basic
was added to cater for password rotation.
-
- Removed
🔧 Fixes
- Fix handling of sub-ms transaction timeouts (#940).
- Due to the timeout being
float
rounding issues were possible (e.g.,256.4 s
would be turned into256399 ms
). -
0.001 s > timeout > 0
was rounded down to0 ms
which is a special value for no timeout at all. This is very likely not what the user intended.
- Due to the timeout being
- Avoid lazy imports to reduce chances of errors during interpreter shutdown (#942).
- Avoid swallowing errors coming from
asyncio.Lock.acquire
(#944). - Fix
neo4j.debug.watch()
not handling logging levels correctly when being called multiple times (#946).
📚 Docs
- Improve API docs around
ExpiringAuth
(#934). - Remove old migration information, fix and update links, update getting started example to use the new and shorter
driver.execute_query
API introduced in 5.5.0 and stabilized in 5.8.0 (#929). - Small formatting fixed (#938).
- Fix wrongly documented type of
query_
parameter ofdriver.execute_query
(#939).
⭐ New Features
- Support for bolt protocol 5.3 which adds
bolt_agent
metadata so that the server knows which driver is connecting (#910). ⚠️ neo4j.auth_management.ExpiringAuth
used for auth rotation (re-auth, preview feature) now expects an absolute expiration time. A convenience method to create it with a relative expiration time added (#928).
The attributeexpires_in
was replaced byexpires_at
, which now expects a unix timestamp.
You can useExpiringAuth(some_auth).expires_in(123)
instead if you rely on relative expiration.
📚 Docs
- Mention performance impact of notification filtering (#931).
🧹Clean-up
- Align spacing of log message (#926).
🔧 Fixes
- Make
neo4j.auth_management.ExpiringAuth
(in preview) a class instead of a function caused by an incorrect preview decorator (#927).
📚 Docs
- Fix broken formatting and missing parts caused by an incorrect preview decorator (#927).
- Fix broken cross references in the API docs that were missed when renaming experimental APIs in #911 (#927).
⭐ New Features
- Re-authentication (in preview) (#890).
Allows for handling expiring authentication (backward compatible) as well as session scoped authentication (requires neo4j server version 5.5+).
We are actively looking for feedback: https://github.com/neo4j/neo4j-python-driver/discussions/921
👏 Improvements
- Implement serialization of temporal types with python's standard
datetime.timezone
(fixed utc-offset timezones) astzinfo
(#914). - The above change enables
pandas
2 support (#914).
📚 Docs
🌳 Maturing
- Bookmark managers (
BookmarkManager
class,bookmark_manager
config options,Driver.bookmark_manager()
factory method) (#911). -
Driver.execute_query
API with some minor changes (#911):⚠️ Renameneo4j.RoutingControl.WRITERS
toneo4j.RoutingControl.WRITE
and...READERS
to...READ
⚠️ Renamedriver.query_bookmark_manager()
todriver.execute_query_bookmark_manager()
.- The query argument is now typed
LiteralString
instead ofstr
to help mitigate accidental Cypher injections. There are rare use-cases where a computed string is necessary. Please use# type: ignore
, ortyping.cast
to suppress the type checking in those cases (#923).
⭐ New Features
- Notification filtering API (#847).
This introduces two new optionsnotifications_min_severity
andnotifications_disabled_categories
to the driver and session config. Both require neo4j server version 5.7+.
🔧 Fixes
- Fix application protocol (bolt) handshake not having a timeout (#905).
🧹Clean-up
⚠️ Importingneo4j.work
and its submodules has been deprecated. Everything should be imported directly fromneo4j
instead.
📚 Docs
⭐ New Features
- Experimental
Driver.execute_query
API (#833).
We are actively looking for feedback: https://github.com/neo4j/neo4j-python-driver/discussions/896
⭐ New Features
- Supporting more types as query parameters (e.g.,
tuple
, some pandas and numpy types, see also API docs) (#881).
🔧 Fixes
- Fix not handling async cancellation during
Driver.close
properly (#881).
👏 Improvements
- Update custom async synchronization primitives to be based on Python 3.11's implementation. This will, among other things, avoid hard to debug errors later in the program when accidentally creating the driver while no event loop is (see #868) (#879).
- More server errors will be surfaced directly on failed routing discovery. Those used to be masked as
ServiceUnavailable
errors hiding driver misconfiguration as the real cause (#870). Specifically:-
Neo.ClientError.Statement.TypeError
, e.g., when trying to impersonate an integer or any type other thanNone
orstr
. -
Neo.ClientError.Statement.ArgumentError
, e.g., when trying to impersonate without the required permissions. -
Neo.ClientError.Request.Invalid
, e.g., when trying to select an integer database or any type other thanNone
orstr
.
-
📚 Docs
🧹Clean-up
⚠️ Undocumented helper methodsNeo4jError.is_fatal_during_discovery
andNeo4jError.invalidates_all_connections
have been deprecated and will be removed without replacement in version 6.0 (#870).
⭐ New Features
- Add Support for Python 3.11 (#861).
🔧 Fixes
⚠️ The experimentalBookmarkManager
API received a necessary change that simplifies it and makes it work correctly (#859).
It will no longer track bookmarks per database. This effectively changes the signature of almost all bookmark manager related methods:-
neo4j.BookmarkManger
andneo4j.AsyncBookmarkManger
abstract base classes:-
update_bookmarks
has no longer adatabase
argument. -
get_bookmarks
has no longer adatabase
argument. - The
get_all_bookmarks
method was removed. - The
forget
method was removed.
-
-
neo4j.GraphDatabase.bookmark_manager
andneo4j.AsyncGraphDatabase.bookmark_manager
factory methods:-
initial_bookmarks
is no longer a mapping from database name to bookmarks but plain bookmarks. -
bookmarks_supplier
no longer receives the database name as an argument. -
bookmarks_consumer
no longer receives the database name as an argument.
-
-
👏 Improvements
- Modernize packaging to use
pyproject.toml
, fixing deprecation warningDEPRECATION: neo4j is being installed using the legacy 'setup.py install' method[...]
when installed withpip
(#867). - Improve exception context for some exceptions (#860).
- Query strings are now typed
LiteralString
instead ofstr
to help mitigate accidental Cypher injections. There are rare use-cases where a computed string is necessary. Please use# type: ignore
, ortyping.cast
to suppress the type checking in those cases (#861).
🧹Clean-up
⚠️ Deprecated package-aliasneo4j-driver
. It will stop receiving updates starting with6.0.0
. Please installneo4j
instead (#867).- Removed testing code (
testkitbackend
) from distributed package (#855 thanks to @thesamesam, #867).
📚 Docs
- Expand API docs to fully state the implications of not specifying a
database
parameters when creating a session(#865). - Multiple small improvements throughout the API docs (#858).
🔧 Fixes
- Data race in the routing driver that could lead to a
KeyError
(#852). - Package
py.typed
marker file so that mypy and other type checkers consider the type annotations that were added to the driver in5.0
(#856).
👏 Improvements
- Major improvements of the driver's debug logging (#849).
- Implemented
__format__
for temporal types enabling expressions likef"{neo4j.time.Time(12, 34, 56, 789123001):%H:%M:%S.%f}"
(#853). - Made the driver compatible with
mypy
version0.990
(#854).
📚 Docs
🔧 Fixes
- Fix missing rewrite of driver internal error
neo4j._exceptions.SocketDeadlineExceeded: timed out
(#842).
👏 Improvements
- Keyword parameters of
Session.run
andTransaction.run
are no longer restricted by parameters used in driver internal functions further down the stack (#835).
📚 Docs
- Editorial changes (#844, 839).
- Remove documentation of driver configuration options (
session_connection_timeout
andupdate_routing_table_timeout
) that were already removed in5.0.0
(#838). - Clarification of the
timeout
parameter tounit_of_work
(#827). - Clarify precedence of
parameters
and keyword parameters ofSession.run
andTransaction.run
(#835).
🔧 Fixes
- Fix optional dependencies (pandas) in packaging (#808).
- [Python 3.10+] Fix deprecation warnings from using deprecated SSL options (#809).
📚 Docs
- Fixed many mistakes in the docs (API docs and docstrings) (#807 thanks to @112358fn, 30ccd1ca, #815, #818, #819, #821, #821, #822, #823).
🔧 Fixes
- Fix connection pool clogging up when checking if new connections can be created while the pool is full (#804; fixes #796).
The bug was introduced in 5.0.0 with #745. - Fix string representation of
neo4j.exceptions.ClientError
andneo4j.exceptions.Neo4jError
when raised from the driver code (806).
👏 Improvements
- Properly close sockets on async cancellation during
HELLO
handshakes. This resolves aResourceWarning
that otherwise would be emitted when the garbage collection cleans up the socket (#801).
🔧 Fixes
- Fix relying on garbage collector to close sockets under certain failure conditions (#795).
🧹Clean-up
⚠️ Removedignore_bookmark_manager
session config option. It's a leftover from a previous design of the bookmark manager and was introduced in 5.0.0a2 (#792).
This release contains all fixes up until version 4.4.6 plus:
⭐ New Features
- Support for Bolt protocol version
5.0
(#672, #737).⚠️ Deprecated Nodes' and Relationships'id
property (int
) in favor ofelement_id
(str
).
This also affectsGraph
objects as indexinggraph.nodes[...]
andgraph.relationships[...]
with integers has been deprecated in favor of indexing them with strings.- Fixed encoding of
DateTime
s with zone id (#748).
- Added type hints for all public APIs (#767).
- Added
BookmarkManager
support (#771).
This feature makes it easier to achieve causal chaining of sessions. See the API documentation for more details. - New
SSL
config options (#639, #656, #666)⚠️ Thetrust
option has been deprecated.
Usetrusted_certificates
instead. See the API documentation for more details.- New options
trusted_certificates
andssl_context
have been added (see API docs for more details).
-
Result
API-
Result.single
has a new optional argumentstrict
(#646, #673).
Ifstrict
isTrue
and the result set contains not exactly one record, an exception will be raised. - Added
Result.fetch(n)
to fetch up ton
records as a list (#673). -
Result
objects are now iterators (i.e.next(result)
/result.__next__()
is supported) (#647).
result.__anext__()
forAsyncResult
respectively.
-
- Added
Driver.get_server_info()
(#654). - Added
.is_retryable()
toNeo4jError
andDriverError
(#682, #742).
⚠️ Deprecatedneo4j.exceptions.Neo4jError.is_retriable()
in favor ofneo4j.exceptions.Neo4jError.is_retryable()
.
This change helps users to implement custom retry policies together with explicit transactions. - Added
expand
andparse_dates
parameters toResult.to_df()
(Pandas DataFrame export) (#663, #716).
🔧 Fixes
- Allow sending a transaction timeout of
0
(#642).
Previously,0
was interpreted asNone
and thus the server-side default timeout was used. Now,0
denotes an infinite timeout. - Bookmarks (#649)
⚠️ Session.last_bookmark
was deprecated. Its behaviour is partially incorrect and cannot be fixed without breaking its signature.
UseSession.last_bookmarks
instead.-
neo4j.Bookmark
was deprecated.
Useneo4j.Bookmarks
instead.
- Many async fixes:
- Fix custom implementation of
AsyncCondition
(#638). -
asyncio.iscoroutinefunction
wasNone
in destructor (#643). - Add missing
await
inSession.being_transaction
(423e1e5). - Await and fix async socket closure (#701, #705).
- Handle
asyncio.CancelledError
gracefully (#761). - Patch
asyncio.wait_for
to no swallow cancellations (#761).
- Fix custom implementation of
- Fix sync socket close helper method (#777).
⚠️ Removed deprecated parts in theneo4j.time
module (#635).-
Duration
- The constructor does not accept
subseconds
anymore.
Usemilliseconds
,microseconds
, ornanoseconds
instead. - The property
subseconds
has been removed.
Usenanoseconds
instead. - The property
hours_minutes_seconds
has been removed.
Usehours_minutes_seconds_nanoseconds
instead. - For all math operations holds: they are element-wise on
(
months
,days
,nanoseconds
). This affects (i.e., changes) the working of//
,%
,/
, and*
.- Years are equal to 12 months.
- Weeks are equal to 7 days.
-
seconds
,milliseconds
,microseconds
, andnanoseconds
are implicitly converted tonanoseconds
orseconds
as fit.
- Multiplication and division allow for floats but will always result in integer values (round to nearest even).
- The constructor does not accept
-
Time
- The constructor does not accept
float
s forsecond
anymore.
Usenanosecond
instead. - Ticks are now nanoseconds since midnight (
int
).- The property
ticks_ns
has been renamed toticks
.
The oldticks
is no longer supported. - The property
from_ticks_ns
has been renamed tofrom_ticks
.
The oldfrom_ticks
is no longer supported.
- The property
- The property
second
returns anint
instead of afloat
.
Usenanosecond
to get the sub-second information. - The property
hour_minute_second
has been removed.
Usehour_minute_second_nanosecond
instead.
- The constructor does not accept
-
DateTime
- The property
hour_minute_second
has been removed.
Usehour_minute_second_nanosecond
instead. - The property
second
returns anint
instead of afloat
.
Usenanosecond
to get the sub-second information.
- The property
-
👏 Improvements
- Speed up by caching the local port number of connections (#724).
- Raise
ResultConsumedError
when result is out of scope (#652):- Records of Results cannot be accessed (
peek
,single
,iter
, ...) after their owning transaction has been closed, committed, or rolled back.
Previously, this would yield undefined behavior. It now raises aResultConsumedError
. - Records of Results cannot be accessed (
peek
,single
,iter
, ...) after the Result has been consumed (Result.consume()
).
Previously, this would always yield no records. It now raises aResultConsumedError
. - New method
Result.closed()
can be used to check for this condition if necessary.
- Records of Results cannot be accessed (
- Improved output of logging helper
neo4j.debug.watch
(#728, #755).- ANSI colour codes for log output are now opt-in.
- Prepend log format with log-level (if colours are disabled).
- Prepend log format with thread name and id.
- Change the transaction class passed to transaction functions (a.k.a. managed transactions) (#658):
The first argument of transaction functions is now aManagedTransaction
object. It behaves exactly like a regularTransaction
object, except it does not offer thecommit
,rollback
,close
, andclosed
methods.
Those methods would have caused a hard to interpreted error previously. Hence, they have been removed. ⚠️ Certain deserialization errors (e.g., receiving a DateTime with an unsupported time zone) will no longer raise when receiving them but when trying to access them through theRecord
(#759).neo4j.exceptions.BrokenRecordError
has been introduced to indicate this.
🧹Clean-up
⚠️ Removed deprecatedResultSummary.server.version_info
(#636).
UseResultSummary.server.agent
,ResultSummary.server.protocol_version
, or call thedbms.components
procedure instead.⚠️ Deprecate implicit closing of drivers and sessions in__del__
(destructor) (#653). This behaviour is non-deterministic as there is no guarantee that the destructor will ever be called. AResourceWarning
is emitted instead.
Make sure to configure Python to output those warnings when developing your application locally (it does not by default).⚠️ Removed deprecated (since 4.4.6) timeout config options introduced in 4.4.5 (#769).
Server-side keep-alives communicated through configuration hints together withconnection_acquisition_timeout
are sufficient to avoid the driver getting stuck.- Creation of a driver with
bolt[+s[sc]]://
scheme and a routing context has been deprecated and will raise an error in the Future. (#645, 655).
Previously, the routing context was silently ignored. ⚠️ Removed undocumented return value ofDriver.verify_connectivity()
(#654, #743).
UseDriver.get_server_info()
instead.⚠️ Package structure/imports (#748)- Importing submodules from
neo4j.time
(neo4j.time.xyz
) has been deprecated. Everything needed should be imported fromneo4j.time
directly. -
neo4j.spatial.hydrate_point
andneo4j.spatial.dehydrate_point
have been deprecated without replacement. They are internal functions. - Importing
neo4j.packstream
has been deprecated. It's internal and should not be used by client code. - Importing
neo4j.routing
has been deprecated. It's internal and should not be used by client code. - Importing
neo4j.config
has been deprecated. It's internal and should not be used by client code. -
neoj4.Config
,neoj4.PoolConfig
,neoj4.SessionConfig
, andneoj4.WorkspaceConfig
have been deprecated without replacement. They are internal classes. - Importing
neo4j.meta
has been deprecated. It's internal and should not be used by client code.ExperimentalWarning
should be imported directly fromneo4j
.neo4j.meta.version
is exposed throughneo4j.__version__
- Importing
neo4j.data
has been deprecated. It's internal and should not be used by client code.Record
should be imported directly fromneo4j
instead.neo4j.data.DataHydrator
andneo4j.data.DataDeydrator
have been removed without replacement.
- Importing submodules from
🌳 Maturing
- The async driver (
neo4j.AsyncGraphDatabase
) is no longer experimental (#783). -
Result.to_df()
(Pandas DataFrame export) is no longer experimental (#787).
IMPORTANT: this pre-release does not contain any 5.0 features and future pre-releases might have to be API-breaking. This release' sole purpose it to give early access to the async driver.
📚 Note on Documentation
You can find the preliminary API documentation here https://neo4j.com/docs/api/python-driver/5.0/
Note, that the compatible server versions are listed for the stable 5.0.x driver. The 5.0.0a1 driver supports the same server versions as 4.4.x drivers.
⭐ New Features
🧹Clean-up