Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Housekeeping] mypy flytekit cleanup #1030

Closed
Tracked by #2917
wild-endeavor opened this issue May 13, 2021 · 11 comments · Fixed by flyteorg/flytekit#1313
Closed
Tracked by #2917

[Housekeeping] mypy flytekit cleanup #1030

wild-endeavor opened this issue May 13, 2021 · 11 comments · Fixed by flyteorg/flytekit#1313
Assignees
Labels
flytekit FlyteKit Python related issue good first issue Good for newcomers hacktoberfest housekeeping Issues that help maintain flyte and keep it tech-debt free
Milestone

Comments

@wild-endeavor
Copy link
Contributor

Describe the Issue
Wholesale cleanup of mypy warnings and errors in flytekit. Larger items like tuple support should have standalone tickets created.

What if we do not do this?
Flytekit remains unpolished.

Related component
flytekit

@wild-endeavor wild-endeavor added the housekeeping Issues that help maintain flyte and keep it tech-debt free label May 13, 2021
@wild-endeavor wild-endeavor changed the title [Housekeeping] mypy [Housekeeping] mypy flytekit cleanup May 13, 2021
@wild-endeavor wild-endeavor added flytekit FlyteKit Python related issue good first issue Good for newcomers labels May 13, 2021
@pingsutw
Copy link
Member

pingsutw commented Sep 3, 2021

@aeioulisa
Copy link
Member

pls assign me I would like to work on this

@pingsutw pingsutw assigned pingsutw and aeioulisa and unassigned pingsutw Nov 18, 2021
@samhita-alla
Copy link
Contributor

@wild-endeavor @pingsutw, has the issue been resolved?

@ryankarlos
Copy link

ryankarlos commented Oct 18, 2022

@samhita-alla is this issue still open - if so, I don;t mind fixing a few of these for hacktoberfest.

Also, i can see some issues #1427 #1447 related to this closed, with associate PR merged in.a year ago but i can still see some mypy errors related to Incompatible types - im presuming these are from more recent merges ? Please let me know if I have misunderstood.

$ make test | grep "Incompatible"
flytekit/core/tracker.py:232: error: Incompatible types in assignment (expression has type Module, variable has type "Union[Callable[..., Any], TrackedInstance]")
flytekit/core/tracker.py:234: error: Incompatible types in assignment (expression has type "Optional[Module]", variable has type Module)
flytekit/core/checkpointer.py:114: error: Incompatible types in assignment (expression has type "Path", variable has type "None")
flytekit/core/checkpointer.py:158: error: Incompatible types in assignment (expression has type "BufferedReader", variable has type "BytesIO")
flytekit/core/context_manager.py:95: error: Incompatible types in assignment (expression has type "Optional[datetime]", variable has type "datetime")
flytekit/core/context_manager.py:96: error: Incompatible types in assignment (expression has type "Optional[AutoDeletingTempDir]", variable has type "Union[PathLike[Any], AutoDeletingTempDir]")
flytekit/core/context_manager.py:98: error: Incompatible types in assignment (expression has type "Optional[Logger]", variable has type "Logger")
flytekit/core/context_manager.py:102: error: Incompatible types in assignment (expression has type "Optional[str]", variable has type "str")
flytekit/core/type_engine.py:408: error: Incompatible return value type (got "List[Any]", expected "T")
flytekit/core/type_engine.py:411: error: Incompatible return value type (got "Dict[Any, Any]", expected "T")
flytekit/core/type_engine.py:1125: error: Incompatible return value type (got "object", expected "type")
flytekit/core/type_engine.py:1154: error: Incompatible return value type (got "Tuple[Any, ...]", expected "Tuple[Optional[type], Optional[type]]")
flytekit/core/type_engine.py:1228: error: Incompatible return value type (got "Type[Dict[Any, Any]]", expected "Type[T]")
flytekit/core/type_engine.py:1368: error: Incompatible return value type (got "object", expected "Type[T]")
flytekit/core/type_engine.py:1371: error: Incompatible return value type (got "Type[str]", expected "Type[T]")
flytekit/core/type_engine.py:1373: error: Incompatible return value type (got "Type[int]", expected "Type[T]")
flytekit/core/type_engine.py:1375: error: Incompatible return value type (got "Type[bool]", expected "Type[T]")
flytekit/core/type_engine.py:1378: error: Incompatible return value type (got "Type[int]", expected "Type[T]")
flytekit/core/type_engine.py:1380: error: Incompatible return value type (got "Type[float]", expected "Type[T]")
flytekit/core/type_engine.py:1381: error: Incompatible return value type (got "Type[str]", expected "Type[T]")
flytekit/core/interface.py:267: error: Incompatible return value type (got "object", expected "Type[T]")
flytekit/core/interface.py:270: error: Incompatible return value type (got "object", expected "Type[T]")
flytekit/core/interface.py:299: error: Incompatible types in assignment (expression has type "Parameter", variable has type "Type[Any]")
flytekit/core/promise.py:676: error: Incompatible return value type (got "Optional[NodeOutput]", expected "NodeOutput")
flytekit/core/base_task.py:281: error: Incompatible return value type (got "Union[Tuple[Promise], Promise, None]", expected "Union[Tuple[Promise], Promise, VoidPromise]")
flytekit/core/python_customized_container_task.py:108: error: Incompatible types in assignment (expression has type "Optional[Dict[str, str]]", variable has type "Dict[str, str]")
flytekit/types/file/file.py:30: error: Incompatible types in assignment (expression has type "None", variable has type "Union[str, PathLike[Any]]")
flytekit/types/file/file.py:209: error: Incompatible return value type (got "Optional[PathLike[Any]]", expected "PathLike[Any]")
flytekit/types/directory/types.py:29: error: Incompatible types in assignment (expression has type "None", variable has type "Unio

@pingsutw
Copy link
Member

Thank you @ryankarlos, we still have some linting errors which aren't fixed yet. Feel free to open a pr in the flytekit repo 😄

@ryankarlos
Copy link

Thanks @pingsutw , ive run make lint in the flytekit repo - im assuming i can attempt to fix any of these or do you want to focus on AttributeError, Class name not defined etc following on from the previous closed issues linked in this issue ?
Also, ok if i split these between multiple PRs ?

@pingsutw
Copy link
Member

yeah, I prefer to split these between multiple PRs, which will be easy to review.

@ryankarlos
Copy link

ryankarlos commented Oct 19, 2022

thanks im working on a PR. do you labelling this issue with hacktoberfest label 😄 @samhita-alla

@samhita-alla
Copy link
Contributor

@pingsutw, is it okay to close this PR or are there any more fixes that need to go in?

@pingsutw
Copy link
Member

Still have some mypy errors needed to be fixed. @ryankarlos is working on it.

@pingsutw pingsutw reopened this Oct 31, 2022
@ryankarlos
Copy link

ryankarlos commented Oct 31, 2022

@pingsutw I may not get around to fixing the others immediately - as got a few other PRs to complete as well. Feel free to unassign me if someone else wants to tackle some of the remaining.

@cosmicBboy cosmicBboy added this to the 1.4.0 milestone Jan 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flytekit FlyteKit Python related issue good first issue Good for newcomers hacktoberfest housekeeping Issues that help maintain flyte and keep it tech-debt free
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants