-
-
Notifications
You must be signed in to change notification settings - Fork 18.6k
TST: Adding test to concat Sparse arrays #30645
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
Conversation
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.
@SdgJlbl Thanks for the PR. suggested change works for me on windows. hopefully won't break other builds
pandas/tests/reshape/test_concat.py
Outdated
# GH 23557 | ||
a = pd.Series(pd.SparseArray([0, 1, 2])) | ||
expected = pd.DataFrame(data=[[0, 0], [1, 1], [2, 2]]).astype( | ||
pd.SparseDtype("int", 0) |
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.
pd.SparseDtype("int", 0) | |
pd.SparseDtype(np.intp, 0) |
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.
Thanks for the suggestion, I've amended the PR with the change
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 had to change this to np.int64
else the tests were failing on linux 32-bit
3cf64cb
to
36e171c
Compare
pandas/tests/reshape/test_concat.py
Outdated
|
||
def test_concat_sparse(): | ||
# GH 23557 | ||
a = pd.Series(pd.SparseArray([0, 1, 2])) |
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 add
from pandas.array import SparseArrary
at the top instead of directly using SparseArray as we are doing to deprecate that import.
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 🙂
36e171c
to
93e3cc7
Compare
thanks @SdgJlbl |
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff