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 - Moved _dsl_bridge to dsl #3267

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
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@

import copy
from typing import Any, Mapping
from .structures import ComponentSpec, ComponentReference
from ._components import _default_component_name, _resolve_command_line_and_paths
from ..components.structures import ComponentSpec, ComponentReference
from ..components._components import _default_component_name, _resolve_command_line_and_paths
from ..components._naming import _sanitize_python_function_name, generate_unique_name_conversion_table
from .. import dsl


Expand All @@ -40,7 +41,6 @@ def _create_container_op_from_component_and_arguments(
)

#Renaming outputs to conform with ContainerOp/Argo
from ._naming import _sanitize_python_function_name, generate_unique_name_conversion_table
output_names = (resolved_cmd.output_paths or {}).keys()
output_name_to_python = generate_unique_name_conversion_table(output_names, _sanitize_python_function_name)
output_paths_for_container_op = {output_name_to_python[name]: path for name, path in resolved_cmd.output_paths.items()}
Expand Down
5 changes: 3 additions & 2 deletions sdk/python/kfp/dsl/_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@
from . import _container_op
from . import _resource_op
from . import _ops_group
from ._component_bridge import _create_container_op_from_component_and_arguments
from ..components import _components
from ..components._naming import _make_name_unique_by_adding_index
from ..components import _dsl_bridge, _components
import sys


Expand Down Expand Up @@ -191,7 +192,7 @@ def __enter__(self):

Pipeline._default_pipeline = self
self._old_container_task_constructor = _components._container_task_constructor
_components._container_task_constructor = _dsl_bridge._create_container_op_from_component_and_arguments
_components._container_task_constructor = _create_container_op_from_component_and_arguments

def register_op_and_generate_id(op):
return self.add_op(op, op.is_exit_handler)
Expand Down
2 changes: 1 addition & 1 deletion sdk/python/tests/dsl/component_bridge_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class TestComponentBridge(unittest.TestCase):
# Alternatively, we could use kfp.dsl.Pipleine().__enter__ and __exit__
def setUp(self):
self.old_container_task_constructor = kfp.components._components._container_task_constructor
kfp.components._components._container_task_constructor = kfp.components._dsl_bridge._create_container_op_from_component_and_arguments
kfp.components._components._container_task_constructor = kfp.dsl._component_bridge._create_container_op_from_component_and_arguments

def tearDown(self):
kfp.components._components._container_task_constructor = self.old_container_task_constructor
Expand Down