Skip to content

Incorrect type hints in collection() #289

@mbrancato

Description

@mbrancato

Environment details

  • OS type and version: MacOS
  • Python version: Python 3.7.7
  • google-cloud-firestore version: 2.0.2

At some point recently the type hints for for Client().collection() methods were changed, and they do not reflect examples or the docs. I'm getting type hint warnings.

def collection(self, *collection_path: Tuple[str]) -> CollectionReference:

Should the type hint be changed to simply str ? All the comments and docs show these:

client.collection('top')
client.collection('mydocs/doc/subcol')
client.collection('mydocs', 'doc', 'subcol')

None of these are Tuple[str]. The argument *collection_path will produce a tuple when called, but it is called with strings.

Metadata

Metadata

Assignees

Labels

api: firestoreIssues related to the googleapis/python-firestore API.help wantedWe'd love to have community involvement on this issue.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