From c225a92e6c278ce8d6d5e8d9b6dd901f8568f289 Mon Sep 17 00:00:00 2001 From: Samuel Goldfarb Date: Thu, 8 Aug 2024 15:01:39 -0400 Subject: [PATCH] feat: add support for optional arguments in DocumentReference.get --- mockfirestore/document.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/mockfirestore/document.py b/mockfirestore/document.py index 24aa433..76ff490 100644 --- a/mockfirestore/document.py +++ b/mockfirestore/document.py @@ -1,7 +1,7 @@ from copy import deepcopy from functools import reduce import operator -from typing import List, Dict, Any +from typing import List, Dict, Any, Optional, Iterable from mockfirestore import NotFound from mockfirestore._helpers import ( Timestamp, Document, Store, get_by_path, set_by_path, delete_by_path @@ -63,7 +63,13 @@ def __init__(self, data: Store, path: List[str], def id(self): return self._path[-1] - def get(self) -> DocumentSnapshot: + def get( + self, + field_paths: Optional[Iterable[str]] = None, + transaction: Any = None, + retry: Any = None, + timeout: Optional[float] = None, + ) -> DocumentSnapshot: return DocumentSnapshot(self, get_by_path(self._data, self._path)) def delete(self):