Skip to content

Commit

Permalink
nit
Browse files Browse the repository at this point in the history
  • Loading branch information
zanedurante committed Jul 25, 2019
1 parent d5ed955 commit 93a6a88
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion sdk/python/kfp/compiler/_component_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ def _generate_entrypoint(self, component_func, python_version='python3'):
raise Exception('Output type not supported and supported types are [int, float, str, bool]')

# inputs is a dictionary with key of argument name and value of type class
# output is a type class, e.g. int, str, bool ,float, NamedTuple.
# output is a type class, e.g. int, str, bool, float, NamedTuple.

# Follow the same indentation with the component source codes.
component_src = inspect.getsource(component_func)
Expand Down
4 changes: 3 additions & 1 deletion sdk/python/tests/compiler/component_builder_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import tarfile
from pathlib import Path
import inspect
from collections import OrderedDict, namedtuple
from collections import OrderedDict
from typing import NamedTuple

GCS_BASE = 'gs://kfp-testing/'
Expand Down Expand Up @@ -303,6 +303,7 @@ def sample_component_func_three() -> float:

def sample_component_func_four() -> NamedTuple(
'output', [('a', float), ('b', str)]):
from collections import namedtuple
output = namedtuple('output', ['a', 'b'])
return output(1.0, 'test')

Expand Down Expand Up @@ -412,6 +413,7 @@ def wrapper_sample_component_func_three(_output_file):
from typing import NamedTuple
def sample_component_func_four() -> NamedTuple(
'output', [('a', float), ('b', str)]):
from collections import namedtuple
output = namedtuple('output', ['a', 'b'])
return output(1.0, 'test')
Expand Down

0 comments on commit 93a6a88

Please sign in to comment.