Skip to content

Commit

Permalink
feat(sdk): Add support for executor input in dsl_util.py (#6057)
Browse files Browse the repository at this point in the history
* Add support for executor input

* chagne method name to _executor_input_placeholder
  • Loading branch information
SinaChavoshi authored Jul 17, 2021
1 parent 90b38f7 commit fdab2e6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion sdk/python/kfp/dsl/dsl_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
_structures.InputPathPlaceholder,
_structures.OutputPathPlaceholder,
_structures.InputUriPlaceholder,
_structures.OutputUriPlaceholder,]
_structures.OutputUriPlaceholder,
_structures.ExecutorInputPlaceholder]


def sanitize_component_name(name: str) -> str:
Expand Down Expand Up @@ -97,6 +98,8 @@ def _output_artifact_path_placeholder(output_key: str) -> str:
def _output_parameter_path_placeholder(output_key: str) -> str:
return "{{{{$.outputs.parameters['{}'].output_file}}}}".format(output_key)

def _executor_input_placeholder() -> str:
return "{{{{$}}}}"

def resolve_cmd_lines(cmds: Optional[List[_CommandlineArgumentType]],
is_output_parameter: Callable[[str], bool]) -> None:
Expand All @@ -121,6 +124,8 @@ def _resolve_cmd(cmd: Optional[_CommandlineArgumentType]) -> Optional[str]:
return _output_artifact_path_placeholder(cmd.output_name)
elif isinstance(cmd, _structures.OutputUriPlaceholder):
return _output_artifact_uri_placeholder(cmd.output_name)
elif isinstance(cmd, _structures.ExecutorInputPlaceholder):
return _executor_input_placeholder()
else:
raise TypeError('Got unexpected placeholder type for %s' % cmd)

Expand Down

0 comments on commit fdab2e6

Please sign in to comment.