def get_column_name(df, column, total_columns=None):
    """
    gets the name of a column from either an integer or a passed name.
    Allows the total columns to be overwritten for cases where additional columns
    are added to the dataframe.
    """
    if total_columns is None:
        total_columns = df.shape[1]
    if column in df.columns:
        return column
    try:
        column_index = int(column)
        if column_index < 0:
            column_index = column_index + total_columns
        return df.columns.values.tolist()[column_index]
    except (ValueError, TypeError):
        try:
            from dativa.file_processing import FpInvalidSourceFieldError
            raise FpInvalidSourceFieldError(column)
        except ImportError:
            raise KeyError('Invalid column name: {}'.format(column))
