- 
                Notifications
    You must be signed in to change notification settings 
- Fork 203
5.x Changelog
🔧 Fixes
- Fix driver stuck on RecursionErroronCOMMITSUCCESS(#1202).
- Fix re-authentication interfering with connectivity checks (#1144).
📚️ Docs
- Document that is_retryableis not applicable to auto-commit transactions (#1218).
- Add note on Driver.closenot being concurrency-safe (#1147).
- Minor fixes: add more links and versions changed/added remarks (#1146).
🔧 Fixes
- Fix an UnboundLocalErrorduring the protocol handshake if the effective log level of the logger"neo4j.io"is< 10(strictly less thanlogging.DEBUG) (#1141).
📚 Docs
- Update documentation of supported servers/protocol versions (#1142).
⭐ New Features
- Support for Bolt 5.8 (#1115).
 This includes an optimization where the driver uses a home/default database cache to perform optimistic routing under certain circumstances, saving a full round trip. See the PR description for more details.
- Support for the new Bolt version handshake manifest v1 (#1102).
 ⚠️ Dropping (undocumented) support for Bolt 4.1.
🔧 Fixes
- Fix pickle and deepcopy of graph types under neo4j.graph(#1133).
 ⚠️ Since the types ofRelationships are tied to theGraphobject they belong to, fixingpicklesupport for graph types means thatRelationships with the same name will have a different type afterdeepcopying or pickling and unpickling them or their graph.
👏 Improvements
- Fix coroutine not awaited warning (no functional changes) (#1129).
📚 Docs
- Fix API docs referencing a default value that is not defined (#1137).
📦 Packaging
- Publish pure-Python wheels also for the legacy package neo4j-driver(#1131, #1139).
- PEP 625 compatible distribution (#1127).
🧑💻 Development
- Enable using Python 3.7 in the development environment (#1130).
🔧 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_NODELAYoption 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+/-Durationcomputation being wildly off by considering the days of theDateTimesince UNIX epoch twice.
- Fix (Async)Result.to_dfnot correctly convertingDateTimes withtzinfoifparse_dates=Trueis 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_dfparameters (#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.basicexample showing off out-dated signature ofExpiringAuth(#1110).
🧹 Clean-up
- ⚠️ Prefix- (Async)NonConcurrentMethodCheckermethods with underscore (#1099).
 These base classes were introduced in version- 5.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 polyfilling- ResultSummary.notificationsfrom new-style GQL compliant statuses (i.e., when connected via Bolt version 5.6+/server version 5.23+) the driver used to set- notificationsto- []if no notifications are available. However, on older protocol versions this field would be- Nonein such case. We unified the behavior to make- notificationsbe- Nonein 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)
- ⚠️ Make- neo4j.auth_management.RotatingClientCertificateProvider(part of mTLS preview feature) an abstract class.
 This means it can no longer be instantiated directly. Please use the factory method- neo4j.auth_management.RotatingClientCertificateProvider.rotatinginstead.
 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_queryin 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,SummaryNotificationPositionhas 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_bookmarksparameter andBookmarks.from_raw_values'svaluesparameter not interpret a singlestras 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 neo4jis now also available as pure-Python wheel distribution (#1063).
🔧 Fixes
- Mitigate errors during resource warning on interpreter shutdown (#1037).
👏 Improvements
- Improve performance of from_ordinalof 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 ofTransactionandAsyncTransaction(#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 Durations withResult.dataresulting inTypeError: unsupported operand type(s) for *: 'int' and 'map'(#1000).
 Also: 1000th PR 🎂
- Also cover Session.last_bookmarkswith 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 withFAILUREand evenIGNOREDwhen the driver attempts toRESETa 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 providedAuthManagerimplementations.
 
- 
📚 Docs
- Fix signature of Driver.execute_query(#998).
- Fix wrong awaitin async API docs (#1003).
- Fix wrong minimum required server version for some notification filters (#1007).
⭐ New Features
- 
Driver.execute_querynow accepts aQueryobject to specify transaction config like metadata and transaction timeout (#991).
- For local development, run your application with python -X dev ...or set the environment variablePYTHONNEO4JDEBUGto 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 method- GraphDatabase.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 errorResultFailedErroris 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).
- ⚠️ Using- neo4j.Driver/- neo4j.AsyncDriverobjects 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_aliveto 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_queryis now more efficient by saving a round trip (#956).
- ⚠️ Changes were made to the re-auth feature in preview (#957, 8b35bd86):- Removed TokenExpiredRetryableexception.
 Even though it wasn't marked preview, it was introduced with and only used for re-auth. It no longer serves any purpose.
- The AuthManagerandAsyncAuthManagerabstract classes were changed.
 The methodon_auth_expired(self, auth: _TAuth) -> Nonewas removed in favor ofhandle_security_exception(self, auth: _TAuth, error: Neo4jError) -> bool.
 See the API docs for more details.
- The factories in AsyncAuthManagersandAuthManagerswere changed.- 
expiration_basedwas renamed tobearer.
- 
basicwas added to cater for password rotation.
 
- 
 
- Removed 
🔧 Fixes
- Fix handling of sub-ms transaction timeouts (#940).
- Due to the timeout being floatrounding issues were possible (e.g.,256.4 swould be turned into256399 ms).
- 
0.001 s > timeout > 0was rounded down to0 mswhich 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_queryAPI 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_agentmetadata so that the server knows which driver is connecting (#910).
- ⚠️ - neo4j.auth_management.ExpiringAuthused 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 attribute- expires_inwas replaced by- expires_at, which now expects a unix timestamp.
 You can use- ExpiringAuth(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 pandas2 support (#914).
📚 Docs
🌳 Maturing
- Bookmark managers (BookmarkManagerclass,bookmark_managerconfig options,Driver.bookmark_manager()factory method) (#911).
- 
Driver.execute_queryAPI with some minor changes (#911):- ⚠️ Rename- neo4j.RoutingControl.WRITERSto- neo4j.RoutingControl.WRITEand- ...READERSto- ...READ
- ⚠️ Rename- driver.query_bookmark_manager()to- driver.execute_query_bookmark_manager().
- The query argument is now typed LiteralStringinstead ofstrto help mitigate accidental Cypher injections. There are rare use-cases where a computed string is necessary. Please use# type: ignore, ortyping.castto suppress the type checking in those cases (#923).
 
⭐ New Features
- Notification filtering API (#847).
 This introduces two new optionsnotifications_min_severityandnotifications_disabled_categoriesto 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
- ⚠️ Importing- neo4j.workand its submodules has been deprecated. Everything should be imported directly from- neo4jinstead.
📚 Docs
⭐ New Features
- Experimental Driver.execute_queryAPI (#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.closeproperly (#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 ServiceUnavailableerrors 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 thanNoneorstr.
- 
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 thanNoneorstr.
 
- 
📚 Docs
🧹 Clean-up
- ⚠️ Undocumented helper methods- Neo4jError.is_fatal_during_discoveryand- Neo4jError.invalidates_all_connectionshave been deprecated and will be removed without replacement in version 6.0 (#870).
⭐ New Features
- Add Support for Python 3.11 (#861).
🔧 Fixes
- ⚠️ The experimental- BookmarkManagerAPI 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.BookmarkMangerandneo4j.AsyncBookmarkMangerabstract base classes:- 
update_bookmarkshas no longer adatabaseargument.
- 
get_bookmarkshas no longer adatabaseargument.
- The get_all_bookmarksmethod was removed.
- The forgetmethod was removed.
 
- 
- 
neo4j.GraphDatabase.bookmark_managerandneo4j.AsyncGraphDatabase.bookmark_managerfactory methods:- 
initial_bookmarksis no longer a mapping from database name to bookmarks but plain bookmarks.
- 
bookmarks_supplierno longer receives the database name as an argument.
- 
bookmarks_consumerno 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 LiteralStringinstead ofstrto help mitigate accidental Cypher injections. There are rare use-cases where a computed string is necessary. Please use# type: ignore, ortyping.castto suppress the type checking in those cases (#861).
🧹 Clean-up
- ⚠️ Deprecated package-alias- neo4j-driver. It will stop receiving updates starting with- 6.0.0. Please install- neo4jinstead (#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 databaseparameters 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.typedmarker 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 mypyversion0.990(#854).
📚 Docs
🔧 Fixes
- Fix missing rewrite of driver internal error neo4j._exceptions.SocketDeadlineExceeded: timed out(#842).
👏 Improvements
- Keyword parameters of Session.runandTransaction.runare 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_timeoutandupdate_routing_table_timeout) that were already removed in5.0.0(#838).
- Clarification of the timeoutparameter tounit_of_work(#827).
- Clarify precedence of parametersand keyword parameters ofSession.runandTransaction.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.ClientErrorandneo4j.exceptions.Neo4jErrorwhen raised from the driver code (806).
👏 Improvements
- Properly close sockets on async cancellation during HELLOhandshakes. This resolves aResourceWarningthat 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
- ⚠️ Removed- ignore_bookmark_managersession 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'- idproperty (- int) in favor of- element_id(- str).
 This also affects- Graphobjects as indexing- graph.nodes[...]and- graph.relationships[...]with integers has been deprecated in favor of indexing them with strings.
- Fixed encoding of DateTimes with zone id (#748).
 
- Added type hints for all public APIs (#767).
- Added BookmarkManagersupport (#771).
 This feature makes it easier to achieve causal chaining of sessions. See the API documentation for more details.
- New SSLconfig options (#639, #656, #666)- ⚠️ The- trustoption has been deprecated.
 Use- trusted_certificatesinstead. See the API documentation for more details.
- New options trusted_certificatesandssl_contexthave been added (see API docs for more details).
 
- 
ResultAPI- 
Result.singlehas a new optional argumentstrict(#646, #673).
 IfstrictisTrueand the result set contains not exactly one record, an exception will be raised.
- Added Result.fetch(n)to fetch up tonrecords as a list (#673).
- 
Resultobjects are now iterators (i.e.next(result)/result.__next__()is supported) (#647).
 result.__anext__()forAsyncResultrespectively.
 
- 
- Added Driver.get_server_info()(#654).
- Added .is_retryable()toNeo4jErrorandDriverError(#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 expandandparse_datesparameters toResult.to_df()(Pandas DataFrame export) (#663, #716).
🔧 Fixes
- Allow sending a transaction timeout of 0(#642).
 Previously,0was interpreted asNoneand thus the server-side default timeout was used. Now,0denotes an infinite timeout.
- Bookmarks (#649)
- ⚠️ - Session.last_bookmarkwas deprecated. Its behaviour is partially incorrect and cannot be fixed without breaking its signature.
 Use- Session.last_bookmarksinstead.
- 
neo4j.Bookmarkwas deprecated.
 Useneo4j.Bookmarksinstead.
 
- Many async fixes:
- Fix custom implementation of AsyncCondition(#638).
- 
asyncio.iscoroutinefunctionwasNonein destructor (#643).
- Add missing awaitinSession.being_transaction(423e1e5).
- Await and fix async socket closure (#701, #705).
- Handle asyncio.CancelledErrorgracefully (#761).
- Patch asyncio.wait_forto no swallow cancellations (#761).
 
- Fix custom implementation of 
- Fix sync socket close helper method (#777).
- ⚠️ Removed deprecated parts in the- neo4j.timemodule (#635).- 
Duration- The constructor does not accept subsecondsanymore.
 Usemilliseconds,microseconds, ornanosecondsinstead.
- The property subsecondshas been removed.
 Usenanosecondsinstead.
- The property hours_minutes_secondshas been removed.
 Usehours_minutes_seconds_nanosecondsinstead.
- 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, andnanosecondsare implicitly converted tonanosecondsorsecondsas 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 floats forsecondanymore.
 Usenanosecondinstead.
- Ticks are now nanoseconds since midnight (int).- The property ticks_nshas been renamed toticks.
 The oldticksis no longer supported.
- The propertyfrom_ticks_nshas been renamed tofrom_ticks.
 The oldfrom_ticksis no longer supported.
 
- The property 
- The property secondreturns anintinstead of afloat.
 Usenanosecondto get the sub-second information.
- The property hour_minute_secondhas been removed.
 Usehour_minute_second_nanosecondinstead.
 
- The constructor does not accept 
- 
DateTime- The property hour_minute_secondhas been removed.
 Usehour_minute_second_nanosecondinstead.
- The property secondreturns anintinstead of afloat.
 Usenanosecondto get the sub-second information.
 
- The property 
 
- 
👏 Improvements
- Speed up by caching the local port number of connections (#724).
- Raise ResultConsumedErrorwhen 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 aManagedTransactionobject. It behaves exactly like a regularTransactionobject, except it does not offer thecommit,rollback,close, andclosedmethods.
 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 the- Record(#759).- neo4j.exceptions.BrokenRecordErrorhas been introduced to indicate this.
🧹 Clean-up
- ⚠️ Removed deprecated- ResultSummary.server.version_info(#636).
 Use- ResultSummary.server.agent,- ResultSummary.server.protocol_version, or call the- dbms.componentsprocedure 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. A- ResourceWarningis 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 with- connection_acquisition_timeoutare 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 of- Driver.verify_connectivity()(#654, #743).
 Use- Driver.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.timedirectly.
- 
neo4j.spatial.hydrate_pointandneo4j.spatial.dehydrate_pointhave been deprecated without replacement. They are internal functions.
- Importing neo4j.packstreamhas been deprecated. It's internal and should not be used by client code.
- Importing neo4j.routinghas been deprecated. It's internal and should not be used by client code.
- Importing neo4j.confighas been deprecated. It's internal and should not be used by client code.
- 
neoj4.Config,neoj4.PoolConfig,neoj4.SessionConfig, andneoj4.WorkspaceConfighave been deprecated without replacement. They are internal classes.
- Importing neo4j.metahas been deprecated. It's internal and should not be used by client code.ExperimentalWarningshould be imported directly fromneo4j.neo4j.meta.versionis exposed throughneo4j.__version__
- Importing neo4j.datahas been deprecated. It's internal and should not be used by client code.Recordshould be imported directly fromneo4jinstead.neo4j.data.DataHydratorandneo4j.data.DataDeydratorhave 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