Esempio n. 1
0
    def query_input_and_output_artifacts(self) -> Sequence[artifact._Artifact]:
        """query the input and output artifacts connected to the execution.

        Returns:
              A Sequence of _Artifacts
        """

        try:
            artifacts = self.api_client.query_execution_inputs_and_outputs(
                execution=self.resource_name).artifacts
        except exceptions.NotFound:
            return []

        return [
            artifact._Artifact(
                resource=metadata_artifact,
                project=self.project,
                location=self.location,
                credentials=self.credentials,
            ) for metadata_artifact in artifacts
        ]
 def test_init_artifact_with_id(self, get_artifact_mock):
     aiplatform.init(project=_TEST_PROJECT, location=_TEST_LOCATION)
     artifact._Artifact(resource_name=_TEST_ARTIFACT_ID,
                        metadata_store_id=_TEST_METADATA_STORE)
     get_artifact_mock.assert_called_once_with(name=_TEST_ARTIFACT_NAME,
                                               retry=base._DEFAULT_RETRY)
 def test_init_artifact(self, get_artifact_mock):
     aiplatform.init(project=_TEST_PROJECT)
     artifact._Artifact(resource_name=_TEST_ARTIFACT_NAME)
     get_artifact_mock.assert_called_once_with(name=_TEST_ARTIFACT_NAME,
                                               retry=base._DEFAULT_RETRY)