BUG: Convert uint64 in maybe_convert_objects by gfyoung · Pull Request #14916 · pandas-dev/pandas (original) (raw)
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 andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Conversation8 Commits1 Checks0 Files changed
Conversation
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
[ Show hidden characters]({{ revealButtonHref }})
Adds handling for uint64 objects during conversion. When negative numbers and uint64 are detected, we then convert the result to object.
Picks up where #4845 left off. Closes #4471.
Current coverage is 84.64% (diff: 100%)
@@ master #14916 diff @@
Files 144 144
Lines 51016 51016
Methods 0 0
Messages 0 0
Branches 0 0
- Hits 43184 43185 +1
- Misses 7832 7831 -1
Partials 0 0
Powered by Codecov. Last update 3ccb501...ed325cd
| try: |
|---|
| ints[i] = val |
| except OverflowError: |
| seen_uint = seen_uint or (val > np.iinfo(np.int64).max) |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would pull set np.iinfo(np.int64).max as a constant in the module.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
| self._check_behavior(arr, expected) |
|---|
| def test_maybe_convert_objects_uint64(): |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these tests are all in
pandas.types.test_inference
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
| - Require at least 0.23 version of cython to avoid problems with character encodings (:issue:`14699`) |
| - Bug in ``lib.maybe_convert_objects()`` in which unsigned 64-bit integers were not being properly converted (:issue:`4471`) |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is not public. I would refer to this more generically (maybe also construct a test which actually hits this in practice from a user perspective)
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough. Done.
gfyoung deleted the convert-objects-uint64 branch
gfyoung restored the convert-objects-uint64 branch
Adds handling for uint64 objects during conversion. When negative numbers and uint64 are detected, we then convert the result to object.
Picks up where pandas-devgh-4845 left off. Closes pandas-devgh-4471.
gfyoung deleted the convert-objects-uint64 branch
This was referenced
Dec 21, 2016
ShaharBental pushed a commit to ShaharBental/pandas that referenced this pull request
Adds handling for uint64 objects during conversion. When negative
numbers and uint64 are detected, we then convert the result to
object. Picks up where pandas-dev#4845 left off. Closes pandas-dev#4471.
Author: gfyoung gfyoung17@gmail.com
Closes pandas-dev#14916 from gfyoung/convert-objects-uint64 and squashes the following commits:
ed325cd [gfyoung] BUG: Convert uint64 in maybe_convert_objects
jreback pushed a commit that referenced this pull request
- Introduces and propagates
UInt64Index, an index specifically foruint. xref #14935 2) Patches bug from #14916 that makesmaybe_convert_objectsrobust against the knownnumpybug thatuint64cannot be compared toint64. This bug was caught during testing ofUInt64Index. UPDATE: Patched in #14951
Author: gfyoung gfyoung17@gmail.com
Closes #14937 from gfyoung/create-uint64-index and squashes the following commits:
8ab6fbd [gfyoung] ENH: Create and propagate UInt64Index
AnkurDedania pushed a commit to AnkurDedania/pandas that referenced this pull request
- Introduces and propagates
UInt64Index, an index specifically foruint. xref pandas-dev#14935 2) Patches bug from pandas-dev#14916 that makesmaybe_convert_objectsrobust against the knownnumpybug thatuint64cannot be compared toint64. This bug was caught during testing ofUInt64Index. UPDATE: Patched in pandas-dev#14951
Author: gfyoung gfyoung17@gmail.com
Closes pandas-dev#14937 from gfyoung/create-uint64-index and squashes the following commits:
8ab6fbd [gfyoung] ENH: Create and propagate UInt64Index