Join us on July 16th as we explore real-world Reinforcement Learning Learn more

Can't write with Google Sheets Plugin - JSON serializsation with datetime not possible

Level 1
Can't write with Google Sheets Plugin - JSON serializsation with datetime not possible

Hi folks,

I've successfully set up the Google Sheets Plugin and it works smoothly, with one exception: 
I can't write data with date format to any google sheet. 

The error notification says "Job failed: Error in Python process: At line 69: <class 'TypeError'>: Object of type 'datetime' is not JSON serializable" 

It doesn't matter which value interpretation I choose (RAW or USER-ENTERED), it fails with both. 

Does anybody know how to solve this?
Would appreciate any hints.

Thanks,

cuezumo01

0 Kudos
2 Replies
Dataiker
Dataiker

Hi Richard,

Thank you for reporting the issue.
I can confirm this is a bug. I documented it on the github repo. We will address it in a later release of the plugin.

Meanwhile, I can suggest two workarounds:

1. You can convert the type of the column to "String", for example using the prepare recipe:

Xnip2020-05-26_15-17-58.jpg

2. Only the append recipe seems concerned. So if it fits your use case, you can also place a Google Sheets dataset as the ouput of a recipe and the spreadsheet will be cleared and receive a full copy of the dataset.

Cheers,

Jeremy, Product Manager at Dataiku
Level 1
Author

Hi Jeremy,

thanks for your reply. 

Yeah, I also thought of this simply work-around, it should serve most of the purposes.

Are you sure about the write recipe? For me both the append and write recipes don't work with the date format. The same error pops up.


best, cuezumo01

0 Kudos
Labels (3)