diff --git a/CHANGELOG.md b/CHANGELOG.md index 64d1f3483..d58f9dfba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,40 +16,42 @@ Use `trusted_certificates` instead which expects `None` or a `list`. See the API documentation for more details. - `neo4j.time` module: - - `Duration` - - The constructor does not accept `subseconds` anymore. - Use `milliseconds`, `microseconds`, or `nanoseconds` instead. - - The property `subseconds` has been removed. - Use `nanoseconds` instead. - - The property `hours_minutes_seconds` has been removed. - Use `hours_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`, and `nanoseconds` are - implicitly converted to `nanoseconds` or `seconds` as fit. - - Multiplication and division allow for floats but will always result in - integer values (round to nearest even). - - `Time` - - The constructor does not accept `float`s for `second` anymore. - Use `nanosecond` instead. - - Ticks are now nanoseconds since midnight (`int`). - - The property `ticks_ns` has been renamed to `ticks`. - The old `ticks` is no longer supported. - - The property`from_ticks_ns` has been renamed to `from_ticks`. - The old `from_ticks` is no longer supported. - - The property `second` returns an `int` instead of a `float`. - Use `nanosecond` to get the sub-second information. - - The property `hour_minute_second` has been removed. - Use `hour_minute_second_nanosecond` instead. - - `DateTime` - - The property `hour_minute_second` has been removed. - Use `hour_minute_second_nanosecond` instead. - - The property `second` returns an `int` instead of a `float`. - Use `nanosecond` to get the sub-second information. - + - `Duration` + - The constructor does not accept `subseconds` anymore. + Use `milliseconds`, `microseconds`, or `nanoseconds` instead. + - The property `subseconds` has been removed. + Use `nanoseconds` instead. + - The property `hours_minutes_seconds` has been removed. + Use `hours_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`, and `nanoseconds` are + implicitly converted to `nanoseconds` or `seconds` as fit. + - Multiplication and division allow for floats but will always result in + integer values (round to nearest even). + - `Time` + - The constructor does not accept `float`s for `second` anymore. + Use `nanosecond` instead. + - Ticks are now nanoseconds since midnight (`int`). + - The property `ticks_ns` has been renamed to `ticks`. + The old `ticks` is no longer supported. + - The property`from_ticks_ns` has been renamed to `from_ticks`. + The old `from_ticks` is no longer supported. + - The property `second` returns an `int` instead of a `float`. + Use `nanosecond` to get the sub-second information. + - The property `hour_minute_second` has been removed. + Use `hour_minute_second_nanosecond` instead. + - `DateTime` + - The property `hour_minute_second` has been removed. + Use `hour_minute_second_nanosecond` instead. + - The property `second` returns an `int` instead of a `float`. + Use `nanosecond` to get the sub-second information. +- Creation of a driver with `bolt[+s[sc]]://` scheme now raises an error if the + URI contains a query part (a routing context). Previously, the routing context + was silently ignored. ## Version 4.4 diff --git a/neo4j/_async/driver.py b/neo4j/_async/driver.py index 27a1fdb47..ef91266a7 100644 --- a/neo4j/_async/driver.py +++ b/neo4j/_async/driver.py @@ -87,6 +87,11 @@ def driver(cls, uri, *, auth=None, **config): config["trusted_certificates"] = [] if driver_type == DRIVER_BOLT: + if parse_routing_context(parsed.query): + raise ValueError( + 'Routing parameters are not supported with scheme "bolt". ' + 'Given URI "{}".'.format(uri) + ) return cls.bolt_driver(parsed.netloc, auth=auth, **config) elif driver_type == DRIVER_NEO4j: routing_context = parse_routing_context(parsed.query) diff --git a/neo4j/_sync/driver.py b/neo4j/_sync/driver.py index 42a3c0ac7..df9502b85 100644 --- a/neo4j/_sync/driver.py +++ b/neo4j/_sync/driver.py @@ -87,6 +87,11 @@ def driver(cls, uri, *, auth=None, **config): config["trusted_certificates"] = [] if driver_type == DRIVER_BOLT: + if parse_routing_context(parsed.query): + raise ValueError( + 'Routing parameters are not supported with scheme "bolt". ' + 'Given URI "{}".'.format(uri) + ) return cls.bolt_driver(parsed.netloc, auth=auth, **config) elif driver_type == DRIVER_NEO4j: routing_context = parse_routing_context(parsed.query)