def _account_for_bubble_fields(sg_entity_type, field_name):
    """Detect bubble fields and return the proper entity type and field name.

    :param str sg_entity_type: The intput entity type name. If the field name
        is a bubbled field notation, this value will be replaced by the
        parsed entity type in the field string.
    :param str field_name: The name of the field. This may be in "bubble"
        notation: "sg_sequence.Sequence.code"

    If field_name is in bubble notation (example: "sg_sequence.Sequence.code")
    this method will return "code" as the field name and "Sequence" as the
    entity type.

    If the field name is not in bubble notation, this method simply returns a
    tuple containing the supplied arguments.

    :returns: A tuple (str, str) where the first item is the evaluated entity
        type name and the second is the evaluated field name.
    :rtype: tuple
    """

    if "." in field_name:
        (sg_entity_type, field_name) = field_name.split(".")[-2:]

    return (sg_entity_type, field_name)