From 56eb0d08509cce0f28d07db03b350fc3ecf77781 Mon Sep 17 00:00:00 2001 From: Sangeetha Jana Date: Wed, 23 Oct 2024 14:15:07 +0530 Subject: [PATCH] Use 'local_pip_package_path' to install pip when the path refers to a remote file system (#6937) * Use local_pip_package_path to install pip when the path refers to a remote file system * Initialised local_pip_package_path * Initialised local_pip_package_path to empty string * Initialised local_pip_package_path to empty list * Added additional list local_pip_packages * Trimmed trailing whitespace --- tfx/components/evaluator/executor.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tfx/components/evaluator/executor.py b/tfx/components/evaluator/executor.py index f01f2e12e3..39a2a141dd 100644 --- a/tfx/components/evaluator/executor.py +++ b/tfx/components/evaluator/executor.py @@ -119,8 +119,10 @@ def Do(self, input_dict: Dict[str, List[types.Artifact]], # Make sure user packages get propagated to the remote Beam worker. unused_module_path, extra_pip_packages = udf_utils.decode_user_module_key( exec_properties.get(standard_component_specs.MODULE_PATH_KEY, None)) + local_pip_packages = [] for pip_package_path in extra_pip_packages: local_pip_package_path = io_utils.ensure_local(pip_package_path) + local_pip_packages.append(local_pip_package_path) self._beam_pipeline_args.append('--extra_package=%s' % local_pip_package_path) @@ -241,7 +243,7 @@ def Do(self, input_dict: Dict[str, List[types.Artifact]], # may be created by the Beam multi-process DirectRunner) can find the # needed dependencies. # TODO(b/187122662): Move this to the ExecutorOperator or Launcher. - with udf_utils.TempPipInstallContext(extra_pip_packages): + with udf_utils.TempPipInstallContext(local_pip_packages): with self._make_beam_pipeline() as pipeline: examples_list = [] tensor_adapter_config = None