def METHOD_NAME(self, current_stream_state: MutableMapping[str, Any], latest_record: Mapping[str, Any]) -> Mapping[str, Any]:
    try:
        latest_record_date = parse(latest_record["published"])
        latest_record_state = {"published": latest_record["published"]}
    except Exception:
        latest_record_date = None
    try:
        current_record_date = parse(current_stream_state["published"])
    except Exception:
        current_record_date = None
    if latest_record_date and current_record_date:
        if latest_record_date > current_record_date:
            return latest_record_state
        else:
            return current_stream_state
    if latest_record_date:
        return latest_record_state
    if current_record_date:
        return current_stream_state
    else:
        return {}