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] Cache loading of nested list fails #3901

Closed
2 tasks done
fellhorn opened this issue Jul 27, 2023 · 4 comments
Closed
2 tasks done

[BUG] Cache loading of nested list fails #3901

fellhorn opened this issue Jul 27, 2023 · 4 comments
Assignees
Labels
backlogged For internal use. Reserved for contributor team workflow. bug Something isn't working exo
Milestone

Comments

@fellhorn
Copy link
Contributor

Describe the bug

Flytepropeller fails loading the cache for a nested list if one sub-list is empty.

Minimal example workflow:

from flytekit import workflow, task

@task(
    cache=True,
    cache_version="0"
)
def my_task() -> list[list[str]]:
    return [["foo"], []]

@workflow
def my_workflow():
    my_task()

Flytepropeller logs show this error:

Error when trying to reconcile workflow. Error [Failed to check Catalog for previous results: unexpected artifactData: [o0] type: [collection_type:<union_type:<variants:<collection_type:<simple:NONE > > variants:<collection_type:<simple:STRING > > > > ]

which looks like that it interprets the type of

{
	"o0": [
		["foo"],
		[]
	]
}

as

list[Union[list[None],list[str]]

instead of

list[list[str]]

User experience

For the user the task is just stuck in Queued and they need access to the flytepropeller logs to do any debugging.

Expected behavior

  • Caching should also work for these nested lists with empty sub-lists
  • Ideally flytepropeller error logs are present in the frontend and the task fails for caching issues instead of being stuck in Queued

Additional context to reproduce

  1. Execute the workflow from above once to write the cache
  2. Execute it a second time and the task should be stuck in Queued

Screenshots

No response

Are you sure this issue hasn't been raised already?

  • Yes

Have you read the Code of Conduct?

  • Yes
@fellhorn fellhorn added bug Something isn't working untriaged This issues has not yet been looked at by the Maintainers labels Jul 27, 2023
@eapolinario eapolinario removed the untriaged This issues has not yet been looked at by the Maintainers label Jul 28, 2023
@fellhorn
Copy link
Contributor Author

fellhorn commented Aug 1, 2023

It seems like the underlying issue is connected to different types in the sublists. E.g. this workflow will hang too:

from typing import Union

from flytekit import workflow, task

@task(
    cache=True,
    cache_version="union_list"
)
def my_task() -> list[list[Union[str,int]]]:
    return [["foo"], [2]]

@workflow
def my_workflow():
    my_task()

@hamersaw hamersaw added this to the 1.9 milestone Aug 7, 2023
@hamersaw
Copy link
Contributor

hamersaw commented Aug 7, 2023

This is related to flyteorg/flytepropeller#599, but the problem seems to be slightly different. In this scenario, the validation between union in collection is causing issues with validation. Will explore further.

@hamersaw hamersaw added exo backlogged For internal use. Reserved for contributor team workflow. labels Nov 8, 2023
@pvditt pvditt self-assigned this Jan 24, 2024
@hamersaw
Copy link
Contributor

closed as completed

@fellhorn
Copy link
Contributor Author

Thank you :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlogged For internal use. Reserved for contributor team workflow. bug Something isn't working exo
Projects
None yet
Development

No branches or pull requests

4 participants