superset icon indicating copy to clipboard operation
superset copied to clipboard

Changed of Date to epoch time in Table view - Superset - 0.25.6

Open rohanagg opened this issue 8 years ago • 9 comments

Make sure these boxes are checked before submitting your issue - thank you!

  • [x] I have checked the superset logs for python stacktraces and included it here as text if any
  • [x] I have reproduced the issue with at least the latest released version of superset
  • [x] I have checked the issue tracker for the same issue and I haven't found one similar

Superset version

0.25.6

Expected results

Expected result in 0.17.6 is : image

Actual results

Actual result which I am getting in 0.25.6 is : image

Steps to reproduce

Open the slice and select the table view. In the group by select any column with date as datatype select any metric against it. Output is epoch time against the metric

rohanagg avatar Jun 12 '18 07:06 rohanagg

@rohanagg I remember that this issue had been reported multiple times by now. However, I haven't looked up whether it has been fixed meanwhile and happened to reappear, or if your report is a duplicate.

Could you do the research, please?

rumbin avatar Jun 13 '18 17:06 rumbin

I'm having the same problem with the timestamp types and Table views

This problem is reported in the issue #3027 for the "NOT GROUPED BY" colums, but in my case I'm selecting a timestamp value in the group by.

Anyway without grouping by date the problem persists.

image

However, with a Distribution - Bar Chart , the format of the date is correct

image

llozanoc avatar Jun 14 '18 16:06 llozanoc

+1

amzhang avatar Jun 27 '18 15:06 amzhang

+1

csc5k avatar Jun 29 '18 10:06 csc5k

Issue still exists in Version 26.3.. Table view shows date in epoch format.. While it is solved in case of Pivot view

Table View - image

Pivot View - image

Are we doing anything to cater such things in future versions. Our company runs on Superset but because of such issues it becomes hectic for business owner to get attached to Superset as a visualisation tool

rohanagg avatar Jul 19 '18 06:07 rohanagg

Can someone help here. As it is becoming blocker for day to day activity and we are not able to superset to latest version

rohanagg avatar Aug 20 '18 06:08 rohanagg

+1

awsiotdemo avatar Sep 17 '18 08:09 awsiotdemo

A temporary solution is casting the date to string. We create an additional dimension with this expression TO_CHAR(date, 'yyyy/mm/dd').

ngoclong19 avatar Oct 16 '18 08:10 ngoclong19

Still present in 0.29. It is caused by this commit https://github.com/apache/incubator-superset/commit/0ec9cd4ad279c24b6d65fb825a319357958297fd

Basically datetime date field gets formatted by BaseViz.json_dumps that uses json_int_dttm_ser serializer which turns date into epoch.

@mistercrunch I guess that commit fixed non grouped options, but in turn broke grouped. What happens if one would only do

    def json_dumps(self, obj, sort_keys=False):
        return json.dumps(
            obj,
            default=utils.json_iso_dttm_ser,
            sort_keys=sort_keys,
            ignore_nan=True
        )

in tableviz ?

kakoni avatar Dec 20 '18 12:12 kakoni