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

Non-standard SQL datetime format? #397

Closed
joshwalters opened this issue Apr 25, 2016 · 5 comments
Closed

Non-standard SQL datetime format? #397

joshwalters opened this issue Apr 25, 2016 · 5 comments

Comments

@joshwalters
Copy link
Contributor

I am looking at this line here: https://github.com/airbnb/caravel/blob/master/caravel/models.py#L588

tf = '%Y-%m-%d %H:%M:%S.%f'

This is used for parsing the datetime column when doing SQLAlchemy queries.

Is there a reason why this format is used instead of ISO 8601?

Something like:

tf = '%Y-%m-%dT%H:%M:%SZ'
@mistercrunch
Copy link
Member

I think it has to do with how different databases autocast and/or how people store dates as string.

I've been spending some time trying to figure out how to have sqlalchemy do the proper casting but haven't figured it out yet.

We may need for is_dttm columns to allow to define how the time constants should be casted when comparing to them...

@mistercrunch
Copy link
Member

This should help #446, please test and report whether it fixes your issues.

@joshwalters
Copy link
Contributor Author

This did not fix my issues, because my dttm column is in a custom format ("%Y%m%d%H").

We are thinking of adding an option to the dttm columns to allow users to provide the datetime format regex string that they want to use, if the default does not work the way they need. Would that sound reasonable? It would then be used in the query generation, and in the visualization.

@xrmx
Copy link
Contributor

xrmx commented Jul 22, 2016

@joshwalters has this been fixed by #652 ?

@joshwalters
Copy link
Contributor Author

@xrmx Yes it has, closing ticket now.

zhaoyongjie pushed a commit to zhaoyongjie/incubator-superset that referenced this issue Nov 17, 2021
zhaoyongjie pushed a commit to zhaoyongjie/incubator-superset that referenced this issue Nov 17, 2021
Bumps [@types/lodash](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/lodash) from 4.14.149 to 4.14.150.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/lodash)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
zhaoyongjie pushed a commit to zhaoyongjie/incubator-superset that referenced this issue Nov 24, 2021
zhaoyongjie pushed a commit to zhaoyongjie/incubator-superset that referenced this issue Nov 24, 2021
Bumps [@types/lodash](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/lodash) from 4.14.149 to 4.14.150.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/lodash)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
zhaoyongjie pushed a commit to zhaoyongjie/incubator-superset that referenced this issue Nov 25, 2021
zhaoyongjie pushed a commit to zhaoyongjie/incubator-superset that referenced this issue Nov 25, 2021
Bumps [@types/lodash](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/lodash) from 4.14.149 to 4.14.150.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/lodash)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
zhaoyongjie pushed a commit to zhaoyongjie/incubator-superset that referenced this issue Nov 26, 2021
zhaoyongjie pushed a commit to zhaoyongjie/incubator-superset that referenced this issue Nov 26, 2021
Bumps [@types/lodash](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/lodash) from 4.14.149 to 4.14.150.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/lodash)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
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

3 participants