def METHOD_NAME(self, record: AirbyteRecordMessage, fields: Optional[List[str]]) -> Dict[str, Any]:
    relevant_fields = {}
    if fields and len(fields) > 0:
        for field in fields:
            values = dpath.util.values(record.data, field, separator=".")
            if values and len(values) > 0:
                relevant_fields[field] = values if len(values) > 1 else values[0]
    else:
        relevant_fields = record.data
    return relevant_fields