Skip to content

Commit

Permalink
Feat: Add samples for get execution input and output artifacts (#1585)
Browse files Browse the repository at this point in the history
  • Loading branch information
SinaChavoshi authored Aug 11, 2022
1 parent 7e6b60f commit eb5a4b6
Show file tree
Hide file tree
Showing 4 changed files with 102 additions and 0 deletions.
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]
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()
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]
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()

0 comments on commit eb5a4b6

Please sign in to comment.