Skip to content
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

Allow dates formatted as YYYYMMDD to be displayed as a datetime #338

Closed
mreid-moz opened this issue Feb 16, 2018 · 5 comments
Closed

Allow dates formatted as YYYYMMDD to be displayed as a datetime #338

mreid-moz opened this issue Feb 16, 2018 · 5 comments
Assignees
Milestone

Comments

@mreid-moz
Copy link

Issue Summary

Mozilla uses YYYYMMDD date format in a bunch of places, primarily in our representation of "submission date". When used on the x-axis of a chart, the system defaults to interpreting it as a datetime (see #228). The resulting chart almost works, but requires a change to categorical before data will be displayed properly. In contrast to #228, we could actually interpret these values as dates to make things work with the default settings, we would need to detect and parse them differently.

Steps to Reproduce

  1. Create a query with a YYYYMMDD-formatted date field (example here)
  2. Create a chart with this field on the X-axis
  3. Observe the broken date handling when YYYYMMDD strings are treated as Datetime (the default)
  4. Change the X-axis scale to "category"
  5. Observe that the X-axis looks normal.

Note the current workaround is to re-format the data as "YYYY-MM-DD", which is interpreted as expected.

@rafrombrc rafrombrc added this to the 14 milestone Feb 21, 2018
@emtwo emtwo self-assigned this Apr 9, 2018
@emtwo emtwo removed this from the 14 milestone Jun 20, 2018
@emtwo emtwo removed the in review label Jun 20, 2018
@emtwo emtwo removed their assignment Jun 20, 2018
@rafrombrc rafrombrc added this to the 16 milestone Jul 16, 2018
@rafrombrc rafrombrc modified the milestones: 16, 17 Aug 15, 2018
@rafrombrc rafrombrc modified the milestones: 17, 18 Sep 5, 2018
@rafrombrc
Copy link
Member

@mreid So we've been going around and around on this one... part of the problem is that they don't want to accept this upstream, bc it's effectively impossible to reliably distinguish btn a YYYYMMDD formatted date string and an 8 digit number string that isn't meant to represent a date. We were thinking maybe we could add a view in the db layer that would perform the tranformation from YYYYMMDD to YYYY-MM-DD before the data gets to redash. Do you think this would be possible?

@rafrombrc rafrombrc modified the milestones: 18, 19 Nov 8, 2018
@mreid-moz
Copy link
Author

Can we make it work as expected only when you explicitly pick "Datetime" Scale representation? That doesn't currently work either, and leaving the default representation as is would avoid problems with other 8-digit numeric strings (which I would expect to use some other representation, I usually use "Category" as a workaround, but could imagine Linear/Logarithmic being useful).

@rafrombrc
Copy link
Member

That might be possible... we'll look into it.

@emtwo
Copy link

emtwo commented Dec 12, 2018

Progress here: getredash#3150

@rafrombrc rafrombrc modified the milestones: 19, 20 Jan 30, 2019
@jezdez jezdez modified the milestones: 20, 21 May 9, 2019
@emtwo
Copy link

emtwo commented Jun 5, 2019

Confirmed that this is now fixed in stmo: https://sql.telemetry.mozilla.org/queries/50014/source#135495

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants