diff --git a/.isort.cfg b/.isort.cfg new file mode 100644 index 00000000000..6a6458ba01f --- /dev/null +++ b/.isort.cfg @@ -0,0 +1,3 @@ +[settings] +force_single_line = true +single_line_exclusions = typing, typing_extensions diff --git a/sdk/README.md b/sdk/README.md index 9ad33ce5b40..5e21796f229 100644 --- a/sdk/README.md +++ b/sdk/README.md @@ -20,6 +20,14 @@ From the project root, run the following code to format your code: yapf --in-place --recursive ./sdk/python ``` +#### Formatting imports [Required] +Please organize your imports using [isort](https://pycqa.github.io/isort/index.html) according to the [`.isort.cfg`](https://github.com/kubeflow/pipelines/blob/master/.isort.cfg) file. + +From the project root, run the following code to format your code: +```sh +isort sdk/python --sg sdk/python/kfp/deprecated +``` + #### Pylint [Encouraged] We encourage you to lint your code using [pylint](https://pylint.org/) according to the project [`.pylintrc`](https://github.com/kubeflow/pipelines/blob/master/.pylintrc) file. diff --git a/sdk/python/kfp/compiler/pipeline_spec_builder.py b/sdk/python/kfp/compiler/pipeline_spec_builder.py index 00d313ced4b..9d7e24e2fb7 100644 --- a/sdk/python/kfp/compiler/pipeline_spec_builder.py +++ b/sdk/python/kfp/compiler/pipeline_spec_builder.py @@ -17,15 +17,15 @@ from typing import List, Mapping, Optional, Tuple, Union from google.protobuf import struct_pb2 -from kfp.pipeline_spec import pipeline_spec_pb2 -from kfp.components import utils as component_utils from kfp.components import for_loop from kfp.components import pipeline_channel from kfp.components import pipeline_task from kfp.components import placeholders from kfp.components import tasks_group +from kfp.components import utils as component_utils from kfp.components.types import artifact_types from kfp.components.types import type_utils +from kfp.pipeline_spec import pipeline_spec_pb2 _GroupOrTask = Union[tasks_group.TasksGroup, pipeline_task.PipelineTask] @@ -348,7 +348,8 @@ def build_component_spec_for_task( input_spec.type) if input_spec.default is not None: component_spec.input_definitions.parameters[ - input_name].default_value.CopyFrom(_to_protobuf_value(input_spec.default)) + input_name].default_value.CopyFrom( + _to_protobuf_value(input_spec.default)) else: component_spec.input_definitions.artifacts[ diff --git a/sdk/python/kfp/compiler/pipeline_spec_builder_test.py b/sdk/python/kfp/compiler/pipeline_spec_builder_test.py index 6bbf66ee59e..c5bbbe67de3 100644 --- a/sdk/python/kfp/compiler/pipeline_spec_builder_test.py +++ b/sdk/python/kfp/compiler/pipeline_spec_builder_test.py @@ -17,9 +17,9 @@ from absl.testing import parameterized from google.protobuf import struct_pb2 -from kfp.pipeline_spec import pipeline_spec_pb2 from kfp.compiler import pipeline_spec_builder from kfp.components import pipeline_channel +from kfp.pipeline_spec import pipeline_spec_pb2 class PipelineSpecBuilderTest(parameterized.TestCase): diff --git a/sdk/python/kfp/compiler_cli_tests/test_data/lightweight_python_functions_v2_with_outputs.py b/sdk/python/kfp/compiler_cli_tests/test_data/lightweight_python_functions_v2_with_outputs.py index cdde46b65cd..b1729e9cc72 100644 --- a/sdk/python/kfp/compiler_cli_tests/test_data/lightweight_python_functions_v2_with_outputs.py +++ b/sdk/python/kfp/compiler_cli_tests/test_data/lightweight_python_functions_v2_with_outputs.py @@ -16,7 +16,11 @@ from kfp import compiler from kfp import dsl -from kfp.dsl import component, Input, Dataset, Model, Metrics +from kfp.dsl import Dataset +from kfp.dsl import Input +from kfp.dsl import Metrics +from kfp.dsl import Model +from kfp.dsl import component @component diff --git a/sdk/python/kfp/compiler_cli_tests/test_data/pipeline_with_after.py b/sdk/python/kfp/compiler_cli_tests/test_data/pipeline_with_after.py index 3ea9d4867e0..a1093a44490 100644 --- a/sdk/python/kfp/compiler_cli_tests/test_data/pipeline_with_after.py +++ b/sdk/python/kfp/compiler_cli_tests/test_data/pipeline_with_after.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from kfp import compiler from kfp import components from kfp import dsl -from kfp import compiler component_op = components.load_component_from_text(""" name: Print Text diff --git a/sdk/python/kfp/compiler_cli_tests/test_data/pipeline_with_concat_placeholder.py b/sdk/python/kfp/compiler_cli_tests/test_data/pipeline_with_concat_placeholder.py index 80f4409e757..66fa90adcc5 100644 --- a/sdk/python/kfp/compiler_cli_tests/test_data/pipeline_with_concat_placeholder.py +++ b/sdk/python/kfp/compiler_cli_tests/test_data/pipeline_with_concat_placeholder.py @@ -14,9 +14,9 @@ import pathlib +from kfp import compiler from kfp import components from kfp import dsl -from kfp import compiler test_data_dir = pathlib.Path(__file__).parent / 'component_yaml' component_op = components.load_component_from_file( diff --git a/sdk/python/kfp/compiler_cli_tests/test_data/pipeline_with_condition.py b/sdk/python/kfp/compiler_cli_tests/test_data/pipeline_with_condition.py index f67f1ab5180..b60b2aa42a6 100644 --- a/sdk/python/kfp/compiler_cli_tests/test_data/pipeline_with_condition.py +++ b/sdk/python/kfp/compiler_cli_tests/test_data/pipeline_with_condition.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from kfp import compiler from kfp import components from kfp import dsl -from kfp import compiler from kfp.dsl import component diff --git a/sdk/python/kfp/compiler_cli_tests/test_data/pipeline_with_env.py b/sdk/python/kfp/compiler_cli_tests/test_data/pipeline_with_env.py index e95aed7f1d7..4514f966451 100644 --- a/sdk/python/kfp/compiler_cli_tests/test_data/pipeline_with_env.py +++ b/sdk/python/kfp/compiler_cli_tests/test_data/pipeline_with_env.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from kfp import compiler from kfp import components from kfp import dsl -from kfp import compiler from kfp.dsl import component diff --git a/sdk/python/kfp/compiler_cli_tests/test_data/pipeline_with_exit_handler.py b/sdk/python/kfp/compiler_cli_tests/test_data/pipeline_with_exit_handler.py index b2c93efa528..78207277cc5 100644 --- a/sdk/python/kfp/compiler_cli_tests/test_data/pipeline_with_exit_handler.py +++ b/sdk/python/kfp/compiler_cli_tests/test_data/pipeline_with_exit_handler.py @@ -13,8 +13,8 @@ # limitations under the License. """Pipeline using ExitHandler.""" -from kfp import dsl from kfp import compiler +from kfp import dsl from kfp.dsl import component diff --git a/sdk/python/kfp/compiler_cli_tests/test_data/pipeline_with_gcpc_types.py b/sdk/python/kfp/compiler_cli_tests/test_data/pipeline_with_gcpc_types.py index 4c8cb6ed636..d4e22c2e5f9 100644 --- a/sdk/python/kfp/compiler_cli_tests/test_data/pipeline_with_gcpc_types.py +++ b/sdk/python/kfp/compiler_cli_tests/test_data/pipeline_with_gcpc_types.py @@ -12,10 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -from kfp import components -from kfp.dsl import component, Input, Output from kfp import compiler +from kfp import components from kfp import dsl +from kfp.dsl import Input +from kfp.dsl import Output +from kfp.dsl import component class VertexModel(dsl.Artifact): diff --git a/sdk/python/kfp/compiler_cli_tests/test_data/pipeline_with_if_placeholder.py b/sdk/python/kfp/compiler_cli_tests/test_data/pipeline_with_if_placeholder.py index c1c62563abd..d2663a8afc7 100644 --- a/sdk/python/kfp/compiler_cli_tests/test_data/pipeline_with_if_placeholder.py +++ b/sdk/python/kfp/compiler_cli_tests/test_data/pipeline_with_if_placeholder.py @@ -14,9 +14,9 @@ import pathlib +from kfp import compiler from kfp import components from kfp import dsl -from kfp import compiler test_data_dir = pathlib.Path(__file__).parent / 'component_yaml' component_op = components.load_component_from_file( diff --git a/sdk/python/kfp/compiler_cli_tests/test_data/pipeline_with_importer.py b/sdk/python/kfp/compiler_cli_tests/test_data/pipeline_with_importer.py index 46be5ce56e8..aaa599bffc8 100644 --- a/sdk/python/kfp/compiler_cli_tests/test_data/pipeline_with_importer.py +++ b/sdk/python/kfp/compiler_cli_tests/test_data/pipeline_with_importer.py @@ -14,9 +14,14 @@ """Pipeline using dsl.importer.""" from typing import NamedTuple + from kfp import compiler from kfp import dsl -from kfp.dsl import component, importer, Dataset, Model, Input +from kfp.dsl import Dataset +from kfp.dsl import Input +from kfp.dsl import Model +from kfp.dsl import component +from kfp.dsl import importer @component diff --git a/sdk/python/kfp/compiler_cli_tests/test_data/pipeline_with_loops.py b/sdk/python/kfp/compiler_cli_tests/test_data/pipeline_with_loops.py index 3a7c7898e51..d7183d61b46 100644 --- a/sdk/python/kfp/compiler_cli_tests/test_data/pipeline_with_loops.py +++ b/sdk/python/kfp/compiler_cli_tests/test_data/pipeline_with_loops.py @@ -14,7 +14,8 @@ from typing import Dict, List -from kfp import compiler, dsl +from kfp import compiler +from kfp import dsl from kfp.dsl import component diff --git a/sdk/python/kfp/compiler_cli_tests/test_data/pipeline_with_loops_and_conditions.py b/sdk/python/kfp/compiler_cli_tests/test_data/pipeline_with_loops_and_conditions.py index 28d70b945f0..28b3f36257a 100644 --- a/sdk/python/kfp/compiler_cli_tests/test_data/pipeline_with_loops_and_conditions.py +++ b/sdk/python/kfp/compiler_cli_tests/test_data/pipeline_with_loops_and_conditions.py @@ -14,7 +14,8 @@ from typing import Optional -from kfp import compiler, dsl +from kfp import compiler +from kfp import dsl from kfp.dsl import component diff --git a/sdk/python/kfp/compiler_cli_tests/test_data/pipeline_with_metrics_outputs.py b/sdk/python/kfp/compiler_cli_tests/test_data/pipeline_with_metrics_outputs.py index 43674a8da23..7dc1d53e699 100644 --- a/sdk/python/kfp/compiler_cli_tests/test_data/pipeline_with_metrics_outputs.py +++ b/sdk/python/kfp/compiler_cli_tests/test_data/pipeline_with_metrics_outputs.py @@ -15,10 +15,14 @@ from typing import NamedTuple +from kfp import compiler from kfp import components from kfp import dsl -from kfp import compiler -from kfp.dsl import component, Dataset, Input, Metrics, Output +from kfp.dsl import Dataset +from kfp.dsl import Input +from kfp.dsl import Metrics +from kfp.dsl import Output +from kfp.dsl import component @component diff --git a/sdk/python/kfp/compiler_cli_tests/test_data/pipeline_with_nested_conditions.py b/sdk/python/kfp/compiler_cli_tests/test_data/pipeline_with_nested_conditions.py index 7ca7dd7fa32..998c033bc5f 100644 --- a/sdk/python/kfp/compiler_cli_tests/test_data/pipeline_with_nested_conditions.py +++ b/sdk/python/kfp/compiler_cli_tests/test_data/pipeline_with_nested_conditions.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from kfp import compiler from kfp import components from kfp import dsl -from kfp import compiler from kfp.dsl import component diff --git a/sdk/python/kfp/compiler_cli_tests/test_data/pipeline_with_nested_conditions_yaml.py b/sdk/python/kfp/compiler_cli_tests/test_data/pipeline_with_nested_conditions_yaml.py index aabb1f1870a..bca5adad62a 100644 --- a/sdk/python/kfp/compiler_cli_tests/test_data/pipeline_with_nested_conditions_yaml.py +++ b/sdk/python/kfp/compiler_cli_tests/test_data/pipeline_with_nested_conditions_yaml.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from kfp import compiler from kfp import components from kfp import dsl -from kfp import compiler def random_num_op(low, high): diff --git a/sdk/python/kfp/compiler_cli_tests/test_data/pipeline_with_nested_loops.py b/sdk/python/kfp/compiler_cli_tests/test_data/pipeline_with_nested_loops.py index 4869bc56fdf..8ee53328e87 100644 --- a/sdk/python/kfp/compiler_cli_tests/test_data/pipeline_with_nested_loops.py +++ b/sdk/python/kfp/compiler_cli_tests/test_data/pipeline_with_nested_loops.py @@ -14,7 +14,8 @@ from typing import Optional -from kfp import compiler, dsl +from kfp import compiler +from kfp import dsl from kfp.dsl import component diff --git a/sdk/python/kfp/compiler_cli_tests/test_data/pipeline_with_ontology.py b/sdk/python/kfp/compiler_cli_tests/test_data/pipeline_with_ontology.py index bd486d10819..d57a2d2b163 100644 --- a/sdk/python/kfp/compiler_cli_tests/test_data/pipeline_with_ontology.py +++ b/sdk/python/kfp/compiler_cli_tests/test_data/pipeline_with_ontology.py @@ -12,10 +12,11 @@ # See the License for the specific language governing permissions and # limitations under the License. +import pathlib + +from kfp import compiler from kfp import components from kfp import dsl -from kfp import compiler -import pathlib test_data_dir = pathlib.Path(__file__).parent / 'component_yaml' diff --git a/sdk/python/kfp/compiler_cli_tests/test_data/pipeline_with_params_containing_format.py b/sdk/python/kfp/compiler_cli_tests/test_data/pipeline_with_params_containing_format.py index 6225294d62f..0156652e0a9 100644 --- a/sdk/python/kfp/compiler_cli_tests/test_data/pipeline_with_params_containing_format.py +++ b/sdk/python/kfp/compiler_cli_tests/test_data/pipeline_with_params_containing_format.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from kfp import compiler from kfp import components from kfp import dsl -from kfp import compiler from kfp.dsl import component diff --git a/sdk/python/kfp/compiler_cli_tests/test_data/pipeline_with_placeholders.py b/sdk/python/kfp/compiler_cli_tests/test_data/pipeline_with_placeholders.py index 598339e4b80..cfb1e7990c3 100644 --- a/sdk/python/kfp/compiler_cli_tests/test_data/pipeline_with_placeholders.py +++ b/sdk/python/kfp/compiler_cli_tests/test_data/pipeline_with_placeholders.py @@ -12,7 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -from kfp import compiler, dsl +from kfp import compiler +from kfp import dsl from kfp.dsl import component diff --git a/sdk/python/kfp/compiler_cli_tests/test_data/pipeline_with_resource_spec.py b/sdk/python/kfp/compiler_cli_tests/test_data/pipeline_with_resource_spec.py index 811e48b36e1..104b45b37e8 100644 --- a/sdk/python/kfp/compiler_cli_tests/test_data/pipeline_with_resource_spec.py +++ b/sdk/python/kfp/compiler_cli_tests/test_data/pipeline_with_resource_spec.py @@ -12,10 +12,11 @@ # See the License for the specific language governing permissions and # limitations under the License. +import pathlib + +from kfp import compiler from kfp import components from kfp import dsl -from kfp import compiler -import pathlib test_data_dir = pathlib.Path(__file__).parent / 'component_yaml' diff --git a/sdk/python/kfp/compiler_cli_tests/test_data/pipeline_with_reused_component.py b/sdk/python/kfp/compiler_cli_tests/test_data/pipeline_with_reused_component.py index b367bd8d684..32572d93ac4 100644 --- a/sdk/python/kfp/compiler_cli_tests/test_data/pipeline_with_reused_component.py +++ b/sdk/python/kfp/compiler_cli_tests/test_data/pipeline_with_reused_component.py @@ -14,8 +14,8 @@ import pathlib -from kfp import components from kfp import compiler +from kfp import components from kfp import dsl test_data_dir = pathlib.Path(__file__).parent / 'component_yaml' diff --git a/sdk/python/kfp/compiler_cli_tests/test_data/pipeline_with_task_final_status.py b/sdk/python/kfp/compiler_cli_tests/test_data/pipeline_with_task_final_status.py index 7ef651025de..67badfd7592 100644 --- a/sdk/python/kfp/compiler_cli_tests/test_data/pipeline_with_task_final_status.py +++ b/sdk/python/kfp/compiler_cli_tests/test_data/pipeline_with_task_final_status.py @@ -13,11 +13,10 @@ # limitations under the License. """Pipeline using ExitHandler with PipelineTaskFinalStatus.""" -from kfp import dsl from kfp import compiler -from kfp.dsl import component - +from kfp import dsl from kfp.dsl import PipelineTaskFinalStatus +from kfp.dsl import component @component diff --git a/sdk/python/kfp/compiler_cli_tests/test_data/pipeline_with_task_final_status_yaml.py b/sdk/python/kfp/compiler_cli_tests/test_data/pipeline_with_task_final_status_yaml.py index 9c0e2fbae18..72855f3d97f 100644 --- a/sdk/python/kfp/compiler_cli_tests/test_data/pipeline_with_task_final_status_yaml.py +++ b/sdk/python/kfp/compiler_cli_tests/test_data/pipeline_with_task_final_status_yaml.py @@ -13,9 +13,9 @@ # limitations under the License. """Pipeline using ExitHandler with PipelineTaskFinalStatus (YAML).""" +from kfp import compiler from kfp import components from kfp import dsl -from kfp import compiler from kfp.dsl import component exit_op = components.load_component_from_text(""" diff --git a/sdk/python/kfp/compiler_cli_tests/test_data/pipeline_with_various_io_types.py b/sdk/python/kfp/compiler_cli_tests/test_data/pipeline_with_various_io_types.py index 3808de6f559..4f9754f895a 100644 --- a/sdk/python/kfp/compiler_cli_tests/test_data/pipeline_with_various_io_types.py +++ b/sdk/python/kfp/compiler_cli_tests/test_data/pipeline_with_various_io_types.py @@ -14,9 +14,9 @@ import pathlib +from kfp import compiler from kfp import components from kfp import dsl -from kfp import compiler component_op_1 = components.load_component_from_text(""" name: upstream diff --git a/sdk/python/kfp/compiler_cli_tests/test_data/two_step_pipeline.py b/sdk/python/kfp/compiler_cli_tests/test_data/two_step_pipeline.py index be40442988f..591a78baf6a 100644 --- a/sdk/python/kfp/compiler_cli_tests/test_data/two_step_pipeline.py +++ b/sdk/python/kfp/compiler_cli_tests/test_data/two_step_pipeline.py @@ -14,9 +14,9 @@ import pathlib +from kfp import compiler from kfp import components from kfp import dsl -from kfp import compiler component_op_1 = components.load_component_from_text(""" name: Write to GCS diff --git a/sdk/python/kfp/compiler_cli_tests/test_data/v2_component_with_optional_inputs.py b/sdk/python/kfp/compiler_cli_tests/test_data/v2_component_with_optional_inputs.py index ba44b7022c7..e5962079038 100644 --- a/sdk/python/kfp/compiler_cli_tests/test_data/v2_component_with_optional_inputs.py +++ b/sdk/python/kfp/compiler_cli_tests/test_data/v2_component_with_optional_inputs.py @@ -13,7 +13,8 @@ # limitations under the License. from typing import Optional -from kfp import compiler, dsl +from kfp import compiler +from kfp import dsl from kfp.dsl import component diff --git a/sdk/python/kfp/compiler_cli_tests/test_data/xgboost_sample_pipeline.py b/sdk/python/kfp/compiler_cli_tests/test_data/xgboost_sample_pipeline.py index ddf5cd2559a..8b51fc0280f 100644 --- a/sdk/python/kfp/compiler_cli_tests/test_data/xgboost_sample_pipeline.py +++ b/sdk/python/kfp/compiler_cli_tests/test_data/xgboost_sample_pipeline.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from kfp import compiler from kfp import components from kfp import dsl -from kfp import compiler chicago_taxi_dataset_op = components.load_component_from_url( 'https://raw.githubusercontent.com/kubeflow/pipelines/60a2612541ec08c6a85c237d2ec7525b12543a43/components/datasets/Chicago_Taxi_Trips/component.yaml' diff --git a/sdk/python/kfp/components/__init__.py b/sdk/python/kfp/components/__init__.py index cf10195f4f8..631465aa5a0 100644 --- a/sdk/python/kfp/components/__init__.py +++ b/sdk/python/kfp/components/__init__.py @@ -12,6 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -from kfp.components.yaml_component import load_component_from_text from kfp.components.yaml_component import load_component_from_file +from kfp.components.yaml_component import load_component_from_text from kfp.components.yaml_component import load_component_from_url diff --git a/sdk/python/kfp/components/base_component_test.py b/sdk/python/kfp/components/base_component_test.py index 11ea5ee6a87..e7da1d36602 100644 --- a/sdk/python/kfp/components/base_component_test.py +++ b/sdk/python/kfp/components/base_component_test.py @@ -17,8 +17,8 @@ from unittest.mock import patch from kfp.components import base_component -from kfp.components import structures from kfp.components import pipeline_task +from kfp.components import structures class TestComponent(base_component.BaseComponent): diff --git a/sdk/python/kfp/components/component_decorator.py b/sdk/python/kfp/components/component_decorator.py index ad47f1766a5..cd05f22be1b 100644 --- a/sdk/python/kfp/components/component_decorator.py +++ b/sdk/python/kfp/components/component_decorator.py @@ -13,7 +13,7 @@ # limitations under the License. import functools -from typing import Callable, Optional, List +from typing import Callable, List, Optional from kfp.components import component_factory diff --git a/sdk/python/kfp/components/component_factory.py b/sdk/python/kfp/components/component_factory.py index a6f2e52874f..5c0e579a9fd 100644 --- a/sdk/python/kfp/components/component_factory.py +++ b/sdk/python/kfp/components/component_factory.py @@ -17,15 +17,15 @@ import pathlib import re import textwrap -from typing import Callable, List, Optional, Tuple import warnings +from typing import Callable, List, Optional, Tuple import docstring_parser - from kfp.components import placeholders from kfp.components import python_component from kfp.components import structures -from kfp.components.types import artifact_types, type_annotations +from kfp.components.types import artifact_types +from kfp.components.types import type_annotations from kfp.components.types import type_utils _DEFAULT_BASE_IMAGE = 'python:3.7' diff --git a/sdk/python/kfp/components/executor.py b/sdk/python/kfp/components/executor.py index 390a6282f4d..942ee9691fc 100644 --- a/sdk/python/kfp/components/executor.py +++ b/sdk/python/kfp/components/executor.py @@ -15,8 +15,9 @@ import json from typing import Any, Callable, Dict, List, Optional, Union -from kfp.components.types import artifact_types, type_annotations from kfp.components import task_final_status +from kfp.components.types import artifact_types +from kfp.components.types import type_annotations class Executor(): diff --git a/sdk/python/kfp/components/for_loop_test.py b/sdk/python/kfp/components/for_loop_test.py index 0a6a5d13324..b1e3549c94a 100644 --- a/sdk/python/kfp/components/for_loop_test.py +++ b/sdk/python/kfp/components/for_loop_test.py @@ -15,8 +15,8 @@ import unittest from absl.testing import parameterized -from kfp.components import pipeline_channel from kfp.components import for_loop +from kfp.components import pipeline_channel class ForLoopTest(parameterized.TestCase): diff --git a/sdk/python/kfp/components/importer_node.py b/sdk/python/kfp/components/importer_node.py index 17c95995dc7..7a4d7f95727 100644 --- a/sdk/python/kfp/components/importer_node.py +++ b/sdk/python/kfp/components/importer_node.py @@ -13,13 +13,13 @@ # limitations under the License. """Utility function for building Importer Node spec.""" -from typing import Any, Union, Optional, Type, Mapping +from typing import Any, Mapping, Optional, Type, Union -from kfp.components import pipeline_task +from kfp.components import importer_component from kfp.components import pipeline_channel +from kfp.components import pipeline_task from kfp.components import placeholders from kfp.components import structures -from kfp.components import importer_component from kfp.components.types import artifact_types INPUT_KEY = 'uri' diff --git a/sdk/python/kfp/components/kfp_config.py b/sdk/python/kfp/components/kfp_config.py index d525fd45fea..2b660ee5d69 100644 --- a/sdk/python/kfp/components/kfp_config.py +++ b/sdk/python/kfp/components/kfp_config.py @@ -11,11 +11,10 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -from typing import Dict, Optional - import configparser import pathlib import warnings +from typing import Dict, Optional _KFP_CONFIG_FILE = 'kfp_config.ini' diff --git a/sdk/python/kfp/components/pipeline_task.py b/sdk/python/kfp/components/pipeline_task.py index 916c0ddb1c6..226e174b9c2 100644 --- a/sdk/python/kfp/components/pipeline_task.py +++ b/sdk/python/kfp/components/pipeline_task.py @@ -13,13 +13,13 @@ # limitations under the License. """Pipeline task class and operations.""" -import re import copy +import re from typing import Any, List, Mapping, Optional, Union from kfp.components import constants -from kfp.components import placeholders from kfp.components import pipeline_channel +from kfp.components import placeholders from kfp.components import structures from kfp.components.types import type_utils diff --git a/sdk/python/kfp/components/tasks_group.py b/sdk/python/kfp/components/tasks_group.py index 64614cfd977..bf48a66f8b9 100644 --- a/sdk/python/kfp/components/tasks_group.py +++ b/sdk/python/kfp/components/tasks_group.py @@ -17,8 +17,8 @@ from typing import Optional, Union from kfp.components import for_loop -from kfp.components import pipeline_context from kfp.components import pipeline_channel +from kfp.components import pipeline_context from kfp.components import pipeline_task diff --git a/sdk/python/kfp/components/types/artifact_types_test.py b/sdk/python/kfp/components/types/artifact_types_test.py index 8212b214dca..6d198b72371 100644 --- a/sdk/python/kfp/components/types/artifact_types_test.py +++ b/sdk/python/kfp/components/types/artifact_types_test.py @@ -13,9 +13,9 @@ # limitations under the License. """Tests for kfp.components.types.artifact_types.""" -import unittest import json import os +import unittest from absl.testing import parameterized from kfp.components.types import artifact_types diff --git a/sdk/python/kfp/components/types/type_annotations_test.py b/sdk/python/kfp/components/types/type_annotations_test.py index 413d9e6e246..8ead25fbaca 100644 --- a/sdk/python/kfp/components/types/type_annotations_test.py +++ b/sdk/python/kfp/components/types/type_annotations_test.py @@ -19,9 +19,12 @@ from absl.testing import parameterized from kfp.components.types import type_annotations from kfp.components.types.artifact_types import Model -from kfp.components.types.type_annotations import (Input, InputAnnotation, - InputPath, Output, - OutputAnnotation, OutputPath) +from kfp.components.types.type_annotations import Input +from kfp.components.types.type_annotations import InputAnnotation +from kfp.components.types.type_annotations import InputPath +from kfp.components.types.type_annotations import Output +from kfp.components.types.type_annotations import OutputAnnotation +from kfp.components.types.type_annotations import OutputPath class AnnotationsTest(parameterized.TestCase): diff --git a/sdk/python/kfp/components/yaml_component_test.py b/sdk/python/kfp/components/yaml_component_test.py index af41e51b33b..f43b894b317 100644 --- a/sdk/python/kfp/components/yaml_component_test.py +++ b/sdk/python/kfp/components/yaml_component_test.py @@ -13,15 +13,14 @@ # limitations under the License. """Tests for kfp.components.yaml_component.""" -import requests -import unittest import textwrap - +import unittest from pathlib import Path from unittest import mock -from kfp.components import yaml_component +import requests from kfp.components import structures +from kfp.components import yaml_component SAMPLE_YAML = textwrap.dedent("""\ name: component_1 diff --git a/sdk/python/kfp/dsl/__init__.py b/sdk/python/kfp/dsl/__init__.py index eda679939cd..6176d46d71a 100644 --- a/sdk/python/kfp/dsl/__init__.py +++ b/sdk/python/kfp/dsl/__init__.py @@ -13,38 +13,28 @@ # limitations under the License. from kfp.components.component_decorator import component - from kfp.components.importer_node import importer - -from kfp.components.pipeline_channel import ( - PipelineArtifactChannel, - PipelineChannel, - PipelineParameterChannel, -) +from kfp.components.pipeline_channel import PipelineArtifactChannel +from kfp.components.pipeline_channel import PipelineChannel +from kfp.components.pipeline_channel import PipelineParameterChannel from kfp.components.pipeline_context import pipeline from kfp.components.pipeline_task import PipelineTask from kfp.components.task_final_status import PipelineTaskFinalStatus -from kfp.components.tasks_group import ( - Condition, - ExitHandler, - ParallelFor, -) -from kfp.components.types.artifact_types import ( - Artifact, - ClassificationMetrics, - Dataset, - HTML, - Markdown, - Metrics, - Model, - SlicedClassificationMetrics, -) -from kfp.components.types.type_annotations import ( - Input, - Output, - InputPath, - OutputPath, -) +from kfp.components.tasks_group import Condition +from kfp.components.tasks_group import ExitHandler +from kfp.components.tasks_group import ParallelFor +from kfp.components.types.artifact_types import HTML +from kfp.components.types.artifact_types import Artifact +from kfp.components.types.artifact_types import ClassificationMetrics +from kfp.components.types.artifact_types import Dataset +from kfp.components.types.artifact_types import Markdown +from kfp.components.types.artifact_types import Metrics +from kfp.components.types.artifact_types import Model +from kfp.components.types.artifact_types import SlicedClassificationMetrics +from kfp.components.types.type_annotations import Input +from kfp.components.types.type_annotations import InputPath +from kfp.components.types.type_annotations import Output +from kfp.components.types.type_annotations import OutputPath PIPELINE_JOB_NAME_PLACEHOLDER = '{{$.pipeline_job_name}}' PIPELINE_JOB_RESOURCE_NAME_PLACEHOLDER = '{{$.pipeline_job_resource_name}}' diff --git a/sdk/python/kfp/utils/ir_utils.py b/sdk/python/kfp/utils/ir_utils.py index 81b5d9f1b05..90f455fc8c0 100644 --- a/sdk/python/kfp/utils/ir_utils.py +++ b/sdk/python/kfp/utils/ir_utils.py @@ -12,9 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -from typing import Dict, Any -import warnings import json +import warnings +from typing import Any, Dict + import yaml diff --git a/sdk/python/tests/compiler/component_builder_test.py b/sdk/python/tests/compiler/component_builder_test.py index 6d6cfa738be..241050da1a6 100644 --- a/sdk/python/tests/compiler/component_builder_test.py +++ b/sdk/python/tests/compiler/component_builder_test.py @@ -12,11 +12,15 @@ # See the License for the specific language governing permissions and # limitations under the License. -from kfp.deprecated.containers._component_builder import _generate_dockerfile, _dependency_to_requirements, VersionedDependency, DependencyHelper - import os import unittest +from kfp.deprecated.containers._component_builder import DependencyHelper +from kfp.deprecated.containers._component_builder import VersionedDependency +from kfp.deprecated.containers._component_builder import \ + _dependency_to_requirements +from kfp.deprecated.containers._component_builder import _generate_dockerfile + class TestVersionedDependency(unittest.TestCase): diff --git a/sdk/python/tests/compiler/container_builder_test.py b/sdk/python/tests/compiler/container_builder_test.py index 5fd4b20e591..27d59856cce 100644 --- a/sdk/python/tests/compiler/container_builder_test.py +++ b/sdk/python/tests/compiler/container_builder_test.py @@ -14,10 +14,11 @@ import os import tarfile -import unittest -import yaml import tempfile +import unittest from unittest import mock + +import yaml from kfp.deprecated.containers._component_builder import ContainerBuilder GCS_BASE = 'gs://kfp-testing/' diff --git a/sdk/python/tests/compiler/k8s_helper_tests.py b/sdk/python/tests/compiler/k8s_helper_tests.py index e7f6fe76769..1a2329da034 100644 --- a/sdk/python/tests/compiler/k8s_helper_tests.py +++ b/sdk/python/tests/compiler/k8s_helper_tests.py @@ -12,9 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -from kfp.deprecated.compiler._k8s_helper import convert_k8s_obj_to_json -from datetime import datetime import unittest +from datetime import datetime + +from kfp.deprecated.compiler._k8s_helper import convert_k8s_obj_to_json class TestCompiler(unittest.TestCase): diff --git a/sdk/python/tests/compiler/testdata/artifact_passing_using_volume.py b/sdk/python/tests/compiler/testdata/artifact_passing_using_volume.py index 6e8cf353fa2..da51645b3d0 100644 --- a/sdk/python/tests/compiler/testdata/artifact_passing_using_volume.py +++ b/sdk/python/tests/compiler/testdata/artifact_passing_using_volume.py @@ -1,8 +1,9 @@ from pathlib import Path +from typing import NamedTuple import kfp.deprecated as kfp -from kfp.deprecated.components import load_component_from_file, create_component_from_func -from typing import NamedTuple +from kfp.deprecated.components import create_component_from_func +from kfp.deprecated.components import load_component_from_file test_data_dir = Path(__file__).parent / 'test_data' producer_op = load_component_from_file( @@ -37,8 +38,8 @@ def metadata_and_metrics() -> NamedTuple( }, ] } - from collections import namedtuple import json + from collections import namedtuple return namedtuple("output", ["mlpipeline_ui_metadata", "mlpipeline_metrics"])( @@ -59,8 +60,9 @@ def artifact_passing_pipeline(): ).data_passing_method = volume_based_data_passing_method -from kubernetes.client.models import V1Volume, V1PersistentVolumeClaimVolumeSource from kfp.deprecated.dsl import data_passing_methods +from kubernetes.client.models import V1PersistentVolumeClaimVolumeSource +from kubernetes.client.models import V1Volume volume_based_data_passing_method = data_passing_methods.KubernetesVolume( volume=V1Volume( diff --git a/sdk/python/tests/compiler/testdata/resourceop_basic.py b/sdk/python/tests/compiler/testdata/resourceop_basic.py index 03a3bf466b2..a43da2dc615 100644 --- a/sdk/python/tests/compiler/testdata/resourceop_basic.py +++ b/sdk/python/tests/compiler/testdata/resourceop_basic.py @@ -17,8 +17,8 @@ it will be visible on KFP UI. """ -from kubernetes import client as k8s_client import kfp.deprecated.dsl as dsl +from kubernetes import client as k8s_client @dsl.pipeline( diff --git a/sdk/python/tests/compiler/testdata/two_step.py b/sdk/python/tests/compiler/testdata/two_step.py index a641ee4a967..4558aebdccb 100644 --- a/sdk/python/tests/compiler/testdata/two_step.py +++ b/sdk/python/tests/compiler/testdata/two_step.py @@ -13,8 +13,10 @@ # limitations under the License. """Two step v2-compatible pipeline.""" -from kfp.deprecated import components, dsl -from kfp.deprecated.components import InputPath, OutputPath +from kfp.deprecated import components +from kfp.deprecated import dsl +from kfp.deprecated.components import InputPath +from kfp.deprecated.components import OutputPath def preprocess(uri: str, some_int: int, output_parameter_one: OutputPath(int), diff --git a/sdk/python/tests/compiler/testdata/withitem_nested.py b/sdk/python/tests/compiler/testdata/withitem_nested.py index 922370cea81..ad2eddc39fd 100644 --- a/sdk/python/tests/compiler/testdata/withitem_nested.py +++ b/sdk/python/tests/compiler/testdata/withitem_nested.py @@ -53,9 +53,10 @@ def pipeline(my_pipe_param: int = 10): if __name__ == '__main__': - from kfp.deprecated import compiler - import kfp.deprecated as kfp import time + + import kfp.deprecated as kfp + from kfp.deprecated import compiler client = kfp.Client(host='127.0.0.1:8080/pipeline') print(compiler.Compiler().compile(pipeline, package_path=None)) diff --git a/sdk/python/tests/compiler/testdata/withparam_global.py b/sdk/python/tests/compiler/testdata/withparam_global.py index dbf35216e55..35634613aff 100644 --- a/sdk/python/tests/compiler/testdata/withparam_global.py +++ b/sdk/python/tests/compiler/testdata/withparam_global.py @@ -45,9 +45,10 @@ def pipeline(loopidy_doop: list = [3, 5, 7, 9]): if __name__ == '__main__': - from kfp.deprecated import compiler - import kfp.deprecated as kfp import time + + import kfp.deprecated as kfp + from kfp.deprecated import compiler client = kfp.Client(host='127.0.0.1:8080/pipeline') print(compiler.Compiler().compile(pipeline, package_path=None)) diff --git a/sdk/python/tests/compiler/testdata/withparam_global_dict.py b/sdk/python/tests/compiler/testdata/withparam_global_dict.py index 5b75e642dc9..23ab626366d 100644 --- a/sdk/python/tests/compiler/testdata/withparam_global_dict.py +++ b/sdk/python/tests/compiler/testdata/withparam_global_dict.py @@ -45,9 +45,10 @@ def pipeline(loopidy_doop: dict = [{'a': 1, 'b': 2}, {'a': 10, 'b': 20}]): if __name__ == '__main__': - from kfp.deprecated import compiler - import kfp.deprecated as kfp import time + + import kfp.deprecated as kfp + from kfp.deprecated import compiler client = kfp.Client(host='127.0.0.1:8080/pipeline') print(compiler.Compiler().compile(pipeline, package_path=None)) diff --git a/sdk/python/tests/compiler/testdata/withparam_output.py b/sdk/python/tests/compiler/testdata/withparam_output.py index cd0abbd2f81..119f296a595 100644 --- a/sdk/python/tests/compiler/testdata/withparam_output.py +++ b/sdk/python/tests/compiler/testdata/withparam_output.py @@ -45,9 +45,10 @@ def pipeline(): if __name__ == '__main__': - from kfp.deprecated import compiler - import kfp.deprecated as kfp import time + + import kfp.deprecated as kfp + from kfp.deprecated import compiler client = kfp.Client(host='127.0.0.1:8080/pipeline') print(compiler.Compiler().compile(pipeline, package_path=None)) diff --git a/sdk/python/tests/compiler/testdata/withparam_output_dict.py b/sdk/python/tests/compiler/testdata/withparam_output_dict.py index ac37778bc90..36ce9d0f41e 100644 --- a/sdk/python/tests/compiler/testdata/withparam_output_dict.py +++ b/sdk/python/tests/compiler/testdata/withparam_output_dict.py @@ -45,9 +45,10 @@ def pipeline(): if __name__ == '__main__': - from kfp.deprecated import compiler - import kfp.deprecated as kfp import time + + import kfp.deprecated as kfp + from kfp.deprecated import compiler client = kfp.Client(host='127.0.0.1:8080/pipeline') print(compiler.Compiler().compile(pipeline, package_path=None)) diff --git a/sdk/python/tests/dsl/aws_extensions_tests.py b/sdk/python/tests/dsl/aws_extensions_tests.py index eaaf9208451..210e1a04aae 100644 --- a/sdk/python/tests/dsl/aws_extensions_tests.py +++ b/sdk/python/tests/dsl/aws_extensions_tests.py @@ -12,10 +12,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -from kfp.deprecated.dsl import ContainerOp -from kfp.deprecated.aws import use_aws_secret -import unittest import inspect +import unittest + +from kfp.deprecated.aws import use_aws_secret +from kfp.deprecated.dsl import ContainerOp class TestAwsExtension(unittest.TestCase): diff --git a/sdk/python/tests/dsl/component_bridge_tests.py b/sdk/python/tests/dsl/component_bridge_tests.py index 0554478d877..d9a7b79d7cb 100644 --- a/sdk/python/tests/dsl/component_bridge_tests.py +++ b/sdk/python/tests/dsl/component_bridge_tests.py @@ -16,11 +16,13 @@ import textwrap import unittest import warnings -import kfp.deprecated as kfp from pathlib import Path -from kfp.deprecated.components import load_component_from_text, create_component_from_func -from kfp.deprecated.dsl.types import InconsistentTypeException + +import kfp.deprecated as kfp +from kfp.deprecated.components import create_component_from_func +from kfp.deprecated.components import load_component_from_text from kfp.deprecated.dsl import PipelineParam +from kfp.deprecated.dsl.types import InconsistentTypeException class TestComponentBridge(unittest.TestCase): diff --git a/sdk/python/tests/dsl/component_tests.py b/sdk/python/tests/dsl/component_tests.py index 669d67e74fb..66b2229f25a 100644 --- a/sdk/python/tests/dsl/component_tests.py +++ b/sdk/python/tests/dsl/component_tests.py @@ -13,15 +13,22 @@ # limitations under the License. import sys -from typing import List, Optional import unittest +from typing import List, Optional import kfp.deprecated as kfp import kfp.deprecated.dsl as dsl -from kfp.deprecated.dsl import component, graph_component -from kfp.deprecated.dsl.types import Integer, GCSPath, InconsistentTypeException -from kfp.deprecated.dsl import ContainerOp, Pipeline, PipelineParam -from kfp.deprecated.components.structures import ComponentSpec, InputSpec, OutputSpec +from kfp.deprecated.components.structures import ComponentSpec +from kfp.deprecated.components.structures import InputSpec +from kfp.deprecated.components.structures import OutputSpec +from kfp.deprecated.dsl import ContainerOp +from kfp.deprecated.dsl import Pipeline +from kfp.deprecated.dsl import PipelineParam +from kfp.deprecated.dsl import component +from kfp.deprecated.dsl import graph_component +from kfp.deprecated.dsl.types import GCSPath +from kfp.deprecated.dsl.types import InconsistentTypeException +from kfp.deprecated.dsl.types import Integer @unittest.skip("deprecated") diff --git a/sdk/python/tests/dsl/extensions/test_kubernetes.py b/sdk/python/tests/dsl/extensions/test_kubernetes.py index dfd6fc52f5a..264692f13c3 100644 --- a/sdk/python/tests/dsl/extensions/test_kubernetes.py +++ b/sdk/python/tests/dsl/extensions/test_kubernetes.py @@ -12,10 +12,11 @@ # See the License for the specific language governing permissions and # limitations under the License. +import inspect +import unittest + from kfp.deprecated.dsl import ContainerOp from kfp.deprecated.dsl.extensions.kubernetes import use_secret -import unittest -import inspect class TestAddSecrets(unittest.TestCase): diff --git a/sdk/python/tests/dsl/main.py b/sdk/python/tests/dsl/main.py index fecce1a90de..eda3d62ac8a 100644 --- a/sdk/python/tests/dsl/main.py +++ b/sdk/python/tests/dsl/main.py @@ -12,23 +12,23 @@ # See the License for the specific language governing permissions and # limitations under the License. -import unittest import sys +import unittest import aws_extensions_tests -import pipeline_tests -import pipeline_param_tests -import container_op_tests -import ops_group_tests -import type_tests -import component_tests import component_bridge_tests +import component_tests +import container_op_tests +import extensions.test_kubernetes as test_kubernetes import metadata_tests +import ops_group_tests +import pipeline_param_tests +import pipeline_tests +import pipeline_volume_tests import resource_op_tests +import type_tests import volume_op_tests -import pipeline_volume_tests import volume_snapshotop_tests -import extensions.test_kubernetes as test_kubernetes if __name__ == '__main__': suite = unittest.TestSuite() diff --git a/sdk/python/tests/dsl/metadata_tests.py b/sdk/python/tests/dsl/metadata_tests.py index 76c09c7b6b1..f8f14471c8c 100644 --- a/sdk/python/tests/dsl/metadata_tests.py +++ b/sdk/python/tests/dsl/metadata_tests.py @@ -12,9 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -from kfp.deprecated.components.structures import ComponentSpec, InputSpec, OutputSpec import unittest +from kfp.deprecated.components.structures import ComponentSpec +from kfp.deprecated.components.structures import InputSpec +from kfp.deprecated.components.structures import OutputSpec + class TestComponentMeta(unittest.TestCase): diff --git a/sdk/python/tests/dsl/ops_group_tests.py b/sdk/python/tests/dsl/ops_group_tests.py index f64fb6cbe7b..ad1728a6109 100644 --- a/sdk/python/tests/dsl/ops_group_tests.py +++ b/sdk/python/tests/dsl/ops_group_tests.py @@ -12,10 +12,16 @@ # See the License for the specific language governing permissions and # limitations under the License. -import kfp.deprecated.dsl as dsl -from kfp.deprecated.dsl import Pipeline, PipelineParam, ContainerOp, ExitHandler, OpsGroup, Condition import unittest +import kfp.deprecated.dsl as dsl +from kfp.deprecated.dsl import Condition +from kfp.deprecated.dsl import ContainerOp +from kfp.deprecated.dsl import ExitHandler +from kfp.deprecated.dsl import OpsGroup +from kfp.deprecated.dsl import Pipeline +from kfp.deprecated.dsl import PipelineParam + class TestOpsGroup(unittest.TestCase): diff --git a/sdk/python/tests/dsl/pipeline_param_tests.py b/sdk/python/tests/dsl/pipeline_param_tests.py index e3b8756e2b4..8cdaf1badbf 100644 --- a/sdk/python/tests/dsl/pipeline_param_tests.py +++ b/sdk/python/tests/dsl/pipeline_param_tests.py @@ -12,11 +12,15 @@ # See the License for the specific language governing permissions and # limitations under the License. -from kubernetes.client.models import V1ConfigMap, V1Container, V1EnvVar -from kfp.deprecated.dsl import PipelineParam -from kfp.deprecated.dsl._pipeline_param import _extract_pipelineparams, extract_pipelineparams_from_any import unittest +from kfp.deprecated.dsl import PipelineParam +from kfp.deprecated.dsl._pipeline_param import _extract_pipelineparams +from kfp.deprecated.dsl._pipeline_param import extract_pipelineparams_from_any +from kubernetes.client.models import V1ConfigMap +from kubernetes.client.models import V1Container +from kubernetes.client.models import V1EnvVar + class TestPipelineParam(unittest.TestCase): diff --git a/sdk/python/tests/dsl/pipeline_tests.py b/sdk/python/tests/dsl/pipeline_tests.py index 4d3b9d99bc6..583475cfae1 100644 --- a/sdk/python/tests/dsl/pipeline_tests.py +++ b/sdk/python/tests/dsl/pipeline_tests.py @@ -12,12 +12,18 @@ # See the License for the specific language governing permissions and # limitations under the License. +import unittest + import kfp.deprecated as kfp -from kfp.deprecated.dsl import Pipeline, PipelineParam, ContainerOp, pipeline +from kfp.deprecated.components.structures import ComponentSpec +from kfp.deprecated.components.structures import InputSpec +from kfp.deprecated.dsl import ContainerOp +from kfp.deprecated.dsl import Pipeline +from kfp.deprecated.dsl import PipelineParam +from kfp.deprecated.dsl import pipeline from kfp.deprecated.dsl._metadata import _extract_pipeline_metadata -from kfp.deprecated.dsl.types import GCSPath, Integer -from kfp.deprecated.components.structures import ComponentSpec, InputSpec -import unittest +from kfp.deprecated.dsl.types import GCSPath +from kfp.deprecated.dsl.types import Integer class TestPipeline(unittest.TestCase): diff --git a/sdk/python/tests/dsl/test_azure_extensions.py b/sdk/python/tests/dsl/test_azure_extensions.py index 6ced0e7910c..734df600d09 100644 --- a/sdk/python/tests/dsl/test_azure_extensions.py +++ b/sdk/python/tests/dsl/test_azure_extensions.py @@ -12,10 +12,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -from kfp.deprecated.dsl import ContainerOp -from kfp.deprecated.azure import use_azure_secret -import unittest import inspect +import unittest + +from kfp.deprecated.azure import use_azure_secret +from kfp.deprecated.dsl import ContainerOp class AzExtensionTests(unittest.TestCase): diff --git a/sdk/python/tests/dsl/type_tests.py b/sdk/python/tests/dsl/type_tests.py index 117c6a40d52..66a7c2e5b5a 100644 --- a/sdk/python/tests/dsl/type_tests.py +++ b/sdk/python/tests/dsl/type_tests.py @@ -12,9 +12,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -from kfp.deprecated.dsl.types import check_types, GCSPath import unittest +from kfp.deprecated.dsl.types import GCSPath +from kfp.deprecated.dsl.types import check_types + class TestTypes(unittest.TestCase): diff --git a/sdk/python/tests/local_runner_test.py b/sdk/python/tests/local_runner_test.py index a2456cb162c..4d5d291e9ae 100644 --- a/sdk/python/tests/local_runner_test.py +++ b/sdk/python/tests/local_runner_test.py @@ -16,7 +16,8 @@ from typing import Callable import kfp.deprecated as kfp -from kfp.deprecated import LocalClient, run_pipeline_func_locally +from kfp.deprecated import LocalClient +from kfp.deprecated import run_pipeline_func_locally InputPath = kfp.components.InputPath() OutputPath = kfp.components.OutputPath()