Exemplo n.º 1
0
 def componentA(
     a: {'ArtifactA': {
         'file_type': 'csv'
     }},
     b: Integer() = 12,
     c: {'ArtifactB': {
         'path_type': 'file',
         'file_type': 'tsv'
     }} = 'gs://hello/world'
 ) -> {
         'model': Integer()
 }:
     return MockContainerOp()
Exemplo n.º 2
0
 def my_pipeline(
         a: {'GCSPath': {
             'path_type': 'file',
             'file_type': 'csv'
         }} = 'good',
         b: Integer() = 12):
     a_op(field_m=a, field_o=b)
Exemplo n.º 3
0
 def b_op(
     field_x: {
         'customized_type': {
             'openapi_schema_validator':
             '{"type": "string", "pattern": "^gcs://.*$"}'
         }
     }, field_y: Integer(), field_z: GCSPath()
 ) -> {
         'output_model_uri': 'GcsUri'
 }:
     return ContainerOp(name='operator b',
                        image='gcr.io/ml-pipeline/component-a',
                        command=[
                            'python3',
                            field_x,
                        ],
                        arguments=[
                            '--field-y',
                            field_y,
                            '--field-z',
                            field_z,
                        ],
                        file_outputs={
                            'output_model_uri': '/schema.txt',
                        })
Exemplo n.º 4
0
 def b_op(
     field_x: {
         'customized_type_a': {
             'property_a': 'value_a',
             'property_b': 'value_b'
         }
     }, field_y: Integer(),
     field_z: {'ArtifactB': {
         'path_type': 'file',
         'file_type': 'tsv'
     }}
 ) -> {
         'output_model_uri': 'GcsUri'
 }:
     return ContainerOp(name='operator b',
                        image='gcr.io/ml-pipeline/component-a',
                        command=[
                            'python3',
                            field_x,
                        ],
                        arguments=[
                            '--field-y',
                            field_y,
                            '--field-z',
                            field_z,
                        ],
                        file_outputs={
                            'output_model_uri': '/schema.txt',
                        })
Exemplo n.º 5
0
 def a_op(field_l: Integer()) -> {
         'field_m': {
             'ArtifactB': {
                 'path_type': 'file',
                 'file_type': 'tsv'
             }
         },
         'field_n': {
             'customized_type': {
                 'property_a': 'value_a',
                 'property_b': 'value_b'
             }
         },
         'field_o': 'Integer'
 }:
     return ContainerOp(name='operator a',
                        image='gcr.io/ml-pipeline/component-b',
                        arguments=[
                            '--field-l',
                            field_l,
                        ],
                        file_outputs={
                            'field_m': '/schema.txt',
                            'field_n': '/feature.txt',
                            'field_o': '/output.txt'
                        })
Exemplo n.º 6
0
 def b_op(field_x,
     field_y: Integer(),
     field_z: GCSPath(path_type='file', file_type='tsv')) -> {'output_model_uri': 'GcsUri'}:
   return ContainerOp(
       name = 'operator b',
       image = 'gcr.io/ml-pipeline/component-a',
       command = [
           'python3',
           field_x,
       ],
       arguments = [
           '--field-y', field_y,
           '--field-z', field_z,
       ],
       file_outputs = {
           'output_model_uri': '/schema.txt',
       }
   )
Exemplo n.º 7
0
 def a_op(field_l: Integer()) -> {
         'field_m': 'GCSPath',
         'field_n': {
             'customized_type': {
                 'openapi_schema_validator':
                 '{"type": "string", "pattern": "^gs://.*$"}'
             }
         },
         'field_o': 'Integer'
 }:
     return ContainerOp(name='operator a',
                        image='gcr.io/ml-pipeline/component-b',
                        arguments=[
                            '--field-l',
                            field_l,
                        ],
                        file_outputs={
                            'field_m': '/schema.txt',
                            'field_n': '/feature.txt',
                            'field_o': '/output.txt'
                        })
Exemplo n.º 8
0
 def my_pipeline1(a: {'Schema':
                      {
                          'file_type': 'csv'
                      }} = 'good',
                  b: Integer() = 12):
     pass
Exemplo n.º 9
0
 def componentA(a: {'Schema': {'file_type': 'csv'}}, b: Integer() = 12, c: GCSPath(path_type='file', file_type='tsv') = 'gs://hello/world') -> {'model': Integer()}:
   return MockContainerOp()