5151)
5252from .._debug import ENABLED as DEBUG_ENABLED
5353from .._warnings import (
54- deprecation_warn ,
5554 preview_warn ,
5655 unclosed_resource_warn ,
5756)
@@ -284,10 +283,10 @@ def driver(
284283 "supported by direct drivers "
285284 f'("bolt[+s[sc]]://" scheme). Given URI: { uri !r} .'
286285 )
287- return cls .bolt_driver (parsed .netloc , ** config )
286+ return cls ._bolt_driver (parsed .netloc , ** config )
288287 # else driver_type == DRIVER_NEO4J
289288 routing_context = parse_routing_context (parsed .query )
290- return cls .neo4j_driver (
289+ return cls ._neo4j_driver (
291290 parsed .netloc , routing_context = routing_context , ** config
292291 )
293292
@@ -376,7 +375,7 @@ def bookmark_manager(
376375 )
377376
378377 @classmethod
379- def bolt_driver (cls , target , ** config ):
378+ def _bolt_driver (cls , target , ** config ):
380379 """
381380 Create a direct driver.
382381
@@ -389,36 +388,28 @@ def bolt_driver(cls, target, **config):
389388 )
390389
391390 try :
392- return AsyncBoltDriver .open (target , ** config )
391+ return AsyncBoltDriver ._open (target , ** config )
393392 except (BoltHandshakeError , BoltSecurityError ) as error :
394393 from ..exceptions import ServiceUnavailable
395394
396395 raise ServiceUnavailable (str (error )) from error
397396
398397 @classmethod
399- def neo4j_driver (cls , * targets , routing_context = None , ** config ):
398+ def _neo4j_driver (cls , target , routing_context = None , ** config ):
400399 """
401400 Create a routing driver.
402401
403402 Create a driver for routing-capable Neo4j service access
404403 that uses socket I/O and thread-based concurrency.
405404 """
406- # TODO: 6.0 - adjust signature to only take one target
407- if len (targets ) > 1 :
408- deprecation_warn (
409- "Creating a routing driver with multiple targets is "
410- "deprecated. The driver only uses the first target anyway. "
411- "The method signature will change in a future release." ,
412- )
413-
414405 from .._exceptions import (
415406 BoltHandshakeError ,
416407 BoltSecurityError ,
417408 )
418409
419410 try :
420- return AsyncNeo4jDriver .open (
421- * targets , routing_context = routing_context , ** config
411+ return AsyncNeo4jDriver ._open (
412+ target , routing_context = routing_context , ** config
422413 )
423414 except (BoltHandshakeError , BoltSecurityError ) as error :
424415 from ..exceptions import ServiceUnavailable
@@ -427,10 +418,9 @@ def neo4j_driver(cls, *targets, routing_context=None, **config):
427418
428419
429420class _Direct :
430- # TODO: 6.0 - those attributes should be private
431- default_host = "localhost"
432- default_port = 7687
433- default_target = ":"
421+ _default_host = "localhost"
422+ _default_port = 7687
423+ _default_target = ":"
434424
435425 def __init__ (self , address ):
436426 self ._address = address
@@ -440,22 +430,21 @@ def address(self):
440430 return self ._address
441431
442432 @classmethod
443- def parse_target (cls , target ):
433+ def _parse_target (cls , target ):
444434 """Parse a target string to produce an address."""
445435 if not target :
446- target = cls .default_target
436+ target = cls ._default_target
447437 return Address .parse (
448438 target ,
449- default_host = cls .default_host ,
450- default_port = cls .default_port ,
439+ default_host = cls ._default_host ,
440+ default_port = cls ._default_port ,
451441 )
452442
453443
454444class _Routing :
455- # TODO: 6.0 - those attributes should be private
456- default_host = "localhost"
457- default_port = 7687
458- default_targets = ": :17601 :17687"
445+ _default_host = "localhost"
446+ _default_port = 7687
447+ _default_targets = ": :17601 :17687"
459448
460449 def __init__ (self , initial_addresses ):
461450 self ._initial_addresses = initial_addresses
@@ -465,15 +454,15 @@ def initial_addresses(self):
465454 return self ._initial_addresses
466455
467456 @classmethod
468- def parse_targets (cls , * targets ):
457+ def _parse_targets (cls , * targets ):
469458 """Parse a sequence of target strings to produce an address list."""
470459 targets = " " .join (targets )
471460 if not targets :
472- targets = cls .default_targets
461+ targets = cls ._default_targets
473462 return Address .parse_list (
474463 targets ,
475- default_host = cls .default_host ,
476- default_port = cls .default_port ,
464+ default_host = cls ._default_host ,
465+ default_port = cls ._default_port ,
477466 )
478467
479468
@@ -1308,10 +1297,10 @@ class AsyncBoltDriver(_Direct, AsyncDriver):
13081297 """
13091298
13101299 @classmethod
1311- def open (cls , target , ** config ):
1300+ def _open (cls , target , ** config ):
13121301 from .io import AsyncBoltPool
13131302
1314- address = cls .parse_target (target )
1303+ address = cls ._parse_target (target )
13151304 pool_config , default_workspace_config = Config .consume_chain (
13161305 config , AsyncPoolConfig , WorkspaceConfig
13171306 )
@@ -1342,10 +1331,10 @@ class AsyncNeo4jDriver(_Routing, AsyncDriver):
13421331 """
13431332
13441333 @classmethod
1345- def open (cls , * targets , routing_context = None , ** config ):
1334+ def _open (cls , * targets , routing_context = None , ** config ):
13461335 from .io import AsyncNeo4jPool
13471336
1348- addresses = cls .parse_targets (* targets )
1337+ addresses = cls ._parse_targets (* targets )
13491338 pool_config , default_workspace_config = Config .consume_chain (
13501339 config , AsyncPoolConfig , WorkspaceConfig
13511340 )
0 commit comments