def METHOD_NAME(df: pd.DataFrame, by: str) -> None:
    # sort rows according to timestamps
    log.debug(f"sorting database entries according to {by}")
    if by == "timestamp":
        df["_datetime"] = df["timestamp"].apply(to_datetime)
        df.sort_values("_datetime", ignore_index=True, inplace=True)
        df.drop("_datetime", axis=1, inplace=True)
    else:
        df.sort_values(by, ignore_index=True, inplace=True)