Avoid IEEE754 converting fraction of seconds#487
Merged
methane merged 1 commit intoPyMySQL:masterfrom Jul 19, 2016
Merged
Conversation
b94c23e to
c438e4f
Compare
c438e4f to
4229e39
Compare
Member
|
Thanks. But I feel parsing code is large enough to use regular expression.
|
Due to the limitations of IEEE754, we may lost precision when
converting string back to datetime objects, for example:
`float('0.511581') * 1e6`, gives us `0.511580`, which is unexpected.
In order to address that issue, use of `float` is avoided
4229e39 to
1df94d3
Compare
Contributor
Author
Yep, I rewrited both timedelta and time converters as well. |
Member
|
Thank you. |
openstack-gerrit
pushed a commit
to openstack/openstack
that referenced
this pull request
Nov 15, 2016
Project: openstack/requirements de1b936cec39a73c205041b50ebebbaaefb56a17 Bump PyMySQL version to 0.7.6 Current min version has a microsecond rounding bug that makes it impossible to do conditional updates (compare and swap) since the datetime read by PyMySQL and therefore by SQLAlchemy does not match the one in the DB. This is affecting operations in Cinder now that we have a new cleanup mechanism. PyMySQL PR #487: PyMySQL/PyMySQL#487 Change-Id: I44ebfd593c78412bb6ce9c9ea3104c5c7c8f0af5 Closes-Bug: #1641312
openstack-gerrit
pushed a commit
to openstack/requirements
that referenced
this pull request
Nov 15, 2016
Current min version has a microsecond rounding bug that makes it impossible to do conditional updates (compare and swap) since the datetime read by PyMySQL and therefore by SQLAlchemy does not match the one in the DB. This is affecting operations in Cinder now that we have a new cleanup mechanism. PyMySQL PR #487: PyMySQL/PyMySQL#487 Change-Id: I44ebfd593c78412bb6ce9c9ea3104c5c7c8f0af5 Closes-Bug: #1641312
openstack-gerrit
pushed a commit
to openstack/openstack
that referenced
this pull request
Nov 15, 2016
Project: openstack/requirements de1b936cec39a73c205041b50ebebbaaefb56a17 Bump PyMySQL version to 0.7.6 Current min version has a microsecond rounding bug that makes it impossible to do conditional updates (compare and swap) since the datetime read by PyMySQL and therefore by SQLAlchemy does not match the one in the DB. This is affecting operations in Cinder now that we have a new cleanup mechanism. PyMySQL PR #487: PyMySQL/PyMySQL#487 Change-Id: I44ebfd593c78412bb6ce9c9ea3104c5c7c8f0af5 Closes-Bug: #1641312
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Due to the limitations of IEEE754, we may lost precision when
converting string back to datetime objects, for example:
float('0.511581') * 1e6, gives us0.511580, which is unexpected.In order to address that issue, use of
floatis avoided.