-
Notifications
You must be signed in to change notification settings - Fork 348
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
feat: Add done method for pipeline, training, and batch prediction jobs #1062
Conversation
network=_TEST_NETWORK, | ||
) | ||
|
||
mock_pipeline_service_create.assert_called_once_with( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can skip the assertions that are tested in the other unit test.
google/cloud/aiplatform/base.py
Outdated
|
||
|
||
class StatefulResource(DoneMixin): | ||
"""Extends DoneMixin to check whether a job returning a stateful resource has compelted.""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"""Extends DoneMixin to check whether a job returning a stateful resource has compelted.""" | |
"""Extends DoneMixin to check whether a job returning a stateful resource has completed.""" |
google/cloud/aiplatform/base.py
Outdated
"""Extends StatefulResource to include a check for self._gca_resource.""" | ||
|
||
def done(self) -> bool: | ||
if self._gca_resource: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Related to the test below that throws if run
has not been invoked, which is surfaced from the state
call above. An alternative is to always return False
in those cases as well. This check can be updated to:
if self._gca_resource: | |
if self._gca_resource and self._gca_resource.name: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Great work!
Added a done method via a
DoneMixin
class to check the status of long running jobs (returns True or False based on job state):PipelineJob
,_Job
, and_TrainingJob
aiplatform/tests/system/aiplatform/test_e2e_tabular.py
tests/unit/aiplatform/test_pipeline_jobs.py
test_jobs
andtest_training_jobs
Fixes b/215396514