Skip to content

Commit

Permalink
SDK - Components - Removed the deprecated _python_op.get_default_base…
Browse files Browse the repository at this point in the history
…_image and set_default_base_image functions (#3773)
  • Loading branch information
Ark-kun committed May 18, 2020
1 parent af4e8ef commit 55d41df
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 18 deletions.
16 changes: 0 additions & 16 deletions sdk/python/kfp/components/_python_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
'func_to_container_op',
'func_to_component_text',
'default_base_image_or_builder',
'get_default_base_image',
'set_default_base_image',
'InputPath',
'InputTextFile',
'InputBinaryFile',
Expand All @@ -37,7 +35,6 @@
from pathlib import Path
import typing
from typing import Callable, Generic, List, TypeVar, Union
from deprecated.sphinx import deprecated

T = TypeVar('T')

Expand Down Expand Up @@ -100,19 +97,6 @@ def make_parent_dirs_and_return_path(file_path: str):
#TODO: Replace this image name with another name once people decide what to replace it with.
default_base_image_or_builder='tensorflow/tensorflow:1.13.2-py3'

@deprecated(version='0.1.32', reason='Use the kfp.components.default_base_image_or_builder variable instead')
def get_default_base_image() -> Union[str, Callable[[], str]]:
return default_base_image_or_builder


@deprecated(version='0.1.32', reason='Use the kfp.components.default_base_image_or_builder variable instead')
def set_default_base_image(image_or_factory: Union[str, Callable[[], str]]):
'''set_default_base_image sets the name of the container image that will be used for component creation when base_image is not specified.
Alternatively, the base image can also be set to a factory function that will be returning the image.
'''
global default_base_image_or_builder
default_base_image_or_builder = image_or_factory


def _python_function_name_to_component_name(name):
import re
Expand Down
4 changes: 2 additions & 2 deletions sdk/python/kfp/containers/_component_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,8 @@ def build_python_component(component_func, target_image, base_image=None, depend
if base_image is None:
base_image = getattr(component_func, '_component_base_image', None)
if base_image is None:
from ..components._python_op import get_default_base_image
base_image = get_default_base_image()
from ..components._python_op import default_base_image_or_builder
base_image = default_base_image_or_builder
if isinstance(base_image, Callable):
base_image = base_image()

Expand Down

0 comments on commit 55d41df

Please sign in to comment.