Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ See also https://github.com/neo4j/neo4j-python-driver/wiki for a full changelog.
- `connection_acquisition_timeout` configuration option
- `ValueError` on invalid values (instead of `ClientError`)
- Consistently restrict the value to be strictly positive
- Raise `ConfigurationError` instead of ignoring the routing context (URI query parameters) when creating a direct
driver ("bolt[+s[sc]]://" scheme).


## Version 5.28
Expand Down
15 changes: 4 additions & 11 deletions src/neo4j/_async/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,18 +300,11 @@ def driver(
assert driver_type in {DRIVER_BOLT, DRIVER_NEO4J}
if driver_type == DRIVER_BOLT:
if parse_routing_context(parsed.query):
deprecation_warn(
'Creating a direct driver ("bolt://" scheme) with '
"routing context (URI parameters) is deprecated. They "
"will be ignored. This will raise an error in a "
f'future release. Given URI "{uri}"',
stack_level=2,
raise ConfigurationError(
"Routing context (URI query parameters) are not "
"supported by direct drivers "
f'("bolt[+s[sc]]://" scheme). Given URI: {uri!r}.'
)
# TODO: 6.0 - raise instead of warning
# raise ValueError(
# 'Routing parameters are not supported with scheme '
# '"bolt". Given URI "{}".'.format(uri)
# )
return cls.bolt_driver(parsed.netloc, **config)
# else driver_type == DRIVER_NEO4J
routing_context = parse_routing_context(parsed.query)
Expand Down
15 changes: 4 additions & 11 deletions src/neo4j/_sync/driver.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions tests/unit/async_/test_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,12 @@ async def test_direct_driver_constructor(
):
uri = protocol + host + port + params
if params:
with pytest.warns(DeprecationWarning, match="routing context"):
driver = AsyncGraphDatabase.driver(uri, auth=auth_token)
with pytest.raises(ConfigurationError, match="Routing context"):
AsyncGraphDatabase.driver(uri, auth=auth_token)
else:
driver = AsyncGraphDatabase.driver(uri, auth=auth_token)
assert isinstance(driver, AsyncBoltDriver)
await driver.close()
await driver.close()
assert isinstance(driver, AsyncBoltDriver)


@pytest.mark.parametrize(
Expand Down
8 changes: 4 additions & 4 deletions tests/unit/sync/test_driver.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.