-
Notifications
You must be signed in to change notification settings - Fork 653
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
FIX-#1674: Series.apply and DataFrame.apply #1718
Conversation
e796d25
to
01fde66
Compare
Codecov Report
@@ Coverage Diff @@
## master #1718 +/- ##
==========================================
+ Coverage 81.39% 81.46% +0.06%
==========================================
Files 79 79
Lines 9165 9172 +7
==========================================
+ Hits 7460 7472 +12
+ Misses 1705 1700 -5
Continue to review full report at Codecov.
|
@amyskov plz rebase from master |
2eed5e4
to
982e2d3
Compare
modin/pandas/series.py
Outdated
@@ -516,7 +523,10 @@ def f(x): | |||
return f(self) | |||
query_compiler = self.map(f)._query_compiler | |||
if return_type not in ["DataFrame", "Series"]: | |||
return query_compiler.to_pandas().squeeze() | |||
try: | |||
return query_compiler.to_pandas().squeeze() |
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.
When does this throw an Exception
?
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 can throws an Exception
in the case if result of applying of function is not a query_compiler
, but scalar (such result can occurs for sum
or count
functions, for example). This expression was reworked to explicitly check result type and corresponding comment is added.
59e3a5d
to
c03ae36
Compare
3b058c3
to
dc68a11
Compare
Signed-off-by: Alexander Myskov <alexander.myskov@intel.com>
Signed-off-by: Alexander Myskov <alexander.myskov@intel.com>
Signed-off-by: Alexander Myskov <alexander.myskov@intel.com>
Signed-off-by: Alexander Myskov <alexander.myskov@intel.com>
Signed-off-by: Alexander Myskov <alexander.myskov@intel.com>
Signed-off-by: Alexander Myskov <alexander.myskov@intel.com>
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.
LGTM, thanks @amyskov
…ct#1718) Signed-off-by: Alexander Myskov <alexander.myskov@intel.com>
What do these changes do?
Series.apply and DataFrame.apply functions are reworked in order to match Pandas behavior.
flake8 modin
black --check modin
git commit -s
Series.apply("array")
doesn't work if Series contains one element #1674