Skip to content

Commit

Permalink
fix(sdk): use kfp.dsl.types to replace kfp.components.types Fixes kub…
Browse files Browse the repository at this point in the history
…eflow#10282 (kubeflow#10283)

* use kfp.dsl.types to replace kfp.components.types

Fixes: kubeflow#10282
Signed-off-by: hsinhoyeh <[email protected]>

* fix import artifact_types

---------

Signed-off-by: hsinhoyeh <[email protected]>
  • Loading branch information
hsinhoyeh authored and stijntratsaertit committed Feb 16, 2024
1 parent 92836de commit b110742
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion samples/core/loop_output/loop_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def args_generator_op() -> str:


# TODO(Bobgy): how can we make this component with type float?
# got error: kfp.components.types.type_utils.InconsistentTypeException:
# got error: kfp.dsl.types.type_utils.InconsistentTypeException:
# Incompatible argument passed to the input "s" of component "Print op": Argument
# type "STRING" is incompatible with the input type "NUMBER_DOUBLE"
@dsl.component
Expand Down
2 changes: 1 addition & 1 deletion sdk/python/kfp/deprecated/dsl/_component_bridge.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
from kfp.deprecated.dsl import component_spec as dsl_component_spec
from kfp.deprecated.dsl import dsl_utils
from kfp.deprecated.dsl import types
from kfp.deprecated.dsl.types import type_utils
from kfp.pipeline_spec import pipeline_spec_pb2
from kfp.components.types import type_utils

# Placeholder to represent the output directory hosting all the generated URIs.
# Its actual value will be specified during pipeline compilation.
Expand Down
7 changes: 3 additions & 4 deletions sdk/python/kfp/deprecated/dsl/type_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,22 @@
# 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.
"""Deprecated. See kfp.components.types.type_utils instead.
"""Deprecated. See kfp.dsl.types.type_utils instead.
This module will be removed in KFP v2.0.
"""
import warnings
from kfp.components.types import type_utils
from kfp.dsl.types import type_utils, artifact_types
from kfp.pipeline_spec import pipeline_spec_pb2
import inspect
from typing import Union, Type
import re
from typing import List, Optional
from kfp.deprecated.components import _structures
from kfp.components.types import artifact_types

warnings.warn(
'Module kfp.dsl.type_utils is deprecated and will be removed'
' in KFP v2.0. Please use from kfp.components.types.type_utils instead.',
' in KFP v2.0. Please use from kfp.dsl.types.type_utils instead.',
category=FutureWarning)

is_parameter_type = type_utils.is_parameter_type
Expand Down
2 changes: 1 addition & 1 deletion sdk/python/kfp/deprecated/dsl/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from typing import Dict, Union
import warnings

from kfp.components.types import type_utils
from kfp.deprecated.dsl import type_utils


class BaseType:
Expand Down

0 comments on commit b110742

Please sign in to comment.