Repository navigation
fix: accept enable_preflight_validations in preview PipelineJob.submit so run() works - #7243
Open
abhishekacharya200 wants to merge 1 commit into
Conversation
…t so run() works The preview _PipelineJob inherits run() from PipelineJob, which passes enable_preflight_validations to submit(). The preview submit() had no such parameter, so every run() raised TypeError before sending a request. Add the keyword argument and set preflight_validations on the job when it is True, the same way the GA submit() does.
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.
Fixes #7242 🦕
The preview
_PipelineJobdoes not overriderun(), so it uses the GAPipelineJob.run(). Thatrun()callsself.submit(..., enable_preflight_validations=enable_preflight_validations), but the previewsubmit()has noenable_preflight_validationsparameter. So everyrun()on a preview job failed with aTypeErrorbefore sending a request, whatever value was passed. Withsync=Falsethe error happened in the background thread andwait()raised it asRuntimeError: _PipelineJob resource has not been created.This adds
enable_preflight_validationsas a keyword argument to the previewsubmit(), documented with the same wording as the GA one, and setspreflight_validationson the v1beta1 job when it isTrue, the same way the GAsubmit()does. When it isFalse, whatever__init__set is left as is, which also matches the GA behavior. The argument is keyword only, so existing positional calls to the previewsubmit()are not affected.With sockets blocked and only
create_pipeline_jobreplaced by a recorder:Before (main, 9b9f2b3):
After (this branch):
Tests: added
test_run_v1beta1_pipeline_job_passes_preflight_validations, which runs a preview job withsync=Trueandsync=Falseand with the flag on and off, and checks that the create request is sent withpreflight_validationsset to the value passed. All four cases fail on main (theTypeError, or theRuntimeErrorfromwait()) and pass with this change.tests/unit/aiplatform/test_pipeline_jobs.pyandtest_pipeline_job_schedules.pypass locally (264 passed), andflake8==6.1.0andblack==24.8.0report nothing on the changed code (black still flags the two oldersetup_methodlines in the test file that are the same on main, which I left alone).This is independent of #7240, which changes the parent, client and timeout lines further down in the same
submit(). The two branches merge cleanly in either order, and both test files pass on the merged result (266 passed).submit()docstring documents the new argument)