From 9097e69b024439f697406d89564fcd9857df8af9 Mon Sep 17 00:00:00 2001
From: ggydush <greggydush@gmail.com>
Date: Wed, 12 Jun 2024 09:31:36 -0700
Subject: [PATCH] fix: Fix another location of should upload

Signed-off-by: ggydush <greggydush@gmail.com>
---
 flytekit/types/file/file.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/flytekit/types/file/file.py b/flytekit/types/file/file.py
index 347dc81a25..c36e1bb32a 100644
--- a/flytekit/types/file/file.py
+++ b/flytekit/types/file/file.py
@@ -435,6 +435,8 @@ def to_literal(
                     f" specified. Since a simpler type was specified, we'll skip uploading!"
                 )
                 should_upload = False
+            if ctx.execution_state.is_local_execution:
+                should_upload = False
 
             # Set the remote destination if one was given instead of triggering a random one below
             remote_path = python_val.remote_path or None