Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SDK - Components - Use relative imports for tests #3784

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions sdk/python/kfp/components_tests/test_components.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
from pathlib import Path


import kfp.components as comp
from kfp.components._components import _resolve_command_line_and_paths
from kfp.components._yaml_utils import load_yaml
from kfp.components.structures import ComponentSpec
from .. import components as comp
from ..components._components import _resolve_command_line_and_paths
from ..components._yaml_utils import load_yaml
from ..components.structures import ComponentSpec


class LoadComponentTestCase(unittest.TestCase):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from kfp.components import load_component_from_url
from ...components import load_component_from_url

automl_create_dataset_for_tables_op = load_component_from_url('https://raw.githubusercontent.com/kubeflow/pipelines/b3179d86b239a08bf4884b50dbf3a9151da96d66/components/gcp/automl/create_dataset_for_tables/component.yaml')
automl_import_data_from_bigquery_source_op = load_component_from_url('https://raw.githubusercontent.com/kubeflow/pipelines/b3179d86b239a08bf4884b50dbf3a9151da96d66/components/gcp/automl/import_data_from_bigquery/component.yaml')
Expand Down
6 changes: 3 additions & 3 deletions sdk/python/kfp/components_tests/test_graph_components.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
from pathlib import Path


import kfp.components as comp
from kfp.components.structures import ComponentReference, ComponentSpec, ContainerSpec, GraphInputReference, GraphSpec, InputSpec, InputValuePlaceholder, GraphImplementation, OutputPathPlaceholder, OutputSpec, TaskOutputArgument, TaskSpec
from .. import components as comp
from ..components.structures import ComponentReference, ComponentSpec, ContainerSpec, GraphInputReference, GraphSpec, InputSpec, InputValuePlaceholder, GraphImplementation, OutputPathPlaceholder, OutputSpec, TaskOutputArgument, TaskSpec

from kfp.components._yaml_utils import load_yaml
from ..components._yaml_utils import load_yaml

class GraphComponentTestCase(unittest.TestCase):
def test_handle_constructing_graph_component(self):
Expand Down
8 changes: 4 additions & 4 deletions sdk/python/kfp/components_tests/test_python_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
from pathlib import Path
from typing import Callable, NamedTuple, Sequence

import kfp.components as comp
from kfp.components import InputPath, InputTextFile, InputBinaryFile, OutputPath, OutputTextFile, OutputBinaryFile
from kfp.components.structures import InputSpec, OutputSpec
from kfp.components._components import _resolve_command_line_and_paths
from .. import components as comp
from ..components import InputPath, InputTextFile, InputBinaryFile, OutputPath, OutputTextFile, OutputBinaryFile
from ..components.structures import InputSpec, OutputSpec
from ..components._components import _resolve_command_line_and_paths

def add_two_numbers(a: float, b: float) -> float:
'''Returns sum of two arguments'''
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
from collections import OrderedDict
from pathlib import Path

import kfp.components as comp
from kfp.components._python_to_graph_component import create_graph_component_spec_from_pipeline_func
from .. import components as comp
from ..components._python_to_graph_component import create_graph_component_spec_from_pipeline_func


class PythonPipelineToGraphComponentTestCase(unittest.TestCase):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from pathlib import Path

from typing import List, Dict, Union, Optional
from kfp.components.modelbase import ModelBase
from ..components.modelbase import ModelBase

class TestModel1(ModelBase):
_serialized_names = {
Expand Down