Skip to content

Commit ac6e46a

Browse files
committed
Do not allow sync auth managers in async driver
1 parent e6f45b6 commit ac6e46a

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

src/neo4j/_async/driver.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@
7979
from ..auth_management import (
8080
AsyncAuthManager,
8181
AsyncAuthManagers,
82-
AuthManager,
8382
)
8483
from ..exceptions import Neo4jError
8584
from .bookmark_manager import (
@@ -132,7 +131,6 @@ def driver(
132131
# TAuth,
133132
t.Union[t.Tuple[t.Any, t.Any], Auth, None],
134133
AsyncAuthManager,
135-
AuthManager
136134
] = ...,
137135
max_connection_lifetime: float = ...,
138136
max_connection_pool_size: int = ...,
@@ -183,7 +181,6 @@ def driver(
183181
# TAuth,
184182
t.Union[t.Tuple[t.Any, t.Any], Auth, None],
185183
AsyncAuthManager,
186-
AuthManager
187184
] = None,
188185
**config
189186
) -> AsyncDriver:
@@ -200,7 +197,7 @@ def driver(
200197

201198
driver_type, security_type, parsed = parse_neo4j_uri(uri)
202199

203-
if not isinstance(auth, (AsyncAuthManager, AuthManager)):
200+
if not isinstance(auth, AsyncAuthManager):
204201
with warnings.catch_warnings():
205202
warnings.filterwarnings(
206203
"ignore", message=r".*\bAuth managers\b.*",

src/neo4j/_sync/driver.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,6 @@ def driver(
130130
# TAuth,
131131
t.Union[t.Tuple[t.Any, t.Any], Auth, None],
132132
AuthManager,
133-
AuthManager
134133
] = ...,
135134
max_connection_lifetime: float = ...,
136135
max_connection_pool_size: int = ...,
@@ -181,7 +180,6 @@ def driver(
181180
# TAuth,
182181
t.Union[t.Tuple[t.Any, t.Any], Auth, None],
183182
AuthManager,
184-
AuthManager
185183
] = None,
186184
**config
187185
) -> Driver:
@@ -198,7 +196,7 @@ def driver(
198196

199197
driver_type, security_type, parsed = parse_neo4j_uri(uri)
200198

201-
if not isinstance(auth, (AuthManager, AuthManager)):
199+
if not isinstance(auth, AuthManager):
202200
with warnings.catch_warnings():
203201
warnings.filterwarnings(
204202
"ignore", message=r".*\bAuth managers\b.*",

0 commit comments

Comments
 (0)