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

Front-end doesn't guess data types #3731

Closed
susodapop opened this issue Apr 23, 2019 · 2 comments
Closed

Front-end doesn't guess data types #3731

susodapop opened this issue Apr 23, 2019 · 2 comments

Comments

@susodapop
Copy link
Contributor

Issue Summary

After reading through #3553 I expected the front-end to accurately parse an ISO8601 date from a text-field. But it doesn't. If I select a bunch of ISO8601 dates as text fields from the database, Redash should let me reformat them using format codes.

Steps to Reproduce

I created an example on the redash demo instance here. You can reproduce on your own in Postgres with a query like this:

SELECT CAST(any_date_field as VARCHAR(50)) FROM table_of_your_choice

If you try to edit the table visualization to render a date field as MMM-YYYY or something similar it will not work.

Technical details:

  • Redash Version: 7.0.0
  • Browser/OS: Safari, Chrome, Firefox
  • How did you install Redash: SaaS
@kravets-levko
Copy link
Collaborator

@susodapop Can you please provide data sample? Redash does guess date/time types, but it expects two formats (d is for any digit): string that starts with pattern dddd-dd-ddT - for date/time, and string that matches pattern dddd-dd-dd - for date. CAST will convert date/time filed to a bit different format: 2019-01-25 15:40:47+00 - notice that T is missing there. If you'll change your SQL to something like

SELECT REPLACE(CAST(any_date_field AS VARCHAR(50)), ' ', 'T')
FROM table_of_your_choice

it will work fine.

@susodapop
Copy link
Contributor Author

Thanks @kravets-levko! Closing this issue as resolved.

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

No branches or pull requests

2 participants