-
Notifications
You must be signed in to change notification settings - Fork 13.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Global async query - Unserializable object {} of type <class 'datetime.time'> #15905
Comments
This bug is preventing us from rolling out this feature. |
I can confirm that
My setup is a standard Superset started using docker-compose, connected to a mssql database containing a table with a |
There are various places in the code where such method is used as default when dumping the JSON (look for superset/superset/charts/api.py Lines 518 to 523 in 1669947
superset/superset/utils/core.py Lines 618 to 619 in 0f16177
...and others. Here is the problematic function: superset/superset/utils/core.py Lines 604 to 615 in 0f16177
It was meant to handle date, datetime, but not time. It actually uses a generic function before trying to dealing with date and datetime, such superset/superset/utils/core.py Lines 550 to 573 in 0f16177
It would be enough to add a specific case:
The function superset/superset/utils/core.py Lines 587 to 588 in 27a40d2
In case of As a time without a date cannot be converted to an integer with respect to EPOCH, we should decide if it would make more sense to convert it to seconds (from the beginning of the midnight) or to a string.
|
Impossible to render a chart, say a TableView, presenting a Time column when the global async query feature is enabled.
Expected results
We expected the chart to be rendered with the data on display.
Actual results
Error message on display.
Screenshots
How to reproduce the bug
From the logs we have the following message
{"asctime": "2021-07-27 13:46:01,004", "name": "superset.views.base", "levelname": "WARNING", "process": 18, "message": "Unserializable object 10:30:00 of type <class 'datetime.time'>"}
Environment
(please complete the following information):
1.2
3.7.9
Unknown
Checklist
Make sure to follow these steps before submitting your issue - thank you!
Additional context
I looked up in the code base to see where the message was coming from. I found out two different methods aiming to perform the same job which is to json serialize dates
It seems to me that the second might be at fault here.
The text was updated successfully, but these errors were encountered: