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 - Made it easier to access component spec classes #2860

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
2 changes: 1 addition & 1 deletion sdk/python/kfp/compiler/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
from ._op_to_template import _op_to_template
from ._default_transformers import add_pod_env

from ..components._structures import InputSpec
from ..components.structures import InputSpec
from ..dsl._metadata import _extract_pipeline_metadata
from ..dsl._ops_group import OpsGroup

Expand Down
2 changes: 1 addition & 1 deletion sdk/python/kfp/components/_component_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import requests
from typing import Callable
from . import _components as comp
from ._structures import ComponentReference
from .structures import ComponentReference

class ComponentStore:
def __init__(self, local_search_paths=None, url_search_prefixes=None):
Expand Down
3 changes: 1 addition & 2 deletions sdk/python/kfp/components/_components.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
from typing import Any, List, Mapping, NamedTuple, Sequence, Union
from ._naming import _sanitize_file_name, _sanitize_python_function_name, generate_unique_name_conversion_table
from ._yaml_utils import load_yaml
from ._structures import ComponentSpec
from ._structures import *
from .structures import *
from ._data_passing import serialize_value, type_name_to_type


Expand Down
2 changes: 1 addition & 1 deletion sdk/python/kfp/components/_dsl_bridge.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

import copy
from typing import Any, Mapping
from ._structures import ComponentSpec, ComponentReference
from .structures import ComponentSpec, ComponentReference
from ._components import _default_component_name, _resolve_command_line_and_paths
from .. import dsl

Expand Down
2 changes: 1 addition & 1 deletion sdk/python/kfp/components/_python_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
from ._components import _create_task_factory_from_component_spec
from ._data_passing import serialize_value, type_name_to_deserializer, type_name_to_serializer, type_to_type_name
from ._naming import _make_name_unique_by_adding_index
from ._structures import *
from .structures import *

import inspect
from pathlib import Path
Expand Down
1 change: 1 addition & 0 deletions sdk/python/kfp/components/structures/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .._structures import *
2 changes: 1 addition & 1 deletion sdk/python/kfp/dsl/_container_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
)

from . import _pipeline_param
from ..components._structures import ComponentSpec
from ..components.structures import ComponentSpec

# generics
T = TypeVar('T')
Expand Down
2 changes: 1 addition & 1 deletion sdk/python/kfp/dsl/_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import warnings
from .types import BaseType, _check_valid_type_dict
from ..components._data_passing import serialize_value
from ..components._structures import ComponentSpec, InputSpec, OutputSpec
from ..components.structures import ComponentSpec, InputSpec, OutputSpec


def _annotation_to_typemeta(annotation):
Expand Down
2 changes: 1 addition & 1 deletion sdk/python/tests/components/test_components.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def test_accessing_component_spec_from_task_factory(self):
actual_component_spec = task_factory1.component_spec
actual_component_spec_dict = actual_component_spec.to_dict()
expected_component_spec_dict = load_yaml(component_text)
expected_component_spec = kfp.components._structures.ComponentSpec.from_dict(expected_component_spec_dict)
expected_component_spec = kfp.components.structures.ComponentSpec.from_dict(expected_component_spec_dict)
self.assertEqual(expected_component_spec_dict, actual_component_spec_dict)
self.assertEqual(expected_component_spec, task_factory1.component_spec)

Expand Down
2 changes: 1 addition & 1 deletion sdk/python/tests/components/test_graph_components.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@


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

from kfp.components._yaml_utils import load_yaml

Expand Down
2 changes: 1 addition & 1 deletion sdk/python/tests/components/test_python_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ def my_func( # noqa: F722

component_spec = comp._python_op._extract_component_interface(my_func)

from kfp.components._structures import InputSpec, OutputSpec
from kfp.components.structures import InputSpec, OutputSpec
self.assertEqual(
component_spec.inputs,
[
Expand Down
2 changes: 1 addition & 1 deletion sdk/python/tests/dsl/component_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from kfp.dsl import component, graph_component
from kfp.dsl.types import Integer, GCSPath, InconsistentTypeException
from kfp.dsl import ContainerOp, Pipeline, PipelineParam
from kfp.components._structures import ComponentSpec, InputSpec, OutputSpec
from kfp.components.structures import ComponentSpec, InputSpec, OutputSpec
import unittest

class TestPythonComponent(unittest.TestCase):
Expand Down
2 changes: 1 addition & 1 deletion sdk/python/tests/dsl/metadata_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from kfp.components._structures import ComponentSpec, InputSpec, OutputSpec
from kfp.components.structures import ComponentSpec, InputSpec, OutputSpec
import unittest


Expand Down
2 changes: 1 addition & 1 deletion sdk/python/tests/dsl/pipeline_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from kfp.dsl import Pipeline, PipelineParam, ContainerOp, pipeline
from kfp.dsl._metadata import _extract_pipeline_metadata
from kfp.dsl.types import GCSPath, Integer
from kfp.components._structures import ComponentSpec, InputSpec
from kfp.components.structures import ComponentSpec, InputSpec
import unittest


Expand Down