TheNeuralBit commented on a change in pull request #13706:
URL: https://github.com/apache/beam/pull/13706#discussion_r556728582
##########
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:
Done. I took a look at the existing `_defer_to_pandas` usages and none
of them accept pandas objects. I did find `to_numeric`, which can use this.
I also added a commit to run to_numeric and to_datetime doctests.
----------------------------------------------------------------
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]