<#1290 Fix/ty type checker signatures> Pull reques...
# flyte-github
a
#1290 Fix/ty type checker signatures Pull request opened by falloficaruss Description This PR resolves type checking compatibility issues between the Flyte V2 SDK and the Astral
ty
type checker. Previously,
ty
struggled to correctly resolve
@overload
signatures for key public APIs due to unbound generic parameters and type mapping mismatches. By refining these function signatures, we achieve type-checking parity with MyPy and improve overall SDK type safety. Additionally, we integrate
ty
into the CI pipeline to prevent future regressions while maintaining existing MyPy compatibility. Changes Made • Overload Signatures Refined: Fixed
@overload
resolution issues in
Syncify.__call__
(
flyte/syncify/_api.py
),
TaskTemplate.aio
&
__call__
(
flyte/_task.py
), and
_Mapper.__call__
(
flyte/_map.py
). •
ty
Configuration
: Added
[tool.ty.rules]
block in
pyproject.toml
to customize
ty
diagnostics (warnings for unused ignore comments, erroring on missing attributes/imports). • Makefile Target: Added a
make ty
command to run the
ty
checker against
examples/basics/hello_v2.py
. • CI Integration: Introduced a
ty-check
job in
.github/workflows/lint.yml
that installs
ty
and runs the type checker during the linting phase to prevent future regressions. Related Issues Closes flyteorg/flyte#7655 Testing • Tested locally via
make ty
and
make mypy
• Automated CI
ty-check
and
mypy
jobs are passing successfully. flyteorg/flyte-sdk