-
Notifications
You must be signed in to change notification settings - Fork 77
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.
Description
Issue
- This is a follow-up to #986 (closed). Retesting the recent
google-cloud-documentai==1.5.0version, the issue is still present. - This code is valid:
import google.cloud.documentai_v1 as documentai client_options = dict(api_endpoint="eu-documentai.googleapis.com") client = documentai.DocumentProcessorServiceClient(client_options=client_options) - But it triggers the following type checker warning:
Argument of type "dict[str, str]" cannot be assigned to parameter "client_options" of type "ClientOptions | None" in function "__init__" Type "dict[str, str]" cannot be assigned to type "ClientOptions | None" "dict[str, str]" is incompatible with "ClientOptions" - If you check the source,
client_optionscan be a dict, yet its declaration says otherwise:def __init__( ... client_options: Optional[client_options_lib.ClientOptions] = None, ... ) -> None: ... if isinstance(client_options, dict): client_options = client_options_lib.from_dict(client_options)
Expected
def __init__(
...
client_options: Union[client_options_lib.ClientOptions, dict, None] = None,
...
) -> None:
...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.