Compare commits

...

2 Commits

Author SHA1 Message Date
Georg K
f5fec0f374 feat: update code collection check 2022-02-03 20:16:03 +03:00
jar3b
dffcc0992d fix: imports to match v0.13 to python3.10 2021-11-05 18:10:25 +03:00
3 changed files with 3 additions and 3 deletions

View File

@ -1,6 +1,6 @@
import copy import copy
import numbers import numbers
from collections import Hashable from collections.abc import Hashable
from functools import partial from functools import partial
from bson import ObjectId, json_util from bson import ObjectId, json_util

View File

@ -808,7 +808,7 @@ class Document(BaseDocument):
collection = cls._get_collection() collection = cls._get_collection()
# 746: when connection is via mongos, the read preference is not necessarily an indication that # 746: when connection is via mongos, the read preference is not necessarily an indication that
# this code runs on a secondary # this code runs on a secondary
if not collection.is_mongos and collection.read_preference > 1: if collection.is_mongos is not None and collection.read_preference.mode > 1:
return return
# determine if an index which we are creating includes # determine if an index which we are creating includes

View File

@ -6,7 +6,7 @@ import socket
import time import time
import uuid import uuid
import warnings import warnings
from collections import Mapping from collections.abc import Mapping
from operator import itemgetter from operator import itemgetter
from bson import Binary, DBRef, ObjectId, SON from bson import Binary, DBRef, ObjectId, SON