Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Expose additional attributes into Vertex SDK to close gap with GAPIC #477

Merged
merged 11 commits into from Jun 17, 2021

Conversation

vinnysenthil
Copy link
Contributor

@vinnysenthil vinnysenthil commented Jun 14, 2021

Exposes the following attributes:

Base Resource Noun

  • VertexAiResourceNoun.encryption_spec
  • VertexAiResourceNoun.labels

TrainingJob

  • _TrainingJob.start_time
  • _TrainingJob.end_time
  • _TrainingJob.error
  • _CustomTrainingJob.network

Job

  • _Job.start_time
  • _Job.end_time
  • _Job.error
  • HyperparameterTuningJob.network
  • CustomJob.network

Model

  • Model.predict_schemata
  • Model.supported_deployment_resources_types
  • Model.supported_input_storage_formats
  • Model.supported_output_storage_formats
  • Model.training_pipeline
  • Model.container_spec

Endpoint

  • Endpoint.traffic_split
  • Endpoint.network

BatchPredictionJob

  • BatchPredictionJob.output_info
  • BatchPredictionJob.partial_failures
  • BatchPredictionJob.completion_stats

Other changes

  • Dataset.__len__()
    • Removed due to error with unit tests, will add later once b/190008971 is addressed
  • _Training_Job._get_and_return_subclass()
  • Fixed CustomJob._list_method
  • Unit tests for new methods

Fixes b/185913907 馃

@product-auto-label product-auto-label bot added the api: aiplatform Issues related to the AI Platform API. label Jun 14, 2021
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Jun 14, 2021
@vinnysenthil vinnysenthil marked this pull request as ready for review June 15, 2021 00:02
@vinnysenthil vinnysenthil changed the title feat: [Work in Progress] Expose additional attributes into Vertex SDK to close gap with GAPIC feat: Expose additional attributes into Vertex SDK to close gap with GAPIC Jun 15, 2021
google/cloud/aiplatform/base.py Outdated Show resolved Hide resolved
google/cloud/aiplatform/jobs.py Outdated Show resolved Hide resolved
google/cloud/aiplatform/models.py Outdated Show resolved Hide resolved
"""Time when the Pipline or Job entered the `JOB_STATE_RUNNING` or
`PIPELINE_STATE_RUNNING` for the first time. Only for Job or Pipeline resources."""
self._sync_gca_resource()
return getattr(self._gca_resource, "start_time")
Copy link
Member

Choose a reason for hiding this comment

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

Is the getattr access pattern necessary? It seems like if the field doesn't exist in the proto, it will default to return None.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I thought about this, if we are certain the field will always be present then we should return it directly. But I went with getattr for fields that are Optional and we know won't be populated sometimes. However they do appear to default to None, any preference on your end?

google/cloud/aiplatform/models.py Outdated Show resolved Hide resolved
google/cloud/aiplatform/training_jobs.py Outdated Show resolved Hide resolved
google/cloud/aiplatform/training_jobs.py Outdated Show resolved Hide resolved
@vinnysenthil vinnysenthil added kokoro:force-run Add this label to force Kokoro to re-run the tests. and removed kokoro:force-run Add this label to force Kokoro to re-run the tests. labels Jun 16, 2021
Copy link
Contributor

@ivanmkc ivanmkc left a comment

Choose a reason for hiding this comment

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

Let's figure out the discussion on _get_and_return_subclass

google/cloud/aiplatform/models.py Show resolved Hide resolved
google/cloud/aiplatform/jobs.py Outdated Show resolved Hide resolved
google/cloud/aiplatform/jobs.py Show resolved Hide resolved
@vinnysenthil vinnysenthil merged commit 572a27c into master Jun 17, 2021
@vinnysenthil vinnysenthil deleted the add-missing-fields branch June 17, 2021 02:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: aiplatform Issues related to the AI Platform API. cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants