Completed as per !4374 (merged)
Tan Le (19aa4218) at 17 Mar 14:17
chore(mypy): fix mypy type errors
Addressed in 3ef1db44
Addressed in 3ef1db44
@HongtaoYang I haven't seen this error before. Can you share which command was used so I can try to reproduce on my end?
Tan Le (ca09f9b6) at 17 Mar 10:20
chore(mypy): fix mypy type errors
Scopeshould work fine as it's the base type that includes all the necessary ASGI scope information.
No, it is not for WWWScope in uvicorn lib.
@GitLabDuo This is unfortunate but the only option I can think of given the signature of the get_path_with_query_string function.
env:
executor_type: "remote"
timeout: 10
suggestion: It does not seem that we need this ignore marker
timeout=executor_yaml_config.params.timeout,suggestion (non-blocking): Could we also add this to the issue-to-mr.yaml?
Tan Le (0044ac0b) at 17 Mar 05:56
Tan Le (adced3d5) at 17 Mar 05:56
Merge branch 'ankit.panchal/improve-internal-events-delivery' into ...
... and 1 more commit
Summary
related to https://gitlab.com/gitlab-org/gitlab/-/issues/586326#note_3135859719
Numbered steps to set up and validate the change are strongly suggested.
This removes mypy errors in the following files.
ai_gateway/api/middleware/base.pyai_gateway/code_suggestions/processing/ops.pyai_gateway/instrumentators/model_requests.pyai_gateway/integrations/amazon_q/test_chat.py$ make check-mypy
--snip--
ai_gateway/code_suggestions/processing/ops.py:312: error: Argument 1 to "map" has incompatible type "type[tuple[_T_co, ...]]"; expected "Callable[[ndarray[tuple[Any, ...], dtype[signedinteger[_32Bit | _64Bit]]]], ndarray[tuple[Any, ...], dtype[signedinteger[_32Bit | _64Bit]]]]" [arg-type]
ai_gateway/code_suggestions/processing/ops.py:314: error: Incompatible return value type (got "list[ndarray[tuple[Any, ...], dtype[signedinteger[_32Bit | _64Bit]]]]", expected "list[tuple[Any, ...]]") [return-value]
ai_gateway/api/middleware/base.py:80: error: Argument 1 to "float" has incompatible type "str | None"; expected "str | Buffer | SupportsFloat | SupportsIndex" [arg-type]
ai_gateway/api/middleware/base.py:111: error: Incompatible types in assignment (expression has type "Any | BaseExceptionGroup[Any]", variable has type "Exception") [assignment]
ai_gateway/api/middleware/base.py:120: error: Argument 1 to "get_path_with_query_string" has incompatible type "MutableMapping[str, Any]"; expected "HTTPScope | WebSocketScope" [arg-type]
ai_gateway/api/middleware/base.py:121: error: Item "None" of "Address | None" has no attribute "host" [union-attr]
ai_gateway/api/middleware/base.py:122: error: Item "None" of "Address | None" has no attribute "port" [union-attr]
ai_gateway/instrumentators/model_requests.py:165: error: Incompatible types in assignment (expression has type "float", variable has type "None") [assignment]
ai_gateway/instrumentators/model_requests.py:278: error: Unsupported operand types for - ("float" and "None") [operator]
ai_gateway/integrations/amazon_q/test_chat.py:140: error: Need type annotation for "event" [var-annotated]
ai_gateway/integrations/amazon_q/test_chat.py:253: error: Missing named argument "shape" for "ReferenceSpan" [call-arg]
ai_gateway/integrations/amazon_q/test_chat.py:346: error: Argument after ** must be a mapping, not "Collection[str]" [arg-type]
ai_gateway/integrations/amazon_q/test_chat.py:381: error: Dict entry 0 has incompatible type "str": "str"; expected "str": "dict[str, str]" [dict-item]
ai_gateway/integrations/amazon_q/test_chat.py:382: error: Dict entry 1 has incompatible type "str": "str"; expected "str": "dict[str, str]" [dict-item]
ai_gateway/integrations/amazon_q/test_chat.py:383: error: Dict entry 2 has incompatible type "str": "str"; expected "str": "dict[str, str]" [dict-item]
ai_gateway/integrations/amazon_q/test_chat.py:384: error: Dict entry 3 has incompatible type "str": "str"; expected "str": "dict[str, str]" [dict-item]
Found 16 errors in 4 files (checked 927 source files)
make: *** [Makefile:226: check-mypy] Error 1
Numbered steps to set up and validate the change are strongly suggested.
Tan Le (dd5aa2a9) at 17 Mar 05:45
chore(mypy): reduce mypy errors