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.
BUG: is_dtype_equal(dtype, "string[pyarrow]") raises if pyarrow not installed #44327
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
BUG: is_dtype_equal(dtype, "string[pyarrow]") raises if pyarrow not installed #44327
Changes from 6 commits
542032c
76ab6fa
c82d836
c35e162
cff657a
dce9db6
5abfa2e
fb0bd2a
f7b8888
2de4936
66327e7
9566360
0f35541
7ea6b15
9b0dc6c
b0a75fc
75a4b26
f5bedc6
9c68f5c
c550a00
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this change still needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is needed because dtypes such as
int64
float64
and other dtypes actually arenp.dtype
, so if I am not adding this check, the test is failing.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not needed if we catch ImportError more generally, I think; I pushed some small commits to verify this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can probably catch the ImportError here (so it always returns False if the above raises an ImportError)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another note: this test is added to
TestCategoricalDtype
, so categorical specific tests. I think we should move it to a more generic location. For example intests/dtypes/test_common.py
there is atest_dtype_equal
that tests the basic functionality ofis_dtype_equal
. Maybe add the new test there (or in the arrow string dtype specific tests, @jbrockmendel any preference?)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Request you to inform me where do I exactly put the test, in which file and which function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can put it in
tests/dtypes/test_common.py
, just after the existingtest_dtype_equal
test.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you flesh this out a tiny bit e.g. 'dont raise if pyarrow is not installed'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
umm we don't do this, rather use the decorator to skip the test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done