Submit your use case or success story to the 2023 edition of the Dataiku Frontrunner Awards ENTER YOUR SUBMISSION

How to block dataiku dataset from formatting date values?

Solved!
mi6crazyheart
Level 2
How to block dataiku dataset from formatting date values?

I've some date values which get automatically format when I pass that through dataiku dataset. I don't want to format those dates. I just want them in the same format in which they are before formatting.

Before formatting

before-format.png

 

After formatting

after-format.png


Operating system used: windows

0 Kudos
1 Solution
AlexT
Dataiker

Hi,

Is this an SQL dataset?

DSS would typically change the format automatically unless you parse the data in the prepare recipe.

https://doc.dataiku.com/dss/latest/preparation/dates.html

If you want to keep the original format simply change the type to "string" in your dataset schema instead of date type and DSS will keep it as a string or remove the Read SQL "date" as DSS option in the input dataset settings.

Screenshot 2022-05-20 at 13.13.34.png

 

If you want to convert it from the parsed format back to MM/dd/yyyy you can do so with prepare processor( Format date with custom format) and se the type to string. 

Screenshot 2022-05-20 at 13.16.30.png


Hope that helps!

 

 

 

View solution in original post

2 Replies
AlexT
Dataiker

Hi,

Is this an SQL dataset?

DSS would typically change the format automatically unless you parse the data in the prepare recipe.

https://doc.dataiku.com/dss/latest/preparation/dates.html

If you want to keep the original format simply change the type to "string" in your dataset schema instead of date type and DSS will keep it as a string or remove the Read SQL "date" as DSS option in the input dataset settings.

Screenshot 2022-05-20 at 13.13.34.png

 

If you want to convert it from the parsed format back to MM/dd/yyyy you can do so with prepare processor( Format date with custom format) and se the type to string. 

Screenshot 2022-05-20 at 13.16.30.png


Hope that helps!

 

 

 

mi6crazyheart
Level 2
Author

Hi AlexT,  Thanks for your reply. I've fixed this by mentioning the datatype of dataframe's columns names. 

Ex: bucketOutput_df = bucketOutput_df.astype({"bucketStatusDate": str, "bucketSpudDate": str})

By the way, I was reading the data from an EXCEL sheet.

 

 

I was reading from an EXCEL sheet & trying to put that to Dataiku dataset. 

0 Kudos