Skip to content

Commit eb5a4b6

Browse files
authored
Feat: Add samples for get execution input and output artifacts (#1585)
1 parent 7e6b60f commit eb5a4b6

4 files changed

+102
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Copyright 2022 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# https://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
from google.cloud import aiplatform
16+
17+
18+
# [START aiplatform_sdk_get_execution_input_artifacts_sample]
19+
def get_execution_input_artifacts_sample(
20+
execution: aiplatform.Execution
21+
):
22+
return execution.get_input_artifacts()
23+
24+
# [END aiplatform_sdk_get_execution_input_artifacts_sample]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Copyright 2022 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# https://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
import get_execution_input_artifacts_sample
16+
from google.cloud import aiplatform
17+
18+
19+
def test_aiplatform_sdk_get_execution_input_artifacts_sample(
20+
mock_get_execution
21+
):
22+
exc = aiplatform.Execution()
23+
get_execution_input_artifacts_sample.get_execution_input_artifacts_sample(
24+
execution=exc
25+
)
26+
27+
exc.get_input_artifacts.assert_called_with()
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Copyright 2022 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# https://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
from google.cloud import aiplatform
16+
17+
18+
# [START aiplatform_sdk_get_execution_output_artifacts_sample]
19+
def get_execution_output_artifacts_sample(
20+
execution: aiplatform.Execution
21+
):
22+
return execution.get_output_artifacts()
23+
24+
# [END aiplatform_sdk_get_execution_output_artifacts_sample]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Copyright 2022 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# https://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
import get_execution_output_artifacts_sample
16+
from google.cloud import aiplatform
17+
18+
19+
def test_aiplatform_sdk_get_execution_output_artifacts_sample(
20+
mock_get_execution
21+
):
22+
exc = aiplatform.Execution()
23+
get_execution_output_artifacts_sample.get_execution_output_artifacts_sample(
24+
execution=exc
25+
)
26+
27+
exc.get_output_artifacts.assert_called_with()

0 commit comments

Comments
 (0)