prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Deprecate functions ?
  Central point to discuss functions to deprecate, if any?
  
  - [x] `process_text` - `transform_columns` covers this very well
  - [x]  `impute` vs `fill_empty` - `impute` has the advantage of extra statistics functions (mean, mode, ...)
  - [x] `rename_columns` - use pandas `rename`
  - [x] `rename_column` - use `pd.rename`
  - [x] `remove_columns` - use `pd.drop` or `select`
  - [x] `filter_on` - use `query` or `select`
  - [x] `fill_direction` - use `transform_columns` or `pd.DataFrame.assign`
  - [x] `groupby_agg` - use `transform_columns` - once `by` is implemented
  - [x] `then` - use `pd.DataFrame.pipe`
  - [x] `to_datetime` - use `jn.transform_columns`
  - [x] `pivot_wider` - use `pd.DataFrame.pivot`
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `janitor/functions/then.py`
  Content:
  ```
  1 """Implementation source for `then`."""
  2 from typing import Callable
  3 import pandas_flavor as pf
  4 import pandas as pd
  5 
  6 
  7 @pf.register_dataframe_method
  8 def then(df: pd.DataFrame, func: Callable) -> pd.DataFrame:
  9     """Add an arbitrary function to run in the `pyjanitor` method chain.
  10 
  11     This method does not mutate the original DataFrame.
  12 
  13     Examples:
  14         A trivial example using a lambda `func`.
  15 
  16         >>> import pandas as pd
  17         >>> import janitor
  18         >>> (pd.DataFrame({"a": [1, 2, 3], "b": [7, 8, 9]})
  19         ...  .then(lambda df: df * 2))
  20            a   b
  21         0  2  14
  22         1  4  16
  23         2  6  18
  24 
  25     Args:
  26         df: A pandas DataFrame.
  27         func: A function you would like to run in the method chain.
  28             It should take one parameter and return one parameter, each being
  29             the DataFrame object. After that, do whatever you want in the
  30             middle. Go crazy.
  31 
  32     Returns:
  33         A pandas DataFrame.
  34     """
  35     df = func(df)
  36     return df
  37
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/janitor/functions/then.py b/janitor/functions/then.py
  --- a/janitor/functions/then.py
  +++ b/janitor/functions/then.py
  @@ -2,14 +2,25 @@
   from typing import Callable
   import pandas_flavor as pf
   import pandas as pd
  +from janitor.utils import refactored_function
   
   
  +@pf.register_dataframe_method
  +@refactored_function(
  +    message="This function will be deprecated in a 1.x release. "
  +    "Kindly use `pd.DataFrame.pipe` instead."
  +)
   @pf.register_dataframe_method
   def then(df: pd.DataFrame, func: Callable) -> pd.DataFrame:
       """Add an arbitrary function to run in the `pyjanitor` method chain.
   
       This method does not mutate the original DataFrame.
   
  +    !!!note
  +
  +        This function will be deprecated in a 1.x release.
  +        Please use `pd.DataFrame.pipe` instead.
  +
       Examples:
           A trivial example using a lambda `func`.
  
verification_info: {"golden_diff": "diff --git a/janitor/functions/then.py b/janitor/functions/then.py\n--- a/janitor/functions/then.py\n+++ b/janitor/functions/then.py\n@@ -2,14 +2,25 @@\n from typing import Callable\n import pandas_flavor as pf\n import pandas as pd\n+from janitor.utils import refactored_function\n \n \n+@pf.register_dataframe_method\n+@refactored_function(\n+    message=\"This function will be deprecated in a 1.x release. \"\n+    \"Kindly use `pd.DataFrame.pipe` instead.\"\n+)\n @pf.register_dataframe_method\n def then(df: pd.DataFrame, func: Callable) -> pd.DataFrame:\n     \"\"\"Add an arbitrary function to run in the `pyjanitor` method chain.\n \n     This method does not mutate the original DataFrame.\n \n+    !!!note\n+\n+        This function will be deprecated in a 1.x release.\n+        Please use `pd.DataFrame.pipe` instead.\n+\n     Examples:\n         A trivial example using a lambda `func`.\n", "issue": "Deprecate functions ?\nCentral point to discuss functions to deprecate, if any?\r\n\r\n- [x] `process_text` - `transform_columns` covers this very well\r\n- [x]  `impute` vs `fill_empty` - `impute` has the advantage of extra statistics functions (mean, mode, ...)\r\n- [x] `rename_columns` - use pandas `rename`\r\n- [x] `rename_column` - use `pd.rename`\r\n- [x] `remove_columns` - use `pd.drop` or `select`\r\n- [x] `filter_on` - use `query` or `select`\r\n- [x] `fill_direction` - use `transform_columns` or `pd.DataFrame.assign`\r\n- [x] `groupby_agg` - use `transform_columns` - once `by` is implemented\r\n- [x] `then` - use `pd.DataFrame.pipe`\r\n- [x] `to_datetime` - use `jn.transform_columns`\r\n- [x] `pivot_wider` - use `pd.DataFrame.pivot`\n", "before_files": [{"content": "\"\"\"Implementation source for `then`.\"\"\"\nfrom typing import Callable\nimport pandas_flavor as pf\nimport pandas as pd\n\n\n@pf.register_dataframe_method\ndef then(df: pd.DataFrame, func: Callable) -> pd.DataFrame:\n    \"\"\"Add an arbitrary function to run in the `pyjanitor` method chain.\n\n    This method does not mutate the original DataFrame.\n\n    Examples:\n        A trivial example using a lambda `func`.\n\n        >>> import pandas as pd\n        >>> import janitor\n        >>> (pd.DataFrame({\"a\": [1, 2, 3], \"b\": [7, 8, 9]})\n        ...  .then(lambda df: df * 2))\n           a   b\n        0  2  14\n        1  4  16\n        2  6  18\n\n    Args:\n        df: A pandas DataFrame.\n        func: A function you would like to run in the method chain.\n            It should take one parameter and return one parameter, each being\n            the DataFrame object. After that, do whatever you want in the\n            middle. Go crazy.\n\n    Returns:\n        A pandas DataFrame.\n    \"\"\"\n    df = func(df)\n    return df\n", "path": "janitor/functions/then.py"}], "after_files": [{"content": "\"\"\"Implementation source for `then`.\"\"\"\nfrom typing import Callable\nimport pandas_flavor as pf\nimport pandas as pd\nfrom janitor.utils import refactored_function\n\n\n@pf.register_dataframe_method\n@refactored_function(\n    message=\"This function will be deprecated in a 1.x release. \"\n    \"Kindly use `pd.DataFrame.pipe` instead.\"\n)\n@pf.register_dataframe_method\ndef then(df: pd.DataFrame, func: Callable) -> pd.DataFrame:\n    \"\"\"Add an arbitrary function to run in the `pyjanitor` method chain.\n\n    This method does not mutate the original DataFrame.\n\n    !!!note\n\n        This function will be deprecated in a 1.x release.\n        Please use `pd.DataFrame.pipe` instead.\n\n    Examples:\n        A trivial example using a lambda `func`.\n\n        >>> import pandas as pd\n        >>> import janitor\n        >>> (pd.DataFrame({\"a\": [1, 2, 3], \"b\": [7, 8, 9]})\n        ...  .then(lambda df: df * 2))\n           a   b\n        0  2  14\n        1  4  16\n        2  6  18\n\n    Args:\n        df: A pandas DataFrame.\n        func: A function you would like to run in the method chain.\n            It should take one parameter and return one parameter, each being\n            the DataFrame object. After that, do whatever you want in the\n            middle. Go crazy.\n\n    Returns:\n        A pandas DataFrame.\n    \"\"\"\n    df = func(df)\n    return df\n", "path": "janitor/functions/then.py"}]}