Going away from procedural programming for feature engineering in ML

Procedural programming is often preferred by researches and at EDA stage by a data scientist. However, it’s critical to move towards OOP if the end goal is to deploy the ML pipeline at the end of the day. Let me explain with a simple example.

You have two columns : ‘Bill_date’ and ‘Dispatch_date’ and would like to create a feature as time difference between the two.
df[‘new_feature’] = pd.to_datetime(df[‘Bill_date’]) - pd.to_datetime(df[‘Dispatch_date’])
is a simple straightforward line in your jupyter notebook.

However, can you think of how to create an OOP transformer using sklearn for this application?