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

Chandrashekhar Kotekar

08/08/2023, 6:25 AM
Hi, we have a Flyte task which is supposed to have
datetime.date
as a parameter. Does Flyte support data types like
datetime.date
/
datetime.datetime
?
c

Chandrashekhar Kotekar

08/08/2023, 6:58 AM
Thanks @Kevin Su for the help. This page mentions
datetime.datetime
but
datime.date
is mentioned here. Hence the question
k

Kevin Su

08/08/2023, 7:00 AM
ohh, sorry, you’re looking for
datatime.date
. we don’t support it yet. it’s a known issue. https://github.com/flyteorg/flyte/issues/3026
c

Chandrashekhar Kotekar

08/08/2023, 7:03 AM
ah ok. Thank you. We will not use
datetime.date
then
k

Ketan (kumare3)

08/08/2023, 2:34 PM
We can add this transformer, should be trivial- @Chandrashekhar Kotekar contribution?
c

Chandrashekhar Kotekar

08/08/2023, 3:02 PM
I can work on it on weekends but need some help in getting started.
k

Ketan (kumare3)

08/08/2023, 3:02 PM
Let me share an example
You can add it here
c

Chandrashekhar Kotekar

08/08/2023, 3:28 PM
Thanks for the help but I need to start from "what is transformer" in Flyte. 😄
s

Samhita Alla

08/09/2023, 6:41 AM
@Yi Chiu is also interested in contributing. I assigned this issue to him yesterday.
y

Yi Chiu

08/09/2023, 7:50 AM
Yes I am working on it!
l

Len Strnad

11/01/2023, 8:40 PM
Howdy, I am encountering a
Object of type date is not JSON serializable
and we are on 1.9.0, which is the release that introduced support for
datetime.date
. However, I use
datetime.date
in a dataclass as follows:
Copy code
@dataclass_json
@dataclass
class MyOutputClass:
    start_date: datetime.date
    end_date: datetime.date
Should I expect this to work?
s

Samhita Alla

11/02/2023, 4:21 AM
@Len Strnad, can you use mashumaro? You can find an example here.
datetime.date
type is present in the mashumaro's supported data types: https://github.com/Fatal1ty/mashumaro#supported-data-types.
l

Len Strnad

11/02/2023, 12:29 PM
Awesome, we will look into that. We use conda and might have to wait until 1.10 is on conda-forge first. I am excited for all the 1.10 features!