<#6125 [BUG] Cached values produced by flytekit&lt...
# flytekit
c
#6125 [BUG] Cached values produced by flytekit&lt;1.13.6 cannot be used in flytekit&gt;=1.13.6 Issue created by eapolinario Describe the bug If we use flytekit<1.13.6 and cache a value such value cannot be used if flytekit is upgraded. For example:
Copy code
from flytekit import task, workflow

@task(cache=True, cache_version="1")
def t() -> int:
    return 42

@task
def t1(x: int):
    pass

@workflow
def wf():
    t1(t())
If we run this first with flytekit<1.13.6 and then upgrade to 1.14.2 we get this error:
Copy code
/var/folders/p4/qvgny9x95p5_vhdc7gxh2hsc0000gn/T/tmp.9Qm48s4GPr                                                                 tmp.9Qm48s4GPr
❯ pyflyte local-cache clear

/var/folders/p4/qvgny9x95p5_vhdc7gxh2hsc0000gn/T/tmp.9Qm48s4GPr                                                                 tmp.9Qm48s4GPr
❯ pyflyte run t.py wf
Running Execution on local.


/var/folders/p4/qvgny9x95p5_vhdc7gxh2hsc0000gn/T/tmp.9Qm48s4GPr                                                                 tmp.9Qm48s4GPr
❯ uv pip install flytekit==1.14.2
Resolved 94 packages in 24ms
Uninstalled 1 package in 38ms
Installed 1 package in 10ms
 - flytekit==1.13.0
 + flytekit==1.14.2

/var/folders/p4/qvgny9x95p5_vhdc7gxh2hsc0000gn/T/tmp.9Qm48s4GPr                                                                 tmp.9Qm48s4GPr
❯ pyflyte run t.py wf
Running Execution on local.
╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ /private/var/folders/p4/qvgny9x95p5_vhdc7gxh2hsc0000gn/T/tmp.9Qm48s4GPr/t.py:13 in wf            │
│                                                                                                  │
│   10                                                                                             │
│   11 @workflow                                                                                   │
│   12 def wf():                                                                                   │
│ ❱ 13 │   t1(t())                                                                                 │
│   14                                                                                             │
│                                                                                                  │
│ /Users/eduardo/.local/share/uv/python/cpython-3.12.5-macos-aarch64-none/lib/python3.12/concurren │
│ t/futures/_base.py:456 in result                                                                 │
│                                                                                                  │
│   453 │   │   │   │   if self._state in [CANCELLED, CANCELLED_AND_NOTIFIED]:                     │
│   454 │   │   │   │   │   raise CancelledError()                                                 │
│   455 │   │   │   │   elif self._state == FINISHED:                                              │
│ ❱ 456 │   │   │   │   │   return self.__get_result()                                             │
│   457 │   │   │   │   else:                                                                      │
│   458 │   │   │   │   │   raise TimeoutError()                                                   │
│   459 │   │   finally:                                                                           │
│                                                                                                  │
│ /Users/eduardo/.local/share/uv/python/cpython-3.12.5-macos-aarch64-none/lib/python3.12/concurren │
│ t/futures/_base.py:401 in __get_result                                                           │
│                                                                                                  │
│   398 │   def __get_result(self):                                                                │
│   399 │   │   if self._exception:                                                                │
│   400 │   │   │   try:                                                                           │
│ ❱ 401 │   │   │   │   raise self._exception                                                      │
│   402 │   │   │   finally:                                                                       │
│   403 │   │   │   │   # Break a reference cycle with the exception in self._exception            │
│   404 │   │   │   │   self = None                                                                │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
AttributeError: Error encountered while converting inputs of 't.t1':
  'Literal' object has no attribute '_offloaded_metadata'
Expected behavior We should be able to reuse cached values across flytekit versions. Additional context to reproduce In description. Screenshots No response Are you sure this issue hasn't been raised already? • Yes Have you read the Code of Conduct? • Yes flyteorg/flyte