Repository: dask/dask

Issue:
Deprecate and remove tseries.resample getnanos
I've been exploring and learning about the Resampler class, and noticed that the utility `getnanos` is not currently used in the codebase. From the [blame](https://github.com/dask/dask/commit/7cb2428705fea3555f7269ba4be456783e02e194), it looks like this utility was necessary with an older version of pandas but is no longer necessary. As this is available in the public API, it may not be safe to remove without deprecation. But, perhaps it makes sense to deprecate and then remove this code?

```python
from dask.dataframe.tseries.resample import getnanos
getnanos??
Signature: getnanos(rule)
Docstring: <no docstring>
Source:   
def getnanos(rule):
    try:
        return getattr(rule, "nanos", None)
    except ValueError:
        return None
File:      ~/conda/envs/rapids-22.04/lib/python3.8/site-packages/dask/dataframe/tseries/resample.py
Type:      function
```


Discussion:
Thanks @beckernick -- agreed that `getnanos` is no longer needed. My guess is this was never intended to be part of Dask's public API, but given there's no leading `_` some users may have interpreted it as part of the public API. We should wrap `getnanos` in our `_deprecated` utility decorator 

https://github.com/dask/dask/blob/d36455b38da64b59d831d11e9c9bd44fd5b6cba2/dask/utils.py#L45

and add a test that it has been deprecated. Are you interested in working on this? (no obligation though)
No problem. Unless you think this is particularly time sensitive, I am happy to throw up a PR (likely Friday morning)

EDIT: Timeline will likely slip due to other work, but will return to this.
@beckernick are you still interested in opening a PR for this? No pressure either way, just wanted to check in!
Unfortunately I've had to shift focus and haven't had a chance to do this. I'm still happy to return to this when things clear up, but am also happy for someone else to jump in.
@scharlottej13 would you mind taking a look at this when you get a moment? 

Just noting we should keep this issue open until we actually remove `getnanos`
@scharlottej13 @jsignell I'm not sure how long deprecation cycles are with Dask. When should this function actually be removed?

Resolving patch:
diff --git a/dask/dataframe/tseries/resample.py b/dask/dataframe/tseries/resample.py
--- a/dask/dataframe/tseries/resample.py
+++ b/dask/dataframe/tseries/resample.py
@@ -7,15 +7,7 @@
 from dask.dataframe._compat import PANDAS_GT_140
 from dask.dataframe.core import DataFrame, Series
 from dask.highlevelgraph import HighLevelGraph
-from dask.utils import _deprecated, derived_from
-
-
-@_deprecated(after_version="2022.02.0")
-def getnanos(rule):
-    try:
-        return getattr(rule, "nanos", None)
-    except ValueError:
-        return None
+from dask.utils import derived_from
 
 
 def _resample_series(


Test patch:
diff --git a/dask/dataframe/tseries/tests/test_resample.py b/dask/dataframe/tseries/tests/test_resample.py
--- a/dask/dataframe/tseries/tests/test_resample.py
+++ b/dask/dataframe/tseries/tests/test_resample.py
@@ -4,7 +4,6 @@
 import pytest
 
 import dask.dataframe as dd
-from dask.dataframe.tseries.resample import getnanos
 from dask.dataframe.utils import assert_eq
 
 CHECK_FREQ = {}
@@ -214,8 +213,3 @@ def test_common_aggs(agg):
     expected = f(ds.resample("1d"))
 
     assert_eq(res, expected, check_dtype=False)
-
-
-def test_getnanos_deprecated():
-    with pytest.warns(FutureWarning, match="getnanos was deprecated"):
-        getnanos(None)