Open fg91 opened 1 week ago
The issue arises because Flyte's backend cannot unambiguously select a variant from the union type when validating the workflow. This is due to the unionTypeChecker
failing to differentiate between the union variants A
and B
as both are treated as simple:STRUCT
.
Would you like more detailed steps on how to address this issue or further explanation on the underlying mechanics?
Sources:
This is an AI-generated response and your feedback is appreciated! Please leave a 👍 if this is helpful and 👎 if it is not.
Mention @runllm to ask follow-up questions. See runllm.com for more!
@RunLLM Can I work on this issue ?
The issue arises because Flyte's backend cannot unambiguously select a variant from the union type when validating the workflow. This is due to the unionTypeChecker
failing to differentiate between the union variants A
and B
as both are treated as simple:STRUCT
.
Would you like more detailed steps on how to address this issue or further explanation on the underlying mechanics?
Sources:
This is an AI-generated response and your feedback is appreciated! Please leave a 👍 if this is helpful and 👎 if it is not.
Mention @runllm to ask follow-up questions. See runllm.com for more!
We're in the process of revisiting the dataclass transformer and will include this in the process.
A good point raised during today's contributor meeting is that simply adding the tags to the struct message is not enough as that would break inheritance.
Describe the bug
The workflow works when executing locally with
python wf.py
but fails to register with flyteadmin:Expected behavior
As a python developer using Flyte, I would expect this workflow to work.
Additional context to reproduce
The root cause for this error is the following:
When validating the workflow in the backend, here, the so-called
unionTypeChecker
checks whether one of the union variants (hereA
orB
) can unambiguously be chosen:For our example above,
AreTypesCastable(upstreamType, x)
yieldstrue
for both union variantsA
andB
which causes theunionTypeChecker
to fail.The reason that for both
A
andB
the checkAreTypesCastable(upstreamType, x)
results intrue
is the following:Here, the so-called
trivialChecker
which is called for both union variantsA
andB
compares whether the passed inputB
matches the respective variant:Since there are no tags that solve the ambiguity and all metadata is ignored, the final string comparison for both union variants
A
andB
is always"simple:STRUCT metadata:{} annotation:{} structure:{}" == "simple:STRUCT metadata:{} annotation:{} structure:{}"
meaning that we cannot determine whether the union variantA
orB
is the correct match for the passed valueB
.Screenshots
No response
Are you sure this issue hasn't been raised already?
Have you read the Code of Conduct?