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

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

                Author: ASF GitHub Bot
            Created on: 05/Aug/20 00:27
            Start Date: 05/Aug/20 00:27
    Worklog Time Spent: 10m 
      Work Description: robertwb commented on a change in pull request #12459:
URL: https://github.com/apache/beam/pull/12459#discussion_r465402767



##########
File path: sdks/python/apache_beam/dataframe/frame_base.py
##########
@@ -226,6 +232,68 @@ def wrapper(self, *args, **kwargs):
   return wrapper
 
 
+def maybe_inplace(func):
+  @functools.wraps(func)
+  def wrapper(self, inplace=False, **kwargs):
+    result = func(self, **kwargs)
+    if inplace:
+      self._expr = result._expr
+    else:
+      return result
+
+  return wrapper
+
+
+def args_to_kwargs(base_type):
+  def wrap(func):
+    if sys.version_info < (3, ):
+      getargspec = inspect.getargspec
+    else:
+      getargspec = inspect.getfullargspec
+
+    # This is used to map all positional arguments to keyword arguments.
+    base = getattr(base_type, func.__name__)
+    while hasattr(base, '__wrapped__'):
+      base = base.__wrapped__
+    base_argspec = getargspec(base)
+    arg_names = base_argspec.args
+
+    # These are used to populate any defaults in base for arguments in func.
+    if base_argspec.defaults:
+      arg_to_default = dict(
+          zip(
+              base_argspec.args[-len(base_argspec.defaults):],
+              base_argspec.defaults))
+    else:
+      arg_to_default = {}
+
+    unwrapped_func = func
+    while hasattr(unwrapped_func, '__wrapped__'):
+      unwrapped_func = unwrapped_func.__wrapped__
+    # args that do not have defaults in func, but do have defaults in base

Review comment:
       I think I never want one without the other, but I'll see what it looks 
like to break them up. 




----------------------------------------------------------------
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: 466544)
    Time Spent: 1h 50m  (was: 1h 40m)

> Implement all pandas operations (or raise WontImplementError)
> -------------------------------------------------------------
>
>                 Key: BEAM-9547
>                 URL: https://issues.apache.org/jira/browse/BEAM-9547
>             Project: Beam
>          Issue Type: Improvement
>          Components: sdk-py-core
>            Reporter: Brian Hulette
>            Assignee: Robert Bradshaw
>            Priority: P2
>          Time Spent: 1h 50m
>  Remaining Estimate: 0h
>
> We should have an implementation for every DataFrame, Series, and GroupBy 
> method. Everything that's not actually implemented should get a default 
> implementation that raises WontImplementError
> SeeĀ https://github.com/apache/beam/pull/10757#discussion_r389132292



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

Reply via email to