from typing import Callable
import functools


def show_shapes(func: Callable) -> Callable:
    """
    Decorator to log dataframe shape before and after applying a function.

    Args:
        func: Function that takes a dataframe as argument

    Returns:
        function
    """

    @functools.wraps(func)
    def inner(df):
        print(f"Shape before {func.__name__}", df.shape)
        out_df = func(df)
        print(f"Shape after {func.__name__}", out_df.shape)
        return out_df

    return inner