From 93a6a88acbd498a1aef77608f4af49e681ce9af6 Mon Sep 17 00:00:00 2001 From: Zane Durante Date: Thu, 25 Jul 2019 13:58:08 -0700 Subject: [PATCH] nit --- sdk/python/kfp/compiler/_component_builder.py | 2 +- sdk/python/tests/compiler/component_builder_test.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/sdk/python/kfp/compiler/_component_builder.py b/sdk/python/kfp/compiler/_component_builder.py index 093dcbdd1af..b1bd63f214f 100644 --- a/sdk/python/kfp/compiler/_component_builder.py +++ b/sdk/python/kfp/compiler/_component_builder.py @@ -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) diff --git a/sdk/python/tests/compiler/component_builder_test.py b/sdk/python/tests/compiler/component_builder_test.py index 9ab5c172bd6..35980787e7d 100644 --- a/sdk/python/tests/compiler/component_builder_test.py +++ b/sdk/python/tests/compiler/component_builder_test.py @@ -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/' @@ -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') @@ -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')