fix flake8 findings
This commit is contained in:
parent
60c42dddd5
commit
84f3dce492
@ -29,7 +29,7 @@ def count_documents(collection, filter, skip=None, limit=None, hint=None, collat
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
return collection.count_documents(filter=filter, **kwargs)
|
return collection.count_documents(filter=filter, **kwargs)
|
||||||
except (AttributeError, OperationFailure) as ex:
|
except (AttributeError, OperationFailure):
|
||||||
# AttributeError - count_documents appeared in pymongo 3.7
|
# AttributeError - count_documents appeared in pymongo 3.7
|
||||||
# OperationFailure - accounts for some operators that used to work
|
# OperationFailure - accounts for some operators that used to work
|
||||||
# with .count but are no longer working with count_documents (i.e $geoNear, $near, and $nearSphere)
|
# with .count but are no longer working with count_documents (i.e $geoNear, $near, and $nearSphere)
|
||||||
|
@ -12,7 +12,6 @@ import pymongo.errors
|
|||||||
from pymongo.collection import ReturnDocument
|
from pymongo.collection import ReturnDocument
|
||||||
from pymongo.common import validate_read_preference
|
from pymongo.common import validate_read_preference
|
||||||
import six
|
import six
|
||||||
from pymongo.errors import OperationFailure
|
|
||||||
from six import iteritems
|
from six import iteritems
|
||||||
|
|
||||||
from mongoengine import signals
|
from mongoengine import signals
|
||||||
|
Loading…
x
Reference in New Issue
Block a user