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

Add timestamp precision support in Parser #171

Merged
merged 3 commits into from
Mar 16, 2019

Conversation

wamsiv
Copy link
Contributor

@wamsiv wamsiv commented Feb 22, 2019

fixes #170

@wamsiv wamsiv changed the title [WIP] - Add timestamp precision support in Parser Add timestamp precision support in Parser Mar 12, 2019
@wamsiv
Copy link
Contributor Author

wamsiv commented Mar 12, 2019

Here is a working example for the parser support: https://gist.github.com/wamsiv/49e17917742c2e8d581806f98e591987

Copy link
Contributor

@andrewseidl andrewseidl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should make sure we note somewhere that nanosecond support is still in progress.

pymapd/_utils.py Outdated
return base + datetime.timedelta(seconds=epoch)
elif precision == 3:
modulus = epoch % 1000
seconds = epoch / 1000
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could use divmod() here to get both at the same time, though would have to see if the numbers we're working with are large enough for that to be faster than the current method.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

divmod() is working well with large numbers, I have used it in code. Thanks!

@wamsiv
Copy link
Contributor Author

wamsiv commented Mar 15, 2019

Added a note in docs regarding WIP timestamp nanosecond support in pymapd.

@wamsiv wamsiv merged commit e0c1956 into heavyai:master Mar 16, 2019
@wamsiv wamsiv deleted the wam/ts_precisions branch March 16, 2019 03:38
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

Successfully merging this pull request may close these issues.

Add missing timestamp precision(ms,us,ns) support in parsers.
2 participants