Skip to content

Commit

Permalink
metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
ji-yaqi committed Dec 23, 2021
1 parent 47014ca commit 457f9e6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
9 changes: 6 additions & 3 deletions sdk/python/kfp/v2/compiler/pipeline_spec_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
from kfp.v2.components import pipeline_channel
from kfp.v2.components import pipeline_task
from kfp.v2.components import placeholders
from kfp.v2.components import structures
from kfp.v2.components import tasks_group
from kfp.v2.components.types import artifact_types
from kfp.v2.components.types import type_utils
Expand Down Expand Up @@ -355,8 +354,12 @@ def build_importer_spec_for_task(
type_schema = type_utils.get_artifact_type_schema(task.importer_spec.type_schema)
importer_spec = pipeline_spec_pb2.PipelineDeploymentConfig.ImporterSpec(
type_schema=type_schema,
reimport=task.importer_spec.reimport,
metadata=task.importer_spec.metadata)
reimport=task.importer_spec.reimport)

if task.importer_spec.metadata and len(task.importer_spec.metadata) != 0:
metadata_protobuf_struct = struct_pb2.Struct()
metadata_protobuf_struct.update(task.importer_spec.metadata)
importer_spec.metadata.CopyFrom(metadata_protobuf_struct)

if isinstance(task.importer_spec.artifact_uri, pipeline_channel.PipelineParameterChannel):
importer_spec.artifact_uri.runtime_parameter = 'uri'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,5 +146,5 @@
}
},
"schemaVersion": "2.1.0",
"sdkVersion": "kfp-2.0.0-beta0"
"sdkVersion": "kfp-1.8.10"
}
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,9 @@
"artifactUri": {
"constant": "gs://ml-pipeline-playground/shakespeare1.txt"
},
"metadata": {},
"metadata": {
"key": "value"
},
"typeSchema": {
"schemaTitle": "system.Artifact",
"schemaVersion": "0.0.1"
Expand All @@ -175,7 +177,6 @@
"artifactUri": {
"runtimeParameter": "uri"
},
"metadata": {},
"reimport": true,
"typeSchema": {
"schemaTitle": "system.Artifact",
Expand Down

0 comments on commit 457f9e6

Please sign in to comment.