def append_if_not_none(prefix, key, separator="."):
    """
    Append the given prefix if the prefix isn't empty.
    """

    if prefix is not None and len(prefix) > 0:
        return prefix + separator + key
    else:
        return key