python-mock-firestore icon indicating copy to clipboard operation
python-mock-firestore copied to clipboard

Incorrect return type for collection.get() or collection.stream()

Open dibusan opened this issue 4 years ago • 0 comments

From the line

arr = self.mock_db.collection('players').stream()

I expected a return type of Iterable[DocumentSnapshot] but instead got

  <generator object CollectionReference.stream at 0x106a1d890>

My setup code:

    def setUp(self) -> None:
            self.mock_db = MockFirestore()
            self.mock_db.collection('players').add({
                'name': 'John Doe',
                'id': 'johndoe',
            })
            self.mock_db.collection('players').add({
               'name': 'Jane Doe',
               'id': 'johndoe',
            })

Screenshot of Pycharm's documentation

Screen Shot 2021-10-24 at 10 41 44 AM

dibusan avatar Oct 24 '21 17:10 dibusan