Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: limit data transferred as part of list_documents as we don't require field data #280

Merged
merged 3 commits into from Dec 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions google/cloud/firestore_v1/base_collection.py
Expand Up @@ -183,6 +183,10 @@ def _prep_list_documents(
"collection_id": self.id,
"page_size": page_size,
"show_missing": True,
# list_documents returns an iterator of document references, which do not
# include any fields. To save on data transfer, we can set a field_path mask
# to include no fields
"mask": {"field_paths": None},
}
kwargs = _helpers.make_retry_timeout_kwargs(retry, timeout)

Expand Down
1 change: 1 addition & 0 deletions tests/unit/v1/test_async_collection.py
Expand Up @@ -252,6 +252,7 @@ async def _next_page(self):
"collection_id": collection.id,
"page_size": page_size,
"show_missing": True,
"mask": {"field_paths": None},
},
metadata=client._rpc_metadata,
**kwargs,
Expand Down
1 change: 1 addition & 0 deletions tests/unit/v1/test_collection.py
Expand Up @@ -245,6 +245,7 @@ def _next_page(self):
"collection_id": collection.id,
"page_size": page_size,
"show_missing": True,
"mask": {"field_paths": None},
},
metadata=client._rpc_metadata,
**kwargs,
Expand Down