[
https://issues.apache.org/jira/browse/BEAM-12016?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17329325#comment-17329325
]
Rogelio Miguel Hernandez Sandoval commented on BEAM-12016:
----------------------------------------------------------
Hi [~bhulette], thanks for the pointers, it's helpful info.
First I added removed the lines from _pandas_doctests_test.py_ and added some
tests to _frames_test.py_ Then added the _add_prefix_ and _add_suffix_ function
to the _DeferredDataFrame_:
{code:java}
add_prefix = frame_base._elementwise_method('add_prefix')
add_suffix = frame_base._elementwise_method('add_suffix'){code}
Also added the same functions to the _DeferredSeries_:
{code:java}
add_suffix = frame_base._proxy_method('add_suffix',
requires_partition_by=partitionings.Arbitrary(),
preserves_partition_by=partitionings.Singleton())
add_prefix = frame_base._proxy_method('add_prefix',
requires_partition_by=partitionings.Arbitrary(),
preserves_partition_by=partitionings.Singleton()){code}
Do you think there is something more to it that I'm missing for the
_DeferredSeries_? Is there a way to test that the _DeferredSeries_ is
preserving the partition as expected?
> Implement add_suffix, add_prefix for DataFrame and Series
> ---------------------------------------------------------
>
> Key: BEAM-12016
> URL: https://issues.apache.org/jira/browse/BEAM-12016
> Project: Beam
> Issue Type: Improvement
> Components: sdk-py-core
> Reporter: Brian Hulette
> Assignee: Rogelio Miguel Hernandez Sandoval
> Priority: P3
> Labels: dataframe-api
>
> Add an implementation for
> [add_suffix|https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.add_suffix.html]
> and add_prefix that works for DeferredDataFrame and DeferredSeries, and is
> fully unit tested with some combination of pandas_doctests_test.py and
> frames_test.py.
> https://github.com/apache/beam/pull/14274 is an example of a typical PR that
> adds new operations.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)