[ 
https://issues.apache.org/jira/browse/BEAM-11531?focusedWorklogId=535576&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-535576
 ]

ASF GitHub Bot logged work on BEAM-11531:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 13/Jan/21 17:35
            Start Date: 13/Jan/21 17:35
    Worklog Time Spent: 10m 
      Work Description: TheNeuralBit commented on a change in pull request 
#13706:
URL: https://github.com/apache/beam/pull/13706#discussion_r556706662



##########
File path: sdks/python/apache_beam/dataframe/pandas_top_level_functions.py
##########
@@ -38,8 +38,14 @@ def wrapper(target, *args, **kwargs):
 
 
 def _defer_to_pandas(name):
+  func = getattr(pd, name)
+
   def wrapper(*args, **kwargs):
-    res = getattr(pd, name)(*args, **kwargs)
+    if any(isinstance(arg, frame_base.DeferredBase)
+           for arg in args + tuple(kwargs.values())):
+      return frame_base._elementwise_function(func, name)(*args, **kwargs)

Review comment:
       I guess there's a concern that a top-level function might not operate 
element-wise on pandas args. I could make this a separate function, e.g. 
`_defer_to_pandas_elementwise` (and while I'm at it look over the other 
`_defer_to_pandas` usages and see if they should be switched).




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 535576)
    Time Spent: 5h 50m  (was: 5h 40m)

> pandas 1.2.0 breaks Python precommit
> ------------------------------------
>
>                 Key: BEAM-11531
>                 URL: https://issues.apache.org/jira/browse/BEAM-11531
>             Project: Beam
>          Issue Type: Bug
>          Components: sdk-py-core
>            Reporter: Brian Hulette
>            Assignee: Brian Hulette
>            Priority: P2
>          Time Spent: 5h 50m
>  Remaining Estimate: 0h
>
> https://ci-beam.apache.org/job/beam_PreCommit_Python_Cron/3656/
> Breakages in DataframeTransform 
> (apache_beam.dataframe.pandas_doctests_test.DoctestTest), and in interactive 
> beam (apache_beam.runners.interactive.utils_test.ParseToDataframeTest).



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to