From 83b2a6631f584eedd5f630bff6ee5aa17947494c Mon Sep 17 00:00:00 2001 From: Sourcery AI Date: Mon, 27 Nov 2023 12:26:27 +0000 Subject: [PATCH] 'Refactored by Sourcery' --- pymongo_wrapper/pipeline.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pymongo_wrapper/pipeline.py b/pymongo_wrapper/pipeline.py index c9dd7ff..d18ca9f 100644 --- a/pymongo_wrapper/pipeline.py +++ b/pymongo_wrapper/pipeline.py @@ -62,9 +62,7 @@ def group(self, groupby: List[Union[str, Dict[str, Any]]], **kwargs) -> 'Pipelin def sort(self, sortby: Union[List[Tuple[str, int]], Tuple[str, int]]) -> 'PipelineBuilder': if isinstance(sortby, tuple): sortby = [sortby] - sort_dict = {} - for field, direction in sortby: - sort_dict[field] = direction + sort_dict = dict(sortby) self.pipeline.append({'$sort': sort_dict}) return self