-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: Fix #25959 - Don't call .array in DatetimeLikeArrayMixin's map #25964
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
Codecov Report
@@ Coverage Diff @@
## master #25964 +/- ##
==========================================
+ Coverage 91.69% 91.72% +0.03%
==========================================
Files 174 174
Lines 50749 50754 +5
==========================================
+ Hits 46534 46556 +22
+ Misses 4215 4198 -17
Continue to review full report at Codecov.
|
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.
Some comments and also needs a whatsnew entry in 0.25
Added! |
Hello @ThomasKluiters! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found: There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻 Comment last updated at 2019-05-18 19:09:18 UTC |
I don't know why the tests are failing - locally all seems fine Edit - updating from master seemed to have resolved the issue. |
@jreback @mroeschke I resolved my issues, could you have a look please? |
Can you investigate what happens if we don’t cal tolist? What tests fail?
… On Apr 9, 2019, at 06:00, Thomas Kluiters ***@***.***> wrote:
@ThomasKluiters commented on this pull request.
In pandas/core/series.py:
> @@ -3688,7 +3688,11 @@ def f(x):
if len(mapped) and isinstance(mapped[0], Series):
from pandas.core.frame import DataFrame
- return DataFrame(mapped.tolist(), index=self.index)
+ # GH 25959 we don't need to call tolist
+ # if we've been given an ExtensionArray
+ if not isinstance(mapped, ExtensionArray):
It was initially there - I do not know, I resolved your problem though.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Removing the tolist will make this test fail: self = <pandas.tests.series.test_apply.TestSeriesAggregate object at 0x12ebc31d0>
E AssertionError: DataFrame are different |
So are we using tolist to get an array from a series? Maybe call pd.array on the object instead of tolist? |
47a19af
to
2803f11
Compare
2803f11
to
223f59f
Compare
pd.array seems to be the best solution, it removes the need to check for an EA. Any suggestions on how I can fix the conflict best in the whatsnew? |
Actually I think we have a better function than pd.array. It’s something like extract_array in internals.
… On Apr 10, 2019, at 02:42, Thomas Kluiters ***@***.***> wrote:
So are we using tolist to get an array from a series? Maybe call pd.array on the object instead of tolist?
pd.array seems to be the best solution, it removes the need to check for an EA. Any suggestions on how I can fix the conflict best in the whatsnew?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
|
extract_array does not work I'm afraid, it will fail the same test |
can you merge master |
Done! |
can you merge master and ping on green. |
you have an isort error; can you merge master and fix up. ping on green. |
Sorry, but I can't seem to find what's wrong with the build - it seems to be failing at /doc/source/reference/frame.rst - "DataFrame" has no attribute "to_panel". |
Should be fixed after #26308 |
can you merge master |
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.
small comments, ping on green.
linting error:
|
ping on green. |
@jreblack ping |
thanks @ThomasKluiters |
git diff upstream/master -u -- "*.py" | flake8 --diff
In Series.apply we call .array on returning the result of DatetimeLikeArrayMixin map, which causes an error.