def _test_function( a: components.InputArtifact('Dataset'), b: components.OutputArtifact('Model'), c: components.OutputArtifact('Artifact') ): """Function used to test signature parsing.""" pass
def test_func( test_param: str, test_artifact: components.InputArtifact('Dataset'), test_output1: components.OutputArtifact('Model') ) -> NamedTuple('Outputs', [('test_output2', str)]): assert test_param == 'hello from producer' # In the associated test case, input artifact is produced by conventional # KFP components, thus no concrete artifact type can be determined. assert isinstance(test_artifact, artifact.Artifact) assert isinstance(test_output1, ontology_artifacts.Model) assert test_output1.uri from collections import namedtuple Outputs = namedtuple('Outputs', 'test_output2') return Outputs('bye world')
def test_func2( test_param: str, test_artifact: components.InputArtifact('Dataset'), test_output1: components.OutputArtifact('Model') ) -> NamedTuple('Outputs', [('test_output2', str)]): assert test_param == 'hello from producer' # In the associated test case, input artifact is produced by a new-styled # KFP components with metadata, thus it's expected to be deserialized to # Dataset object. assert isinstance(test_artifact, ontology_artifacts.Dataset) assert isinstance(test_output1, ontology_artifacts.Model) assert test_output1.uri from collections import namedtuple Outputs = namedtuple('Outputs', 'test_output2') return Outputs('bye world')
def test_function(test_param: str, test_artifact: components.InputArtifact('Dataset'), test_output: components.OutputArtifact('Model')): pass