Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type errors in quantum engine api code #6638

Closed
maffoo opened this issue Jun 7, 2024 · 0 comments · Fixed by #6640
Closed

Type errors in quantum engine api code #6638

maffoo opened this issue Jun 7, 2024 · 0 comments · Fixed by #6640
Assignees
Labels
kind/bug-report Something doesn't seem to work.

Comments

@maffoo
Copy link
Contributor

maffoo commented Jun 7, 2024

CI failed on #6637 due to type errors in quantum engine service code, even though the PR did not touch any of this code:

cirq-google/cirq_google/cloud/quantum_v1alpha1/services/quantum_engine_service/transports/base.py:26: error: Unused "type: ignore" comment
cirq-google/cirq_google/cloud/quantum_v1alpha1/services/quantum_engine_service/transports/base.py:51: error: Incompatible default for argument "credentials" (default has type "None", argument has type "Credentials")  [assignment]
cirq-google/cirq_google/cloud/quantum_v1alpha1/services/quantum_engine_service/transports/base.py:51: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True
cirq-google/cirq_google/cloud/quantum_v1alpha1/services/quantum_engine_service/transports/base.py:51: note: Use https://github.com/hauntsaninja/no_implicit_optional to automatically upgrade your codebase
cirq-google/cirq_google/cloud/quantum_v1alpha1/services/quantum_engine_service/transports/grpc.py:1[23](https://github.com/quantumlib/Cirq/actions/runs/9411740279/job/25925500812?pr=6637#step:5:24): error: Incompatible types in assignment (expression has type "bool", variable has type "Optional[Credentials]")  [assignment]
cirq-google/cirq_google/cloud/quantum_v1alpha1/services/quantum_engine_service/transports/grpc.py:152: error: Argument "credentials" to "__init__" of "QuantumEngineServiceTransport" has incompatible type "Optional[Credentials]"; expected "Credentials"  [arg-type]
cirq-google/cirq_google/cloud/quantum_v1alpha1/services/quantum_engine_service/transports/grpc_asyncio.py:54: error: Incompatible default for argument "credentials" (default has type "None", argument has type "Credentials")  [assignment]
cirq-google/cirq_google/cloud/quantum_v1alpha1/services/quantum_engine_service/transports/grpc_asyncio.py:54: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True
cirq-google/cirq_google/cloud/quantum_v1alpha1/services/quantum_engine_service/transports/grpc_asyncio.py:54: note: Use https://github.com/hauntsaninja/no_implicit_optional to automatically upgrade your codebase
cirq-google/cirq_google/cloud/quantum_v1alpha1/services/quantum_engine_service/transports/grpc_asyncio.py:97: error: Incompatible default for argument "credentials" (default has type "None", argument has type "Credentials")  [assignment]
cirq-google/cirq_google/cloud/quantum_v1alpha1/services/quantum_engine_service/transports/grpc_asyncio.py:97: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True
cirq-google/cirq_google/cloud/quantum_v1alpha1/services/quantum_engine_service/transports/grpc_asyncio.py:97: note: Use https://github.com/hauntsaninja/no_implicit_optional to automatically upgrade your codebase
cirq-google/cirq_google/cloud/quantum_v1alpha1/services/quantum_engine_service/transports/grpc_asyncio.py:169: error: Incompatible types in assignment (expression has type "bool", variable has type "Credentials")  [assignment]
cirq-google/cirq_google/cloud/quantum_v1alpha1/services/quantum_engine_service/client.py:30: error: Unused "type: ignore" comment
cirq-google/cirq_google/cloud/quantum_v1alpha1/services/quantum_engine_service/client.py:411: error: Argument "credentials" to "QuantumEngineServiceTransport" has incompatible type "Optional[Credentials]"; expected "Credentials"  [arg-type]
cirq-google/cirq_google/cloud/quantum_v1alpha1/services/quantum_engine_service/async_client.py:37: error: Unused "type: ignore" comment
cirq-google/cirq_google/cloud/quantum_v1alpha1/services/quantum_engine_service/async_client.py:175: error: Incompatible default for argument "credentials" (default has type "None", argument has type "Credentials")  [assignment]
cirq-google/cirq_google/cloud/quantum_v1alpha1/services/quantum_engine_service/async_client.py:175: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True
cirq-google/cirq_google/cloud/quantum_v1alpha1/services/quantum_engine_service/async_client.py:175: note: Use https://github.com/hauntsaninja/no_implicit_optional to automatically upgrade your codebase
Found 11 errors in 5 files (checked 1106 source files)

Full CI logs are here: https://github.com/quantumlib/Cirq/actions/runs/9411740279/job/25925500812?pr=6637

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug-report Something doesn't seem to work.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants