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 2021/11/09 16:58:22 UTC

[GitHub] [beam] AlikRodriguez commented on a change in pull request #15833: [WIP] BEAM-12561 method truncate on series and dataframe

AlikRodriguez commented on a change in pull request #15833:
URL: https://github.com/apache/beam/pull/15833#discussion_r745821826



##########
File path: sdks/python/apache_beam/dataframe/frames.py
##########
@@ -922,6 +922,19 @@ def mask(self, cond, **kwargs):
     """mask is not parallelizable when ``errors="ignore"`` is specified."""
     return self.where(~cond, **kwargs)
 
+  @frame_base.with_docs_from(pd.DataFrame)
+  @frame_base.args_to_kwargs(pd.DataFrame)
+  @frame_base.populate_defaults(pd.DataFrame)
+  def truncate(self, before, after, axis):
+    return frame_base.DeferredFrame.wrap(
+        expressions.ComputedExpression(
+            'truncate',
+            lambda df: df.truncate(before=before, after=after, axis=axis),
+            [self._expr],
+            requires_partition_by=partitionings.Arbitrary(),
+            preserves_partition_by=partitionings.Arbitrary()
+            if axis in (1, 'columns') else partitionings.Singleton()))

Review comment:
       Oh sorry I didn't have issues, I was testing and forgot to change it.  




-- 
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.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org