Repository navigation
fix(kf-tensorflow): handle RunPolicy without clean_pod_policy - #3485
Open
pcbeingused333 wants to merge 1 commit into
Open
pcbeingused333 wants to merge 1 commit into
pcbeingused333 wants to merge 1 commit into
Conversation
_convert_run_policy dereferenced clean_pod_policy.value even though the field defaults to None, so any RunPolicy that omitted it (e.g. only setting ttl_seconds_after_finished) raised AttributeError at serialization time. Guard it like the kf-pytorch and kf-mpi plugins do. Signed-off-by: Alex Castillo <alex.castillog33@gmail.com>
pcbeingused333
requested review from
cosmicbboy,
davidmirror-ops,
kumare3,
machichima,
pingsutw,
samhita-alla and
wild-endeavor
as code owners
November 5, 2026 16:25
|
Thank you for opening this pull request! 🙌 These tips will help get your PR across the finish line:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why are the changes needed?
RunPolicy.clean_pod_policyin the kf-tensorflow plugin defaults toNone, butTensorflowFunctionTask._convert_run_policyalways readrun_policy.clean_pod_policy.value. ATfJobwhoseRunPolicyleaves it unset, for exampleRunPolicy(ttl_seconds_after_finished=100), failed at serialization withAttributeError: 'NoneType' object has no attribute 'value'.What changes were proposed in this pull request?
_convert_run_policynow checks thatclean_pod_policyis set before it reads.value, as the kf-pytorch and kf-mpi plugins already do. Explicitly set values are converted as before.How was this patch tested?
Added
test_tensorflow_task_run_policy_without_clean_pod_policyinplugins/flytekit-kf-tensorflow/tests/test_tensorflow_task.py. It fails with theAttributeErrorbefore the change and passes after. The plugin's test suite passes (5 tests).Check all the applicable boxes
Disclosure: this change was prepared with an AI coding agent (Claude).