Skip to content

Commit

Permalink
Deprecate the then function in favour of using pandas-builtin `.pip…
Browse files Browse the repository at this point in the history
…e` (#1259)

Co-authored-by: Eric Ma <ericmjl@users.noreply.github.com>
  • Loading branch information
samukweku and ericmjl committed May 13, 2023
1 parent 6dbd74e commit cc5aa74
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions janitor/functions/then.py
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand Down

0 comments on commit cc5aa74

Please sign in to comment.