## Driver Migration Guide Please read our [Driver Migration Guide](https://neo4j.com/docs/migration-guide/4.0/upgrade-driver/) for guidance and breaking changes when migrating from 1.7 drivers to 4.X drivers. ## Changelog ### 4.4.13 *** **πŸ”§οΈ Fixes** * Fix driver stuck on `RecursionError` on `COMMIT` `SUCCESS` ([#1192](https://github.com/neo4j/neo4j-python-driver/pull/1203)). * Fix bugs in `neo4j.time.DateTime` handling ([#1101](https://github.com/neo4j/neo4j-python-driver/pull/1101)). * Fix `DateTime` +/- `Duration` computation being wildly off by considering the days of the `DateTime` since UNIX epoch twice. * Fix `DateTime.__ne__` (inequality operator) incorrectly comparing against non-DateTime-like types. **πŸ“šοΈ Docs** * Add note on `Driver.close` not being concurrency-safe ([#1148](https://github.com/neo4j/neo4j-python-driver/pull/1148)). ### 4.4.12 *** **πŸ”§ Fixes** * Fix race condition in routing information of the connection pool ([#953](https://github.com/neo4j/neo4j-python-driver/pull/953)). * Fix internal use of deprecated API causing a deprecation warning ([#1033](https://github.com/neo4j/neo4j-python-driver/pull/1033)). * Fix handling of sub-ms transaction timeouts ([#1034](https://github.com/neo4j/neo4j-python-driver/pull/1034)). * Transaction timeouts of under `0.5 ms` (`< 0.0005`) were rounded down to `0`, which is a special value indicating "no timeout" to the server. They are now rounded up to `1 ms`. * Values of `0` documented not to be used. They were not sent to the server causing the default timeout to be used. They are now properly transmitted and represent "no timeout" (for those server versions that support it). * Fix the logging helper `neo4j.debug.watch()` to properly handle being configured with different levels ([#1032](https://github.com/neo4j/neo4j-python-driver/pull/1032)). * Fix race condition in handling muting of warning in internal API calls ([#1040](https://github.com/neo4j/neo4j-python-driver/pull/1040)). This could have led to not surfacing deprecation warnings properly when users interacted with deprecated APIs. * Fix Duration export in `Result.data` and `Record.data` ([#1041](https://github.com/neo4j/neo4j-python-driver/pull/1041)). * Harden the driver against unexpected server responses following `RESET` ([#1042](https://github.com/neo4j/neo4j-python-driver/pull/1042)). Under certain circumstances, can the server respond with `FAILURE` and even `IGNORED` when the driver attempts to `RESET` 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. * Fix driver dropping write servers from the routing table too aggressively ([#1039](https://github.com/neo4j/neo4j-python-driver/pull/1039)). * 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 ([#1038](https://github.com/neo4j/neo4j-python-driver/pull/1038)). * Fix not using the cached port number for logging ([#1045](https://github.com/neo4j/neo4j-python-driver/pull/1045)). In the best-case, this only caused some unnecessary syscalls. In the worst, this cause some `OSError` that obscured the actual error that should've been raised to the user code. **πŸ‘ Improvements** * Improve performance of `from_ordinal` of temporal types ([#1047](https://github.com/neo4j/neo4j-python-driver/pull/1047)). Speeds up the function by about a factor of 100. ### 4.4.11 *** **πŸ”§ Fixes** * Fix application protocol (bolt) handshake not having a timeout ([#905](https://github.com/neo4j/neo4j-python-driver/pull/905)). ### 4.4.10 *** **πŸ‘ Improvements** * Add Support for Python 3.11 ([#862](https://github.com/neo4j/neo4j-python-driver/pull/862)). **🧹Clean-up** * Removed testing code (`testkitbackend`) from distributed package ([#863](https://github.com/neo4j/neo4j-python-driver/pull/863)). ### 4.4.9 *** **πŸ”§ Fixes** * Fix `BufferError: Existing exports of data: object cannot be re-sized` error on failure of sending handshake to the server ([#843](https://github.com/neo4j/neo4j-python-driver/pull/843)). * Fix missing rewrite of driver internal error `neo4j._exceptions.SocketDeadlineExceeded: timed out` ([#843](https://github.com/neo4j/neo4j-python-driver/pull/843)). **πŸ‘ Improvements** * Keyword parameters of `Session.run` and `Transaction.run` are no longer restricted by parameters used in driver internal functions further down the stack ([#836](https://github.com/neo4j/neo4j-python-driver/pull/836)). * Add Support for Python 3.10 ([#832](https://github.com/neo4j/neo4j-python-driver/pull/832)). **πŸ“š Docs** * Editorial changes ([#824](https://github.com/neo4j/neo4j-python-driver/pull/824), [#840](https://github.com/neo4j/neo4j-python-driver/pull/840)). * Clarification of the `timeout` parameter to `unit_of_work` ([#828](https://github.com/neo4j/neo4j-python-driver/pull/828)). * Clarify precedence of `parameters` and keyword parameters of `Session.run` and `Transaction.run` ([#836](https://github.com/neo4j/neo4j-python-driver/pull/836)). ### 4.4.8 *** **πŸ”§ Fixes** * Fix connection pool clogging up when checking if new connections can be created while the pool is full ([#803](https://github.com/neo4j/neo4j-python-driver/pull/803); fixes [#796](https://github.com/neo4j/neo4j-python-driver/issues/796)). The bug was introduced in 4.4.5 with [#746](https://github.com/neo4j/neo4j-python-driver/pull/746). * Fix string representation of `neo4j.exceptions.ClientError` and `neo4j.exceptions.Neo4jError` when raised from the driver code ([#805](https://github.com/neo4j/neo4j-python-driver/pull/805)). ### 4.4.7 *** **πŸ”§ Fixes** * Fix `DeprecationWarning` for `update_routing_table_timeout` config option being emitted if the option was not used ([#789](https://github.com/neo4j/neo4j-python-driver/pull/789)). * Fix relying on garbage collector to close sockets under certain failure conditions ([#794](https://github.com/neo4j/neo4j-python-driver/pull/794)). ### 4.4.6 *** **πŸ”§ Fixes** * Fix method accidentally marked `async` ([#774](https://github.com/neo4j/neo4j-python-driver/pull/774)). **πŸ‘ Improvements** * Speed up `DateTime.to_clock_time` by 2 orders of magnitude and with it the serialization of `DateTime` objects ([#781](https://github.com/neo4j/neo4j-python-driver/pull/781)). **🧹Clean-up** * ⚠️ Deprecate timeout config options introduced in 4.4.5 ([#768](https://github.com/neo4j/neo4j-python-driver/pull/768)). `update_routing_table_timeout` and `session_connection_timeout` have been deprecated and will be removed in 5.0. Server-side keep-alives communicated through configuration hints together with `connection_acquisition_timeout` are sufficient to avoid the driver getting stuck. ### 4.4.5 *** **πŸ”§ Fixes** * Implement patched protocol that removes ambiguity in datetimes with named zone. For this to take effect, the server needs to be at least on patch version 4.3.18 or 4.4.11 respectively. **πŸ‘ Improvements** * Clarify the documentation around `session.read_transaction`: it does not enforce access control ([#753](https://github.com/neo4j/neo4j-python-driver/pull/753)). * Multiple improvements around timeouts ([#746](https://github.com/neo4j/neo4j-python-driver/pull/746)): * The configuration option `connection_acquisition_timeout` does only limit the amount of time the driver waits for a connection from the pool. It does not cater for potential routing table updates. Therefore, two new configuration options `update_routing_table_timeout` and `session_connection_timeout` are being introduced. Read more about them in the [API docs](https://neo4j.com/docs/api/python-driver/4.4/api.html#driver-configuration) . * A slow response from the server while opening a new connection does no longer block the whole connection pool. ### 4.4.4 *** **πŸ”§ Fixes** * Fix pool closing connections that are in use when opening a new connection fails ([#733](https://github.com/neo4j/neo4j-python-driver/pull/733)). Especially, but not only, in concurrent contexts, this would lead to all sorts of unspecific errors. * Fix pool trying to close the same connection multiple times if closing fails. ([#733](https://github.com/neo4j/neo4j-python-driver/pull/733)). This would lead to `ValueError: deque.remove(x): x not in deque` (Issue [#739](https://github.com/neo4j/neo4j-python-driver/issues/739)). **πŸ‘ Improvements** * Performance improvement around logging calls (even with disabled logging) ([#726](https://github.com/neo4j/neo4j-python-driver/pull/726)). * Several small improvements to docstrings and API docs. ### 4.4.3 *** **πŸ”§ Fixes** * Fix wrong serialization of the `DateTime` type's timezone ([#684](https://github.com/neo4j/neo4j-python-driver/pull/684)). * Fix wrong comparison operators of several types in the `neo4j.time` package ([#684](https://github.com/neo4j/neo4j-python-driver/pull/684)). * Improve compatibility of `neo4j.time` with different timezone implementations ([#684](https://github.com/neo4j/neo4j-python-driver/pull/684)). ### 4.4.2 *** **πŸ”§ Fixes** * Fix the driver sending partial data (causing connection closure and hence slightly worse performance) on errors during data serialization ([#641](https://github.com/neo4j/neo4j-python-driver/pull/641)). **⭐ New Features** * Backported (**experimental**) preview of pandas DataFrame export for results. ([#678](https://github.com/neo4j/neo4j-python-driver/pull/678)). _Note: the change is self-contained and does not affect any other parts of the driver._ ### 4.4.1 *** **πŸ”§ Fixes** * Fix pool closing stale connections that are in use ([#631](https://github.com/neo4j/neo4j-python-driver/pull/631)). Especially, but not only, in concurrent contexts, this would lead to all sorts of unspecific errors. **πŸ‘ Improvements** * Performance improvement when packing data ([#622](https://github.com/neo4j/neo4j-python-driver/pull/622)). ### 4.4.0 *** **πŸ”§ Fixes** * Fail fast and raise the original error during discovery (initial attempt to connect to the server) on certain errors that are expected to be experienced across all cluster-members ,e.g., `Neo.ClientError.Database.DatabaseNotFound` and `Neo.ClientError.Transaction.InvalidBookmark`([#611](https://github.com/neo4j/neo4j-python-driver/pull/611)). * Fix wrong serialization of the `Time` type's timezone ([#616](https://github.com/neo4j/neo4j-python-driver/pull/616)). ### 4.4.0b1 *** **πŸ”§ Fixes** * Use `selectors.DefaultSelector` instead of `select.select` which resolves the number of simultaneously open files (including sockets) being limited to 1024 on all operating systems that support it ([#604](https://github.com/neo4j/neo4j-python-driver/pull/604)). * Fixed `AttributeError` on connection clean-up ([#603](https://github.com/neo4j/neo4j-python-driver/pull/603)). **πŸ‘ Improvements** * Log the reason when a secure connection could not be established ([#608](https://github.com/neo4j/neo4j-python-driver/pull/608)). ### 4.4.0a1 *** **⭐ New Features** * Introduce impersonation support ([#599](https://github.com/neo4j/neo4j-python-driver/pull/599)). * Add bearer authentication support (single sign-on) ([#579](https://github.com/neo4j/neo4j-python-driver/pull/579)). * Add Bolt 4.4 support ([#560](https://github.com/neo4j/neo4j-python-driver/pull/560)). **πŸ”§ Fixes** * Time types use Decimals and integers instead of floats for sub-seconds ([#551](https://github.com/neo4j/neo4j-python-driver/pull/551)). This fixes rounding issues and allows for an exact representation of nanoseconds, but comes at the cost of a slightly altered API. Please refer to the documentation. **πŸ‘ Improvements** * Fail fast on transaction begin ([#586](https://github.com/neo4j/neo4j-python-driver/pull/586)). * Only send `qid` parameter over the wire when necessary ([#585](https://github.com/neo4j/neo4j-python-driver/pull/585)). * Reduce the number of `RESET` messages send over the wire to the bare minimum ([#572](https://github.com/neo4j/neo4j-python-driver/pull/572)). * Fail fast on re-using a broken transaction ([#566](https://github.com/neo4j/neo4j-python-driver/pull/566)). **🧹Clean-up** * Drop support for Python 3.5 (end of life 2020-11-13) ([#560](https://github.com/neo4j/neo4j-python-driver/pull/560)).