10BC0 chore(trainer): Use explicit exception chaining by andreyvelich · Pull Request #80 · kubeflow/sdk · GitHub
[go: up one dir, main page]

Skip to content

Conversation

andreyvelich
Copy link
Member
@andreyvelich andreyvelich commented Aug 30, 2025

I updated exception handling to use explicit exception chaining via raise ... from e.
This ensures that the original exception is preserved and clearly visible in tracebacks.

try:
    TrainerClient().get_job(name="test")
except Exception as e:
    print(e.__cause__)

Without this change it prints None, but it should print:

(404)
Reason: Not Found
...

Also, I updated a few docstrings

/assign @astefanutti @kramaranya @szaher @Electronic-Waste

10000

@coveralls
Copy link
coveralls commented Aug 30, 2025

Pull Request Test Coverage Report for Build 17350456628

Details

  • 16 of 23 (69.57%) changed or added relevant lines in 2 files are covered.
  • 2 unchanged lines in 1 file lost coverage.
  • Overall coverage remained the same at 65.033%

Changes Missing Coverage Covered Lines Changed/Added Lines %
kubeflow/trainer/utils/utils.py 1 2 50.0%
kubeflow/trainer/backends/kubernetes/backend.py 15 21 71.43%
Files with Coverage Reduction New Missed Lines %
kubeflow/trainer/backends/kubernetes/backend.py 2 70.56%
Totals Coverage Status
Change from base Build 17349568399: 0.0%
Covered Lines: 292
Relevant Lines: 449

💛 - Coveralls

Signed-off-by: Andrey Velichkevich <andrey.velichkevich@gmail.com>
Copy link
Contributor
@kramaranya kramaranya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @andreyvelich!
Would you mind updating types.py, utils.py and backend_test.py to use built-in dict instead of Dict?

andreyvelich and others added 2 commits August 31, 2025 01:34
Co-authored-by: Anya Kramar <akramar@redhat.com>
Signed-off-by: Andrey Velichkevich <andrey.velichkevich@gmail.com>
Signed-off-by: Andrey Velichkevich <andrey.velichkevich@gmail.com>
@kramaranya
Copy link
Contributor

Thank you!
/lgtm

@google-oss-prow google-oss-prow bot added the lgtm label Aug 31, 2025
@andreyvelich
Copy link
Member Author

/approve

Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: andreyvelich

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@google-oss-prow google-oss-prow bot merged commit f342acd into kubeflow:main Sep 1, 2025
9 checks passed
@google-oss-prow google-oss-prow bot added this to the v0.1 milestone Sep 1, 2025
@andreyvelich andreyvelich deleted the from-exception branch September 1, 2025 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants
0