File tree Expand file tree Collapse file tree 2 files changed +2
-3
lines changed Expand file tree Collapse file tree 2 files changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ PyMongo 4.14 brings a number of changes including:
10
10
- Added :meth: `pymongo.asynchronous.mongo_client.AsyncMongoClient.append_metadata ` and
11
11
:meth: `pymongo.mongo_client.MongoClient.append_metadata ` to allow instantiated MongoClients to send client metadata
12
12
on-demand
13
+ - Improved performance of selecting a server with the Primary selector.
13
14
14
15
- Introduces a minor breaking change. When encoding :class: `bson.binary.BinaryVector `, a ``ValueError `` will be raised
15
16
if the 'padding' metadata field is < 0 or > 7, or non-zero for any type other than PACKED_BIT.
Original file line number Diff line number Diff line change @@ -325,9 +325,7 @@ def apply_selector(
325
325
return [description ] if description else []
326
326
327
327
# Primary selection fast path.
328
- if self .topology_type == TOPOLOGY_TYPE .ReplicaSetWithPrimary and isinstance (
329
- selector , Primary
330
- ):
328
+ if self .topology_type == TOPOLOGY_TYPE .ReplicaSetWithPrimary and type (selector ) is Primary :
331
329
for sd in self ._server_descriptions .values ():
332
330
if sd .server_type == SERVER_TYPE .RSPrimary :
333
331
return [sd ]
You can’t perform that action at this time.
0 commit comments