This is an automated email from the ASF dual-hosted git repository. bhulette pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/beam.git
The following commit(s) were added to refs/heads/master by this push: new 4e22ff3 [BEAM-9547] More WontImplement operations (#14910) 4e22ff3 is described below commit 4e22ff3d933c1ba085ab3a7597b7fc5b1079ccb4 Author: Brian Hulette <bhule...@google.com> AuthorDate: Mon Jun 7 17:48:11 2021 -0700 [BEAM-9547] More WontImplement operations (#14910) * Simple WontImplements * wontimplement(event-time-semantics) * Series.sparse too * Update pandas_doctests_test.py for resample, rolling --- sdks/python/apache_beam/dataframe/frame_base.py | 6 ++++++ sdks/python/apache_beam/dataframe/frames.py | 18 ++++++++++++++++++ .../apache_beam/dataframe/pandas_doctests_test.py | 6 +++--- 3 files changed, 27 insertions(+), 3 deletions(-) diff --git a/sdks/python/apache_beam/dataframe/frame_base.py b/sdks/python/apache_beam/dataframe/frame_base.py index 33b33a8..bb649a3 100644 --- a/sdks/python/apache_beam/dataframe/frame_base.py +++ b/sdks/python/apache_beam/dataframe/frame_base.py @@ -591,6 +591,12 @@ _WONT_IMPLEMENT_REASONS = { 'explanation': "because it is a plotting tool", 'url': 'https://s.apache.org/dataframe-plotting-tools', }, + 'event-time-semantics': { + 'explanation': ( + "because implementing it would require integrating with Beam " + "event-time semantics"), + 'url': 'https://s.apache.org/dataframe-event-time-semantics', + }, 'deprecated': { 'explanation': "because it is deprecated in pandas", }, diff --git a/sdks/python/apache_beam/dataframe/frames.py b/sdks/python/apache_beam/dataframe/frames.py index 548f7a4..3cf0834 100644 --- a/sdks/python/apache_beam/dataframe/frames.py +++ b/sdks/python/apache_beam/dataframe/frames.py @@ -704,6 +704,14 @@ class DeferredDataFrameOrSeries(frame_base.DeferredFrame): requires_partition_by=partitionings.Arbitrary(), preserves_partition_by=partitionings.Singleton()) + resample = frame_base.wont_implement_method( + pd.DataFrame, 'resample', reason='event-time-semantics') + + rolling = frame_base.wont_implement_method( + pd.DataFrame, 'rolling', reason='event-time-semantics') + + sparse = property(frame_base.not_implemented_method('sparse', 'BEAM-12425')) + @populate_not_implemented(pd.Series) @frame_base.DeferredFrame._register_for(pd.Series) @@ -2736,6 +2744,9 @@ class DeferredDataFrame(DeferredDataFrameOrSeries): values = property(frame_base.wont_implement_method( pd.DataFrame, 'values', reason="non-deferred-result")) + style = property(frame_base.wont_implement_method( + pd.DataFrame, 'style', reason="non-deferred-result")) + @frame_base.args_to_kwargs(pd.DataFrame) @frame_base.populate_defaults(pd.DataFrame) def melt(self, ignore_index, **kwargs): @@ -2958,6 +2969,13 @@ class DeferredGroupBy(frame_base.DeferredFrame): DataFrameGroupBy, '__len__', reason="non-deferred-result") groups = property(frame_base.wont_implement_method( DataFrameGroupBy, 'groups', reason="non-deferred-result")) + indices = property(frame_base.wont_implement_method( + DataFrameGroupBy, 'indices', reason="non-deferred-result")) + + resample = frame_base.wont_implement_method( + DataFrameGroupBy, 'resample', reason='event-time-semantics') + rolling = frame_base.wont_implement_method( + DataFrameGroupBy, 'rolling', reason='event-time-semantics') def _maybe_project_func(projection: Optional[List[str]]): """ Returns identity func if projection is empty or None, else returns diff --git a/sdks/python/apache_beam/dataframe/pandas_doctests_test.py b/sdks/python/apache_beam/dataframe/pandas_doctests_test.py index a36ba5d..ec3bb9b 100644 --- a/sdks/python/apache_beam/dataframe/pandas_doctests_test.py +++ b/sdks/python/apache_beam/dataframe/pandas_doctests_test.py @@ -77,6 +77,8 @@ class DoctestTest(unittest.TestCase): 'df.where(m, -df) == np.where(m, df, -df)' ], 'pandas.core.generic.NDFrame.interpolate': ['*'], + 'pandas.core.generic.NDFrame.resample': ['*'], + 'pandas.core.generic.NDFrame.rolling': ['*'], }, not_implemented_ok={ 'pandas.core.generic.NDFrame.asof': ['*'], @@ -90,8 +92,6 @@ class DoctestTest(unittest.TestCase): 'pandas.core.generic.NDFrame.reindex': ['*'], 'pandas.core.generic.NDFrame.reindex_like': ['*'], 'pandas.core.generic.NDFrame.replace': ['*'], - 'pandas.core.generic.NDFrame.resample': ['*'], - 'pandas.core.generic.NDFrame.rolling': ['*'], 'pandas.core.generic.NDFrame.sample': ['*'], 'pandas.core.generic.NDFrame.set_flags': ['*'], 'pandas.core.generic.NDFrame.squeeze': ['*'], @@ -591,10 +591,10 @@ class DoctestTest(unittest.TestCase): 'pandas.core.groupby.groupby.GroupBy.tail': ['*'], 'pandas.core.groupby.groupby.GroupBy.nth': ['*'], 'pandas.core.groupby.groupby.GroupBy.cumcount': ['*'], + 'pandas.core.groupby.groupby.GroupBy.resample': ['*'], }, not_implemented_ok={ 'pandas.core.groupby.groupby.GroupBy.ngroup': ['*'], - 'pandas.core.groupby.groupby.GroupBy.resample': ['*'], 'pandas.core.groupby.groupby.GroupBy.sample': ['*'], 'pandas.core.groupby.groupby.BaseGroupBy.pipe': ['*'], # pipe tests are in a different location in pandas 1.1.x