https://flyte.org logo
#ask-the-community
Title
# ask-the-community
f

Frank Shen

02/04/2023, 12:53 AM
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

Samhita Alla

02/06/2023, 5:13 AM
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

Niels Bantilan

02/06/2023, 3:12 PM
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

Eduardo Apolinario (eapolinario)

02/06/2023, 3:17 PM
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

Frank Shen

02/06/2023, 8:02 PM
@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

Niels Bantilan

02/06/2023, 8:10 PM
[flyte-bug]
n

Niels Bantilan

02/06/2023, 8:11 PM
@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

Frank Shen

02/06/2023, 9:47 PM