Repository: dask/dask

Issue:
`SeriesGroupBy` cumulative functions on `axis=1` don't raise an error
<!-- Please include a self-contained copy-pastable example that generates the issue if possible.

Please be concise with code posted. See guidelines below on how to provide a good bug report:

- Craft Minimal Bug Reports http://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports
- Minimal Complete Verifiable Examples https://stackoverflow.com/help/mcve

Bug reports that follow these guidelines are easier to diagnose, and so are often handled much more quickly.
-->

**What happened**:

Dask DataFrame `SeriesGroupBy` cumulative functions: `cumsum`, `cumprod`, and `cumcount` currently produce outputs when used with `axis=1`. While the pandas equivalents raise a error

```ValueError: No axis named 1 for object type Series```

which makes sense.

**What you expected to happen**:

Dask should also raise relevant errors, and stay consistent with pandas

**Minimal Complete Verifiable Example**:

```python
import dask.dataframe as dd
import pandas as pd

df = pd.DataFrame(
    {
        "x": [4, 0, 3, 3, 3, 1, 3, 2, 4, 0],
        "a": [4, 0, 3, 3, 3, 1, 3, 2, 4, 0],
    }
)

ddf = dd.from_pandas(df, npartitions=2)


#
# pandas
#

df_grouped = pdf.groupby("x").a.cumsum(
    axis=1
)  # ValueError: No axis named 1 for object type Series

df_grouped = pdf.groupby("x").a.cumprod(
    axis=1
)  # ValueError: No axis named 1 for object type Series

df_grouped = pdf.groupby("x").a.cumcount(
    axis=1
)  # TypeError: cumcount() got an unexpected keyword argument 'axis'


#
# Dask
#

ddf.groupby("x").a.cumsum(axis=1).compute()
#    x  a
# 0  4  8
# 1  0  0
# 2  3  6
# 3  3  6
# 4  3  6
# 5  1  2
# 6  3  6
# 7  2  4
# 8  4  8
# 9  0  0

ddf.groupby("x").a.cumprod(axis=1).compute()
#    x   a
# 0  4  16
# 1  0   0
# 2  3   9
# 3  3   9
# 4  3   9
# 5  1   1
# 6  3   9
# 7  2   4
# 8  4  16
# 9  0   0

ddf.groupby("x").a.cumcount(axis=1).compute()
# 0    0
# 1    0
# 2    0
# 3    1
# 4    2
# 5    0
# 6    3
# 7    0
# 8    1
# 9    1
# dtype: int64
```

**Anything else we need to know?**:

We noticed this while diagnosing #9313

**Environment**:

- Dask version: 2022.8.0
- Python version: 3.9
- Operating System: macOS
- Install method (conda, pip, source): conda

<!-- If you are reporting an issue such as scale stability, cluster deadlock.
Please provide a cluster dump state with this issue, by running client.dump_cluster_state()

https://distributed.dask.org/en/stable/api.html?highlight=dump_cluster_state#distributed.Client.dump_cluster_state

-->

<details>
<summary>Cluster Dump State:</summary>

</details>


Discussion:

Resolving patch:
diff --git a/dask/dataframe/groupby.py b/dask/dataframe/groupby.py
--- a/dask/dataframe/groupby.py
+++ b/dask/dataframe/groupby.py
@@ -1390,19 +1390,31 @@ def _shuffle(self, meta):
     @derived_from(pd.core.groupby.GroupBy)
     def cumsum(self, axis=0):
         if axis:
-            return self.obj.cumsum(axis=axis)
+            if isinstance(self, SeriesGroupBy):
+                raise ValueError("No axis named 1 for object type Series")
+            else:
+                return self.obj.cumsum(axis=axis)
         else:
             return self._cum_agg("cumsum", chunk=M.cumsum, aggregate=M.add, initial=0)
 
     @derived_from(pd.core.groupby.GroupBy)
     def cumprod(self, axis=0):
         if axis:
-            return self.obj.cumprod(axis=axis)
+            if isinstance(self, SeriesGroupBy):
+                raise ValueError("No axis named 1 for object type Series")
+            else:
+                return self.obj.cumprod(axis=axis)
         else:
             return self._cum_agg("cumprod", chunk=M.cumprod, aggregate=M.mul, initial=1)
 
     @derived_from(pd.core.groupby.GroupBy)
-    def cumcount(self, axis=None):
+    def cumcount(self, axis=no_default):
+        if axis is not no_default:
+            warnings.warn(
+                "The `axis` keyword argument is deprecated and will removed in a future release. "
+                "Previously it was unused and had no effect.",
+                FutureWarning,
+            )
         return self._cum_agg(
             "cumcount", chunk=M.cumcount, aggregate=_cumcount_aggregate, initial=-1
         )


Test patch:
diff --git a/dask/dataframe/tests/test_groupby.py b/dask/dataframe/tests/test_groupby.py
--- a/dask/dataframe/tests/test_groupby.py
+++ b/dask/dataframe/tests/test_groupby.py
@@ -1494,6 +1494,13 @@ def test_cumulative(func, key, sel):
     g, dg = (d.groupby(key)[sel] for d in (df, ddf))
     assert_eq(getattr(g, func)(), getattr(dg, func)())
 
+    if func == "cumcount":
+        with pytest.warns(
+            FutureWarning,
+            match="`axis` keyword argument is deprecated and will removed in a future release",
+        ):
+            dg.cumcount(axis=0)
+
 
 @pytest.mark.parametrize("func", ["cumsum", "cumprod"])
 def test_cumulative_axis1(func):
@@ -1510,6 +1517,15 @@ def test_cumulative_axis1(func):
         getattr(df.groupby("a"), func)(axis=1), getattr(ddf.groupby("a"), func)(axis=1)
     )
 
+    with pytest.raises(ValueError, match="No axis named 1 for object type Series"):
+        getattr(ddf.groupby("a").b, func)(axis=1)
+
+    with pytest.warns(
+        FutureWarning,
+        match="`axis` keyword argument is deprecated and will removed in a future release",
+    ):
+        ddf.groupby("a").cumcount(axis=1)
+
 
 def test_groupby_unaligned_index():
     df = pd.DataFrame(