You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 30, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 30, 2026. It is now read-only.
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.
Per the implementation, the collection_path argument can be either a single, slash-delimited path string, or a Tuple[str]. See the _path_helper function, which also has an incorrect typespec for its argument.
A correction: the leading asterisk (*collection_path) means that the value received by the function will always be a tuple, and we require that the elements of the tuple be strings. The caller may pass a single string, e.g. client.collection("mydocs/doc/subcol"), which will be split on the slashes, exactly as if the caller had passed client.collection("mydocs", "doc", "subcol"). That example is from the docstring of Client.collection.
Activity
tseaver commentedon Feb 2, 2021
Per the implementation, the
collection_pathargument can be either a single, slash-delimited path string, or aTuple[str]. See the_path_helperfunction, which also has an incorrect typespec for its argument.tseaver commentedon Feb 2, 2021
A correction: the leading asterisk (
*collection_path) means that the value received by the function will always be a tuple, and we require that the elements of the tuple be strings. The caller may pass a single string, e.g.client.collection("mydocs/doc/subcol"), which will be split on the slashes, exactly as if the caller had passedclient.collection("mydocs", "doc", "subcol"). That example is from the docstring ofClient.collection.tseaver commentedon Feb 2, 2021
OK, looking at PEP 484, it appears that
*argsshould be typed as the type of one element.fix: use correct type hint for '*path' args.
fix: use correct type hint for '*path' args
fix: use correct type hint for '*path' args (#300)