omkar-foss commented on code in PR #42914:
URL: https://github.com/apache/airflow/pull/42914#discussion_r1800412509
##########
airflow/utils/api_migration.py:
##########
@@ -25,13 +25,10 @@
from typing import Callable, TypeVar
-from airflow.typing_compat import ParamSpec
-
-PS = ParamSpec("PS")
RT = TypeVar("RT")
-def mark_fastapi_migration_done(function: Callable[PS, RT]) -> Callable[PS,
RT]:
+def mark_fastapi_migration_done(function: Callable[..., RT]) -> Callable[...,
RT]:
Review Comment:
Yes sure, have added `...` in place or `PS` to accept any param, as the mypy
tests for `mark_fastapi_migration_done` had been failing when used
[here](https://github.com/apache/airflow/pull/42914/files#diff-bf872a9f63486e4349959ddd97e607b9779221bd15a049fd1b94e9276d2d0bf5R219),
with the below. If there's a better way to fix this, please let me know, will
update PR accordingly. Thanks!
```bash
...
airflow/api_connexion/endpoints/dag_endpoint.py:217: error: Argument 1 to
"mark_fastapi_migration_done" has incompatible type
"Union[Callable[[str, Any], Union[Response, tuple[object, int], Mapping[str,
Any]]], Callable[..., Any]]";
expected "Callable[[VarArg(str), KwArg(Any)], Any]" [arg-type]
@mark_fastapi_migration_done
^
Found 1 error in 1 file (checked 1046 source files)
Error 1 returned
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]