Skip to content

Commit

Permalink
refactor: removed unused method
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Kryukov authored and michaelkryukov committed Jul 30, 2024
1 parent 09bb06c commit 0abb97a
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions mongomock_motor/patches.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,28 +122,6 @@ def wrapper(spec, sort, fields, as_class):
return collection


def _patch_get_dataset(collection):
"""
When using beanie, keys can have "ExpressionField" type,
that is inherited from "str". Looks like pymongo works ok
with that, so we should be too.
"""

def with_normalized_strings_in_filter(fn):
@wraps(fn)
def wrapper(spec, sort, fields, as_class):
print(sort)
return fn(spec, _normalize_strings(sort), fields, as_class)

return wrapper

collection._get_dataset = with_normalized_strings_in_filter(
collection._get_dataset,
)

return collection


def _patch_collection_internals(collection):
if getattr(collection, '_patched_by_mongomock_motor', False):
return collection
Expand Down

0 comments on commit 0abb97a

Please sign in to comment.