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

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

                Author: ASF GitHub Bot
            Created on: 17/Sep/20 18:13
            Start Date: 17/Sep/20 18:13
    Worklog Time Spent: 10m 
      Work Description: robertwb commented on a change in pull request #12858:
URL: https://github.com/apache/beam/pull/12858#discussion_r490028277



##########
File path: sdks/python/apache_beam/dataframe/frames.py
##########
@@ -763,8 +788,9 @@ def sort_values(self, axis, **kwargs):
   transform = frame_base._elementwise_method(
       'transform', restrictions={'axis': 0})
 
-  def transpose(self, *args, **kwargs):
-    raise frame_base.WontImplementError('non-deferred column values')
+  transpose = frame_base.wont_implement_method('non-deferred column values')
+  pivot = frame_base.wont_implement_method('non-deferred column values')

Review comment:
       I've been thinking we could do something here if the value type that 
goes into the columns are categorical. 

##########
File path: sdks/python/apache_beam/dataframe/frames.py
##########
@@ -279,13 +267,23 @@ def __getattr__(self, name):
 
   def __getitem__(self, key):
     # TODO: Replicate pd.DataFrame.__getitem__ logic
-    if (isinstance(key, list) and
-        all(key_column in self._expr.proxy().columns
-            for key_column in key)) or key in self._expr.proxy().columns:
+    if isinstance(key, frame_base.DeferredBase):
+      # Fail early if key is a DeferredBase as it interacts surprisingly with
+      # key in self._expr.proxy().columns
+      raise NotImplementedError(
+          "Indexing with a deferred frame is not yet supported. Consider "
+          "using df.loc[...]")
+
+    if (isinstance(key, list) and key_column in self._expr.proxy().columns

Review comment:
       The all was dropped here, which makes the statement always true.




----------------------------------------------------------------
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: 485899)
    Time Spent: 11h 40m  (was: 11.5h)

> 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: 11h 40m
>  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