diff --git a/flytekit/core/context_manager.py b/flytekit/core/context_manager.py index c51b60c1c9..506e55c829 100644 --- a/flytekit/core/context_manager.py +++ b/flytekit/core/context_manager.py @@ -547,7 +547,7 @@ def with_params( user_space_params=user_space_params if user_space_params else self.user_space_params, ) - def is_local_execution(self): + def is_local_execution(self) -> bool: return ( self.mode == ExecutionState.Mode.LOCAL_TASK_EXECUTION or self.mode == ExecutionState.Mode.LOCAL_WORKFLOW_EXECUTION diff --git a/flytekit/types/file/file.py b/flytekit/types/file/file.py index 567b29de57..5304fd21ed 100644 --- a/flytekit/types/file/file.py +++ b/flytekit/types/file/file.py @@ -440,7 +440,7 @@ def to_literal( # Set the remote destination if one was given instead of triggering a random one below remote_path = python_val.remote_path or None - if ctx.execution_state.is_local_execution and python_val.remote_path is None: + if ctx.execution_state.is_local_execution() and python_val.remote_path is None: should_upload = False elif isinstance(python_val, pathlib.Path) or isinstance(python_val, str): @@ -458,7 +458,7 @@ def to_literal( p = pathlib.Path(python_val) if not p.is_file(): raise TypeTransformerFailedError(f"Error converting {python_val} because it's not a file.") - if ctx.execution_state.is_local_execution: + if ctx.execution_state.is_local_execution(): should_upload = False # python_type must be os.PathLike - see check at beginning of function else: