-
Notifications
You must be signed in to change notification settings - Fork 77
Closed
Labels
priority: p3Desirable enhancement or fix. May not be included in next release.Desirable enhancement or fix. May not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.type: docsImprovement to the documentation for an API.Improvement to the documentation for an API.
Description
Issue
Some methods support dictionaries but this is not reflected in the type annotations.
Example
This working code triggers a "dict[str, str]" cannot be assigned to type "ClientOptions | None" warning:
import google.cloud.documentai_v1 as documentai
client_options = dict(api_endpoint="eu-documentai.googleapis.com")
client = documentai.DocumentProcessorServiceClient(client_options=client_options)
In the client library generated source code, dictionaries are supported:
if isinstance(client_options, dict):
client_options = client_options_lib.from_dict(client_options)
but the typing is incomplete:
client_options: Optional[client_options_lib.ClientOptions] = None,
Note: This is just an example. There are multiple similar occurrences in different client libraries (if isinstance(xxx, dict) could be a marker to find them).
Metadata
Metadata
Assignees
Labels
priority: p3Desirable enhancement or fix. May not be included in next release.Desirable enhancement or fix. May not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.type: docsImprovement to the documentation for an API.Improvement to the documentation for an API.