def gen_file_name(rank: int, file_ext: str) -> str:
    """
    generate filename to write a DataFrame partition
    """
    if rank < 10:
        numeric_ext = "000" + str(rank)
    elif rank < 100:
        numeric_ext = "00" + str(rank)
    elif rank < 1000:
        numeric_ext = "0" + str(rank)
    else:
        numeric_ext = str(rank)
    return "part_" + numeric_ext + "." + file_ext