def try_creating_second_contact_name(df):
    """Joins separate columns into a "second_contact_name" column.

        If "second_contact_name" is not in the dataframe then it attempts to join other
        columns together to create an second_contact_name column.

        Args:
            df::pandas dataframe
                The CSV file as a dataframe.

        Returns:
            df::dataframe
                The updated dataframe with the new columns.
    """
    # if all of these things are columns in the df then combine them under the column name 'second_contact_name'
    if {
        "secondary_title",
        "secondary_first_name",
        "secondary_nickname",
        "secondary_last_name",
    }.issubset(df.columns):
        df["second_contact_name"] = (
                df["secondary_title"].fillna("")
                + " "
                + df["secondary_first_name"].fillna("")
                + " "
                + df["secondary_nickname"].fillna("")
                + df["secondary_last_name"].fillna("")
        )
    elif {"first_name_2", "last_name_2"}.issubset(df.columns):
        df["second_contact_name"] = (
                df["first_name_2"].fillna("") + " " + df["last_name_2"].fillna("")
        )
    else:
        pass

    return df