Skip to content

Mypy is reporting incompatible type for @task with arguments #16769

@dgarros

Description

@dgarros

Bug summary

After upgrading to 3.1.13 from 3.0.11, mypy is reporting an incompatible type error for @task with some arguments defined at the decorator level (in my case the @task has name and task_run_name defined)

Without the arguments on the decorator, the error is not present.

backend/infrahub/git/integrator.py:869: error: Argument 1 has incompatible type
"Callable[[InfrahubRepositoryIntegrator, str, Module, str, Any], Coroutine[Any, Any, list[TransformPythonInformation]]]";
expected
"Callable[[VarArg(Never), KwArg(Never)], Coroutine[Any, Any, list[TransformPythonInformation]]]"
 [arg-type]
        @task(name="python-transform-get", task_run_name="Get Python Trans...
         ^

Version info

Version:             3.1.13
API version:         0.8.4
Python version:      3.12.7
Git commit:          16e85ce3
Built:               Fri, Jan 17, 2025 8:46 AM
OS/Arch:             darwin/arm64
Profile:             default
Server type:         server
Pydantic version:    2.10.5

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions