Skip to content

Commit

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

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

Fixes: #10282
Signed-off-by: hsinhoyeh <yhh92u@gmail.com>

* fix import artifact_types

---------

Signed-off-by: hsinhoyeh <yhh92u@gmail.com>
  • Loading branch information
hsinhoyeh committed Dec 13, 2023
1 parent 2edfb89 commit b40912c
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
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
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
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
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 b40912c

Please sign in to comment.