8000 Strict python typing throws error on `get()` method for being partially unknown · Issue #974 · googleapis/python-firestore · GitHub
[go: up one dir, main page]

Skip to content
Strict python typing throws error on get() method for being partially unknown #974
@Stak-Michael-Grant

Description

@Stak-Michael-Grant

Using strict type check linting in my IDE throws errors when calling the get method on an AsyncDocumentReference type. This comes from the above code, in which transaction is set to None without explicitly declaring its type. This seems like an easy fix, even if that is as simple as transaction: Any | None = None, although probably not recommended. This is not the only place using the google cloud python sdk. In fact anytime I'm calling a method on an AsyncDocumentRerference, or AysncCollectionReference, I find myself needing a # type: ignore following it just to get rid of my linter yelling at me.

It would be nice to have more explicit complete typing on these methods, so I'm bringing it up in an issue and see where it goes. Below is a screenshot of the error that I get for this specific instance, but can be extrapolated to any method/function that is not being strict in their param type definitions.

Screenshot 2024-10-06 at 12 17 07 PM

Metadata

Metadata

Assignees

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

    0