You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2020/08/13 19:51:36 UTC

[GitHub] [beam] ibzib commented on a change in pull request #12534: [BEAM-9547] Implement some methods for deferred Series.

ibzib commented on a change in pull request #12534:
URL: https://github.com/apache/beam/pull/12534#discussion_r470205975



##########
File path: sdks/python/apache_beam/dataframe/frames.py
##########
@@ -29,9 +29,46 @@ def __array__(self, dtype=None):
     raise frame_base.WontImplementError(
         'Conversion to a non-deferred a numpy array.')
 
+  astype = frame_base._elementwise_method('astype')
+
+  between = frame_base._elementwise_method('between')
+
+  @frame_base.args_to_kwargs(pd.Series)
+  @frame_base.populate_defaults(pd.Series)
+  @frame_base.maybe_inplace
+  def dropna(self, **kwargs):
+    return frame_base.DeferredFrame.wrap(
+        expressions.ComputedExpression(
+            'dropna',
+            lambda df: df.dropna(**kwargs), [self._expr],
+            preserves_partition_by=partitionings.Singleton(),
+            requires_partition_by=partitionings.Nothing()))

Review comment:
       Only tangentially related to this PR, but I realized the docstring for `ComputedExpression` is slightly incorrect: https://github.com/apache/beam/blob/a098130ae4a7d108ccacc346405ec9e03b94052e/sdks/python/apache_beam/dataframe/expressions.py#L202

##########
File path: sdks/python/apache_beam/dataframe/pandas_doctests_test.py
##########
@@ -156,19 +157,14 @@ def test_series_tests(self):
             'pandas.core.series.Series.repeat': ['*'],
             'pandas.core.series.Series.replace': ['*'],
             'pandas.core.series.Series.reset_index': ['*'],
-            'pandas.core.series.Series.round': ['*'],
-            'pandas.core.series.Series.searchsorted': ['*'],
-            'pandas.core.series.Series.shift': ['*'],
+            'pandas.core.series.Series.searchsorted': ['*'],  # doctest issue

Review comment:
       What is "doctest issue" referring to? Is it worth filing a JIRA?




----------------------------------------------------------------
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:
users@infra.apache.org