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.

Pylance Typing for collections #687

Description

@Sugihiru

Type hinting does not take into account default None values for most fields, which breaks Pylance linting

For example, a simple

    db.collection(f"mycollection").stream())

yields an error from Pylance

Argument of type "None" cannot be assigned to parameter "transaction" of type "Transaction" in function "stream"
  Type "None" cannot be assigned to type "Transaction"Pylance[reportGeneralTypeIssues](https://github.com/microsoft/pyright/blob/main/docs/configuration.md#reportGeneralTypeIssues)

I saw a similar error in #570, I think most of the type hinting should be reviewed.

Environment details

  • OS type and version: MacOS 12.4
  • Python version: 3.11.1
  • pip version: pip 23.0
  • google-cloud-firestore version: 2.9.1

Steps to reproduce

In VSCode :

    db.collection(f"mycollection").stream())

Activity

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.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions