cognite-sdk-python icon indicating copy to clipboard operation
cognite-sdk-python copied to clipboard

Using `mypy` with Python >= 3.9 reports errors

Open haakonvt opened this issue 1 year ago • 0 comments

cognite/client/utils/_concurrency.py:229: error: Incompatible types in
assignment (expression has type "ThreadPoolExecutor", variable has type
"TaskExecutor")  [assignment]
                executor: TaskExecutor = _THREAD_POOL_EXECUTOR_SINGLETON
                                         ^
cognite/client/utils/_concurrency.py:229: note: Following member(s) of "ThreadPoolExecutor" have conflicts:
cognite/client/utils/_concurrency.py:229: note:     Expected:
cognite/client/utils/_concurrency.py:229: note:         def [T_Result] submit(self, fn: Callable[..., T_Result], *args: Any, **kwargs: Any) -> TaskFuture[T_Result]
cognite/client/utils/_concurrency.py:229: note:     Got:
cognite/client/utils/_concurrency.py:229: note:         def [_P`-1, _T] submit(self, Callable[_P, _T], *args: _P.args, **kwargs: _P.kwargs) -> Future[_T]
cognite/client/utils/_concurrency.py:232: error: Incompatible types in
assignment (expression has type "ThreadPoolExecutor", variable has type
"TaskExecutor")  [assignment]
                executor = _THREAD_POOL_EXECUTOR_SINGLETON = ThreadPoolExe...
                ^
cognite/client/utils/_concurrency.py:232: note: Following member(s) of "ThreadPoolExecutor" have conflicts:
cognite/client/utils/_concurrency.py:232: note:     Expected:
cognite/client/utils/_concurrency.py:232: note:         def [T_Result] submit(self, fn: Callable[..., T_Result], *args: Any, **kwargs: Any) -> TaskFuture[T_Result]
cognite/client/utils/_concurrency.py:232: note:     Got:
cognite/client/utils/_concurrency.py:232: note:         def [_P`-1, _T] submit(self, Callable[_P, _T], *args: _P.args, **kwargs: _P.kwargs) -> Future[_T]
Found 2 errors in 1 file (checked 80 source files)
image

haakonvt avatar Mar 14 '23 13:03 haakonvt