Skip to content

Commit fa48910

Browse files
committed
Cleanup
1 parent 4157417 commit fa48910

File tree

10 files changed

+6
-20
lines changed

10 files changed

+6
-20
lines changed

pymongo/asynchronous/bulk.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,6 @@ async def write_command(
240240
client: AsyncMongoClient,
241241
) -> dict[str, Any]:
242242
"""A proxy for SocketInfo.write_command that handles event publishing."""
243-
244243
cmd[bwc.field] = docs
245244
if _COMMAND_LOGGER.isEnabledFor(logging.DEBUG):
246245
_debug_log(
@@ -325,7 +324,6 @@ async def unack_write(
325324
client: AsyncMongoClient,
326325
) -> Optional[Mapping[str, Any]]:
327326
"""A proxy for AsyncConnection.unack_write that handles event publishing."""
328-
329327
if _COMMAND_LOGGER.isEnabledFor(logging.DEBUG):
330328
_debug_log(
331329
_COMMAND_LOGGER,

pymongo/asynchronous/database.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,7 @@ def __init__(
125125
raise TypeError("name must be an instance of str")
126126

127127
if not isinstance(client, AsyncMongoClient):
128-
raise TypeError(
129-
f"AsyncMongoClient required but {client} is an instance of {type(client)}"
130-
)
128+
raise TypeError(f"AsyncMongoClient required but given {type(client)}")
131129

132130
if name != "$external":
133131
_check_name(name)

pymongo/asynchronous/encryption.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -598,9 +598,7 @@ def __init__(
598598
raise TypeError("codec_options must be an instance of bson.codec_options.CodecOptions")
599599

600600
if not isinstance(key_vault_client, AsyncMongoClient):
601-
raise TypeError(
602-
f"AsyncMongoClient required but {key_vault_client} is an instance of {type(key_vault_client)}"
603-
)
601+
raise TypeError(f"AsyncMongoClient required but given {type(key_vault_client)}")
604602

605603
self._kms_providers = kms_providers
606604
self._key_vault_namespace = key_vault_namespace

pymongo/asynchronous/mongo_client.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2420,9 +2420,7 @@ def __init__(
24202420
self, client: AsyncMongoClient, server: Server, session: Optional[AsyncClientSession]
24212421
):
24222422
if not isinstance(client, AsyncMongoClient):
2423-
raise TypeError(
2424-
f"AsyncMongoClient required but {client} is an instance of {type(client)}"
2425-
)
2423+
raise TypeError(f"AsyncMongoClient required but given {type(client)}")
24262424

24272425
self.client = client
24282426
self.server_address = server.description.address

pymongo/asynchronous/server.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,6 @@ async def run_operation(
157157
:param unpack_res: A callable that decodes the wire protocol response.
158158
:param client: An AsyncMongoClient instance.
159159
"""
160-
161160
assert listeners is not None
162161

163162
publish = listeners.enabled_for_commands

pymongo/synchronous/bulk.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,6 @@ def write_command(
240240
client: MongoClient,
241241
) -> dict[str, Any]:
242242
"""A proxy for SocketInfo.write_command that handles event publishing."""
243-
244243
cmd[bwc.field] = docs
245244
if _COMMAND_LOGGER.isEnabledFor(logging.DEBUG):
246245
_debug_log(
@@ -325,7 +324,6 @@ def unack_write(
325324
client: MongoClient,
326325
) -> Optional[Mapping[str, Any]]:
327326
"""A proxy for Connection.unack_write that handles event publishing."""
328-
329327
if _COMMAND_LOGGER.isEnabledFor(logging.DEBUG):
330328
_debug_log(
331329
_COMMAND_LOGGER,

pymongo/synchronous/database.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ def __init__(
125125
raise TypeError("name must be an instance of str")
126126

127127
if not isinstance(client, MongoClient):
128-
raise TypeError(f"MongoClient required but {client} is an instance of {type(client)}")
128+
raise TypeError(f"MongoClient required but given {type(client)}")
129129

130130
if name != "$external":
131131
_check_name(name)

pymongo/synchronous/encryption.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -596,9 +596,7 @@ def __init__(
596596
raise TypeError("codec_options must be an instance of bson.codec_options.CodecOptions")
597597

598598
if not isinstance(key_vault_client, MongoClient):
599-
raise TypeError(
600-
f"MongoClient required but {key_vault_client} is an instance of {type(key_vault_client)}"
601-
)
599+
raise TypeError(f"MongoClient required but given {type(key_vault_client)}")
602600

603601
self._kms_providers = kms_providers
604602
self._key_vault_namespace = key_vault_namespace

pymongo/synchronous/mongo_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2407,7 +2407,7 @@ class _MongoClientErrorHandler:
24072407

24082408
def __init__(self, client: MongoClient, server: Server, session: Optional[ClientSession]):
24092409
if not isinstance(client, MongoClient):
2410-
raise TypeError(f"MongoClient required but {client} is an instance of {type(client)}")
2410+
raise TypeError(f"MongoClient required but given {type(client)}")
24112411

24122412
self.client = client
24132413
self.server_address = server.description.address

pymongo/synchronous/server.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,6 @@ def run_operation(
157157
:param unpack_res: A callable that decodes the wire protocol response.
158158
:param client: A MongoClient instance.
159159
"""
160-
161160
assert listeners is not None
162161

163162
publish = listeners.enabled_for_commands

0 commit comments

Comments
 (0)