Note, another input param in a different task defi...
# ask-the-community
f
Note, another input param in a different task defined in the same way except it’s of type pandas.DataFrame, works. Why is that?
Copy code
def estimate(test_data: Optional[pd.DataFrame] = None, ...
s
I'm guessing it's because
encoder
is of type that isn't understood by Flyte, whereas
pd.DataFrame
is a Flyte native type. But this should be supported. @Eduardo Apolinario (eapolinario), is this a bug?
n
this seems like a bug flyte should fallback on
FlytePickle
in cases where the type is not understood, unless this is a known limitation of the Union type, in which case the error message should be more informative. @Frank Shen can you share a minimally reproducible example?
e
Two things: 1. Optional parameters are not supported in tasks yet 2. This looks like a bug in our support for unions. Samhita is right, this should be supported.
f
@Niels Bantilan, The task’s input dataframe is either supplied by the caller or None if user doesn’t have a df as input. I tried both, with or without Optional.
Copy code
def estimate(test_data: Optional[pd.DataFrame] = None, ...
def estimate(test_data: pd.DataFrame = None, ...
In both cases, when None is the input, it will fail.
n
[flyte-bug]
n
@Frank Shen would you mind filling out a bug report for the error? ideally it contains a copy-pastable example the repros the error
f
151 Views