fix(trainer): add missing type hints to LocalJob class#342
fix(trainer): add missing type hints to LocalJob class#342codebyNJ wants to merge 2 commits intokubeflow:mainfrom
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
🎉 Welcome to the Kubeflow SDK! 🎉 Thanks for opening your first PR! We're happy to have you as part of our community 🚀 Here's what happens next:
Join the community:
Feel free to ask questions in the comments if you need any help or clarification! |
There was a problem hiding this comment.
Pull request overview
Adds missing type annotations and updates docstrings for LocalJob in the localprocess backend to better align with the repo’s typed-Python guidelines and improve readability/IDE support.
Changes:
- Added
from __future__ import annotationsand updated imports to support forward references and iterator typing. - Added/updated type hints for
LocalJob.__init__, properties, and methods (including fixingtuple[str]totuple[str, ...]). - Refreshed docstrings to avoid redundant type info and better describe behavior.
Signed-off-by: codebyNJ <nijeesh10th@gmail.com>
…y: Nijeesh NJ <nijeesh10th@gmail.com> Signed-off-by: codebyNJ <nijeesh10th@gmail.com>
bfdd287 to
4bed199
Compare
What this PR does / why we need it:
Adds comprehensive type hints and improves documentation for the
LocalJobclass in the localprocess backend. The class was missing type annotations on__init__parameters (name,execution_dir,env,dependencies), all properties (stdout,success,status,returncode,creation_time,completion_time), and methods (run,cancel,stream_logs). Docstrings also had redundant type info in Args sections instead of relying on the signature annotations.This aligns the code with the project's
AGENTS.mdguidelines:Changes:
__init__parameters (notablyname: str,execution_dir: str | None,env: dict[str, str] | None,dependencies: list[LocalJob] | None)tuple[str]to correcttuple[str, ...]for variadic tuple typefrom __future__ import annotationsfor forward reference supportIteratorfromcollections.abcforstream_logsreturn typeChecklist:
localprocess/backend_test.py)