-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Read hdf returns unexpected values for categorical #39420
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
Merged
jreback
merged 33 commits into
pandas-dev:master
from
nofarm3:read-hdf-returns-unexpected-values-for-categorical
Jan 30, 2021
Merged
Changes from 28 commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
bb2d803
BUG: fix case of a category value which isn't exists (#39189)
nofarmish f9be625
BUG: add UT to conver_value for this use case (#39189)
nofarmish aa90441
BUG: change style with pre-commit (#39189)
nofarmish e8ca3fc
BUG: add a whatsnew record (#39189)
nofarmish b5ded49
Trigger Build
nofarmish 0cb8ad7
BUG: check for tests (#39189)
nofarmish 8284e0b
BUG: remove spaces (#39189)
nofarmish 9773aaa
BUG: remove whatsnew (#39189)
nofarmish 4281ef0
BUG: remove tests(#39189)
nofarmish 7178757
BUG: add whats new (#39189)
nofarmish ca9420e
BUG: check tests (#39189)
nofarmish f61b7c5
BUG: update tests (#39189)
nofarmish 8c3b3b6
BUG: update after precommit (#39189)
nofarmish 4e3bce2
BUG: update after precommit (#39189)
nofarmish 558a585
BUG: fix case of a category value which isn't exists (#39189)
nofarmish adfe600
BUG: add UT to conver_value for this use case (#39189)
nofarmish 63815c7
BUG: change style with pre-commit (#39189)
nofarmish 74c687a
BUG: add a whatsnew record (#39189)
nofarmish 3023fc0
BUG: check for tests (#39189)
nofarmish f917ba9
BUG: remove spaces (#39189)
nofarmish 0abe192
BUG: remove whatsnew (#39189)
nofarmish 1b959ee
BUG: remove tests(#39189)
nofarmish 4de349f
BUG: add whats new (#39189)
nofarmish d7a3ef6
BUG: check tests (#39189)
nofarmish eb8cd5a
BUG: update tests (#39189)
nofarmish 235d05e
BUG: update after precommit (#39189)
nofarmish 73541ff
BUG: update after precommit (#39189)
nofarmish 877ae9e
Merge remote-tracking branch 'origin/read-hdf-returns-unexpected-valu…
nofarmish 017e47a
BUG: change test location (#39189)
nofarmish d67ff95
BUG: remove import (#39189)
nofarmish 37eef60
BUG: remove import (#39189)
nofarmish b3565af
BUG: remove list() before sorted() (#39189)
nofarmish 5af7c04
BUG: remove list() in sorted() (#39189)
nofarmish File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
from typing import Any | ||
|
||
nofarm3 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
import numpy as np | ||
import pytest | ||
|
||
from pandas import Series | ||
from pandas.core.computation.pytables import BinOp, TermValue | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"value, expected_results", | ||
[("q", TermValue(-1, -1, "integer")), ("a", TermValue(0, 0, "integer"))], | ||
) | ||
def test__convert_value(value: Any, expected_results: TermValue): | ||
metadata = Series(np.array(["a", "b", "s"])) | ||
|
||
result = BinOp._convert_category_value(metadata, value) | ||
|
||
assert ( | ||
result.kind == expected_results.kind | ||
and result.value == expected_results.value | ||
and result.converted == expected_results.converted | ||
) |
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.
Uh oh!
There was an error while loading. Please reload this page.