Skip to content

Commit cc5aa74

Browse files
samukwekuericmjl
andauthored
Deprecate the then function in favour of using pandas-builtin .pipe (#1259)
Co-authored-by: Eric Ma <[email protected]>
1 parent 6dbd74e commit cc5aa74

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

janitor/functions/then.py

+11
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,25 @@
22
from typing import Callable
33
import pandas_flavor as pf
44
import pandas as pd
5+
from janitor.utils import refactored_function
56

67

8+
@pf.register_dataframe_method
9+
@refactored_function(
10+
message="This function will be deprecated in a 1.x release. "
11+
"Kindly use `pd.DataFrame.pipe` instead."
12+
)
713
@pf.register_dataframe_method
814
def then(df: pd.DataFrame, func: Callable) -> pd.DataFrame:
915
"""Add an arbitrary function to run in the `pyjanitor` method chain.
1016
1117
This method does not mutate the original DataFrame.
1218
19+
!!!note
20+
21+
This function will be deprecated in a 1.x release.
22+
Please use `pd.DataFrame.pipe` instead.
23+
1324
Examples:
1425
A trivial example using a lambda `func`.
1526

0 commit comments

Comments
 (0)