Skip to content

Commit

Permalink
remove deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
ji-yaqi committed Feb 14, 2022
1 parent ebbc687 commit 06e95ea
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 773 deletions.
4 changes: 4 additions & 0 deletions sdk/python/kfp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,7 @@

__version__ = '2.0.0b0'

TYPE_CHECK = True
# COMPILING_FOR_V2 is True when using kfp.v2.compiler or use (v1) kfp.compiler
# with V2_COMPATIBLE or V2_ENGINE mode
COMPILING_FOR_V2 = False
2 changes: 1 addition & 1 deletion sdk/python/kfp/deprecated/dsl/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from ._pipeline_volume import PipelineVolume
from ._volume_snapshot_op import VolumeSnapshotOp
from ._ops_group import OpsGroup, ExitHandler, Condition, ParallelFor, SubGraph
from ._component import python_component, graph_component, component
from ._component import graph_component, component


def importer(*args, **kwargs):
Expand Down
96 changes: 48 additions & 48 deletions sdk/python/kfp/deprecated/dsl/_component.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,54 +20,54 @@
import kfp.deprecated as kfp


@deprecated(
version='0.2.6',
reason='This decorator does not seem to be used, so we deprecate it. '
'If you need this decorator, please create an issue at '
'https://github.com/kubeflow/pipelines/issues',
)
def python_component(name,
description=None,
base_image=None,
target_component_file: str = None):
"""Decorator for Python component functions.
This decorator adds the metadata to the function object itself.
Args:
name: Human-readable name of the component
description: Optional. Description of the component
base_image: Optional. Docker container image to use as the base of the
component. Needs to have Python 3.5+ installed.
target_component_file: Optional. Local file to store the component
definition. The file can then be used for sharing.
Returns:
The same function (with some metadata fields set).
Example:
::
@dsl.python_component(
name='my awesome component',
description='Come, Let\'s play',
base_image='tensorflow/tensorflow:1.11.0-py3',
)
def my_component(a: str, b: int) -> str:
...
"""

def _python_component(func):
func._component_human_name = name
if description:
func._component_description = description
if base_image:
func._component_base_image = base_image
if target_component_file:
func._component_target_component_file = target_component_file
return func

return _python_component
# @deprecated(
# version='0.2.6',
# reason='This decorator does not seem to be used, so we deprecate it. '
# 'If you need this decorator, please create an issue at '
# 'https://github.com/kubeflow/pipelines/issues',
# )
# def python_component(name,
# description=None,
# base_image=None,
# target_component_file: str = None):
# """Decorator for Python component functions.

# This decorator adds the metadata to the function object itself.

# Args:
# name: Human-readable name of the component
# description: Optional. Description of the component
# base_image: Optional. Docker container image to use as the base of the
# component. Needs to have Python 3.5+ installed.
# target_component_file: Optional. Local file to store the component
# definition. The file can then be used for sharing.

# Returns:
# The same function (with some metadata fields set).

# Example:
# ::

# @dsl.python_component(
# name='my awesome component',
# description='Come, Let\'s play',
# base_image='tensorflow/tensorflow:1.11.0-py3',
# )
# def my_component(a: str, b: int) -> str:
# ...
# """

# def _python_component(func):
# func._component_human_name = name
# if description:
# func._component_description = description
# if base_image:
# func._component_base_image = base_image
# if target_component_file:
# func._component_target_component_file = target_component_file
# return func

# return _python_component


def component(func):
Expand Down
1 change: 0 additions & 1 deletion sdk/python/kfp/deprecated/dsl/_component_bridge.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import pathlib
from typing import Any, Mapping, Optional

# import kfp.deprecated as kfp
from kfp.deprecated._config import COMPILING_FOR_V2
from kfp.deprecated.components import _structures, _data_passing
from kfp.deprecated.components import _components
Expand Down
Loading

0 comments on commit 06e95ea

Please sign in to comment.