Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Cached values produced by flytekit<1.13.6 cannot be used in flytekit>=1.13.6 #6125

Closed
2 tasks done
eapolinario opened this issue Dec 26, 2024 · 0 comments · Fixed by flyteorg/flytekit#3022
Closed
2 tasks done
Assignees
Labels
bug Something isn't working flytekit FlyteKit Python related issue

Comments

@eapolinario
Copy link
Contributor

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:

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:

/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
@eapolinario eapolinario added bug Something isn't working untriaged This issues has not yet been looked at by the Maintainers labels Dec 26, 2024
@eapolinario eapolinario added flytekit FlyteKit Python related issue and removed untriaged This issues has not yet been looked at by the Maintainers labels Dec 26, 2024
@eapolinario eapolinario self-assigned this Dec 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working flytekit FlyteKit Python related issue
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant