From d83933dafd7ae84659c9dff7d170b8655b81df82 Mon Sep 17 00:00:00 2001 From: Judah Rand <17158624+judahrand@users.noreply.github.com> Date: Wed, 8 Sep 2021 15:19:49 +0100 Subject: [PATCH] Don't return `pip install` with no packages If an empty list is provided no command should be returned to avoid a broken command eg. `pip install ` --- sdk/python/kfp/v2/components/component_factory.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/python/kfp/v2/components/component_factory.py b/sdk/python/kfp/v2/components/component_factory.py index a4f0d4e9dee9..6e6a8b01ec50 100644 --- a/sdk/python/kfp/v2/components/component_factory.py +++ b/sdk/python/kfp/v2/components/component_factory.py @@ -35,7 +35,7 @@ def _python_function_name_to_component_name(name): def _get_packages_to_install_command( package_list: Optional[List[str]] = None) -> List[str]: result = [] - if package_list is not None: + if package_list: install_pip_command = 'python3 -m ensurepip' install_packages_command = ( 'PIP_DISABLE_PIP_VERSION_CHECK=1 python3 -m pip install --quiet \