Improved flyte error messages #3502
Replies: 9 comments 1 reply
-
Basic pyflyte usage errors can be hard to trace. Described here is using pyflyte with invalid projects or domains.
A side request would be some mechanism for changing the default project or domain as 'flytesnacks' doesn't make sense beyond initial setup |
Beta Was this translation helpful? Give feedback.
-
Look into the |
Beta Was this translation helpful? Give feedback.
-
TODO: move this issue into a discussion to have a persistent place to crowd-source these from the community. Create separate issues for
|
Beta Was this translation helpful? Give feedback.
-
Adding some cryptic error messages |
Beta Was this translation helpful? Give feedback.
-
The type transformer errors can be confusing at first. Users need to read between the lines to figure out what is wrong. Let's illustrate this using the following function @task
def bad_types(a: int) -> float:
return str(a) Case 1: Output Type Issuebad_types(a=1)
"""
TypeError: Failed to convert return value for var o0 for function bad_types with error <class 'flytekit.core.type_engine.TypeTransformerFailedError'>: Type of Val '1' is not an instance of <class 'float'>
""" It is not immediately clear what Case 2: Input Type Ussuebad_types(a=str(1))
"""
TypeTransformerFailedError: Type of Val '1' is not an instance of <class 'int'>
""" I don't see the input name Case 3: Intermediate ValuesStructuring the error around the value, e.g. import random
@task
def add_rand(n: int) -> float:
return float(n + random.randint(-1000, 1000))
@task
def wf(a: int, b: int):
bad_types(a=add_rand(n=a), b=b)
wf(a=1, b=1)
"""
TypeTransformerFailedError: Cannot convert literal scalar {
primitive {
float_value: -195.0
}
}
to <class 'int'>
""" I don't know which has the error unless I trace back through the code, which is difficult with complex workflows. SuggestionsI believe this would be much less confusing if
|
Beta Was this translation helpful? Give feedback.
-
Revise the error message for an empty FlyteDirectory, which currently displays as follows:
The reason the workflow is failing is because the directory is empty. However, the error message is misleading the user to think that it's due to incorrect permissions. |
Beta Was this translation helpful? Give feedback.
-
We should enhance the error message for type incompatibility. Here's the code I'm trying to register: from flytekit import task, workflow
@task
def t1() -> int:
return "hello"
@task
def t2(x: str) -> str:
return x
@workflow
def wf():
t2(x=t1()) I am encountering the following error:
|
Beta Was this translation helpful? Give feedback.
-
I don't mean to revive a very old issue, but I think it is relevant to the following PR to improve audience mismatch debugging: #5078 Old message:
New message:
|
Beta Was this translation helpful? Give feedback.
-
Awesome @ddl-rliu |
Beta Was this translation helpful? Give feedback.
-
Motivation: Why do you think this is important?
Today, error messages are hard to decipher: all the user knows is that something went wrong in a task/workflow. The purpose of this issue is to improve these error messages by:
🤝 Community call to action!
If you'd like to contribute to this effort, please create a comment on this issue with the following
information:
Goal: What should the final outcome look like, ideally?
First we need to compile a list of errors to improve!
Describe alternatives you've considered
The alternative is the current state, which makes the UX suffer
Propose: Link/Inline OR Additional context
No response
Are you sure this issue hasn't been raised already?
Have you read the Code of Conduct?
Beta Was this translation helpful? Give feedback.
All reactions