def METHOD_NAME(step: WaterfallStep, merged_df: DataFrame, df: DataFrame) -> DataFrame:
    result_df = DataFrame(
        {
            LABEL_WATERFALL_COLUMN: merged_df.sort_values(
                by=get_sort_column(step), ascending=step.order == "asc"
            )[step.labelsColumn].astype(str)
        }
    )
    result_df[step.groupby] = merged_df.sort_values(
        by=get_sort_column(step), ascending=step.order == "asc"
    )[step.groupby]
    if step.parentsColumn is None:
        result_df[TYPE_WATERFALL_COLUMN] = "Parent"
    else:
        result_df[GROUP_WATERFALL_COLUMN] = merged_df.sort_values(
            by=get_sort_column(step), ascending=step.order == "asc"
        )[step.parentsColumn]
        result_df[TYPE_WATERFALL_COLUMN] = numpy.where(
            result_df["LABEL_waterfall"] == (result_df[GROUP_WATERFALL_COLUMN]),
            ["parent"],
            ["child"],
        )
    result_df[step.valueColumn] = merged_df.sort_values(
        by=get_sort_column(step), ascending=step.order == "asc"
    )[_RESULT_COLUMN]
    return result_df