Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 36 additions & 34 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 5 additions & 0 deletions neo4j/_async/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 5 additions & 0 deletions neo4j/_sync/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down