Hi, we have a Flyte task which is supposed to have...
# ask-the-community
c
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
Thanks @Kevin Su for the help. This page mentions
datetime.datetime
but
datime.date
is mentioned here. Hence the question
k
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
ah ok. Thank you. We will not use
datetime.date
then
k
We can add this transformer, should be trivial- @Chandrashekhar Kotekar contribution?
c
I can work on it on weekends but need some help in getting started.
k
Let me share an example
You can add it here
c
Thanks for the help but I need to start from "what is transformer" in Flyte. 😄
s
@Yi Chiu is also interested in contributing. I assigned this issue to him yesterday.
y
Yes I am working on it!
l
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
@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
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!