[
https://issues.apache.org/jira/browse/BEAM-9547?focusedWorklogId=488891&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-488891
]
ASF GitHub Bot logged work on BEAM-9547:
----------------------------------------
Author: ASF GitHub Bot
Created on: 23/Sep/20 04:17
Start Date: 23/Sep/20 04:17
Worklog Time Spent: 10m
Work Description: TheNeuralBit commented on a change in pull request
#12858:
URL: https://github.com/apache/beam/pull/12858#discussion_r493052627
##########
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:
Good catch, fixed
##########
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:
Done
----------------------------------------------------------------
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: 488891)
Time Spent: 14h 40m (was: 14.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: 14h 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)