-
Notifications
You must be signed in to change notification settings - Fork 347
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat: Add samples for get execution input and output artifacts (#1585)
- Loading branch information
1 parent
7e6b60f
commit eb5a4b6
Showing
4 changed files
with
102 additions
and
0 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
samples/model-builder/experiment_tracking/get_execution_input_artifacts_sample.py
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Copyright 2022 Google LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# https://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
from google.cloud import aiplatform | ||
|
||
|
||
# [START aiplatform_sdk_get_execution_input_artifacts_sample] | ||
def get_execution_input_artifacts_sample( | ||
execution: aiplatform.Execution | ||
): | ||
return execution.get_input_artifacts() | ||
|
||
# [END aiplatform_sdk_get_execution_input_artifacts_sample] |
27 changes: 27 additions & 0 deletions
27
samples/model-builder/experiment_tracking/get_execution_input_artifacts_sample_test.py
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Copyright 2022 Google LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# https://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
import get_execution_input_artifacts_sample | ||
from google.cloud import aiplatform | ||
|
||
|
||
def test_aiplatform_sdk_get_execution_input_artifacts_sample( | ||
mock_get_execution | ||
): | ||
exc = aiplatform.Execution() | ||
get_execution_input_artifacts_sample.get_execution_input_artifacts_sample( | ||
execution=exc | ||
) | ||
|
||
exc.get_input_artifacts.assert_called_with() |
24 changes: 24 additions & 0 deletions
24
samples/model-builder/experiment_tracking/get_execution_output_artifacts_sample.py
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Copyright 2022 Google LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# https://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
from google.cloud import aiplatform | ||
|
||
|
||
# [START aiplatform_sdk_get_execution_output_artifacts_sample] | ||
def get_execution_output_artifacts_sample( | ||
execution: aiplatform.Execution | ||
): | ||
return execution.get_output_artifacts() | ||
|
||
# [END aiplatform_sdk_get_execution_output_artifacts_sample] |
27 changes: 27 additions & 0 deletions
27
samples/model-builder/experiment_tracking/get_execution_output_artifacts_sample_test.py
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Copyright 2022 Google LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# https://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
import get_execution_output_artifacts_sample | ||
from google.cloud import aiplatform | ||
|
||
|
||
def test_aiplatform_sdk_get_execution_output_artifacts_sample( | ||
mock_get_execution | ||
): | ||
exc = aiplatform.Execution() | ||
get_execution_output_artifacts_sample.get_execution_output_artifacts_sample( | ||
execution=exc | ||
) | ||
|
||
exc.get_output_artifacts.assert_called_with() |