Skip to content
This repository was archived by the owner on Aug 30, 2026. It is now read-only.
This repository was archived by the owner on Aug 30, 2026. It is now read-only.

start_after(None) and the like should be a no-op and shouldn't result in an error #439

Closed

Description

@crwilcox

Attempting to execute a query with a start_after(None) will fail. This should be a no-op.

client = firestore.Client()
col = client.collection('0-test-collection-0')
query = col.order_by('__name__').start_after(None)
for doc in query.stream():
    print(doc)
  File "/Users/crwilcox/scratch/python-firestore/venv/lib/python3.8/site-packages/google/cloud/firestore_v1/base_query.py", line 758, in _normalize_cursor
    if len(document_fields) > len(orders):
TypeError: object of type 'NoneType' has no len()

I'd expect start_after, start_at, end_at, end_before to manage a None field handed to them.

Activity

  1. added
    priority: p2Moderately-important priority. Fix may not be included in next release.
    type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.
    on Sep 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    api: firestoreIssues related to the googleapis/python-firestore API.priority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions