-
-
Notifications
You must be signed in to change notification settings - Fork 18.6k
TST: fix import in test_hash_pandas_object extension test #53474
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
TST: fix import in test_hash_pandas_object extension test #53474
Conversation
@@ -21,10 +21,10 @@ class BaseMethodsTests(BaseExtensionTests): | |||
def test_hash_pandas_object(self, data): | |||
# _hash_pandas_object should return a uint64 ndarray of the same length | |||
# as the data | |||
from pandas.core.util.hashing import _default_hash_key |
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.
IIUC the issue is that hashing hasnt been imported into core.util. Should we try to address that directly?
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 don't really care either way; it's not a public import, and internally we always import it correctly instead of using it from a top-level pandas object.
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 don't really care either way
Agreed. I'm fine with this.
Owee, I'm MrMeeseeks, Look at me. There seem to be a conflict, please backport manually. Here are approximate instructions:
And apply the correct labels and milestones. Congratulations — you did some good work! Hopefully your backport PR will be tested by the continuous integration and merged soon! Remember to remove the If these instructions are inaccurate, feel free to suggest an improvement. |
Calling
pd.core.util.hashing._default_hash_key
directly after import of pandas fails with an ImportError, but depending on whether you already did some other operations, the import will succeed. That gives intermittent failures in the test suite (I don't know if it happens in pandas itself, but at least we are seeing it in the geopandas test suite: geopandas/geopandas#2911)