From dbe817d0cce5f3eddf463e4a8bcfa02372d2af4d Mon Sep 17 00:00:00 2001 From: samukweku Date: Wed, 3 May 2023 21:53:22 +1000 Subject: [PATCH] deprecate then --- janitor/functions/then.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/janitor/functions/then.py b/janitor/functions/then.py index d39908d10..3248053b0 100644 --- 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`.