def METHOD_NAME(self, query: Query, query_settings: QuerySettings) -> None:
    if query_settings.get_turbo():
        return
    project_ids = get_object_ids_in_query_ast(query, self.__project_column)
    if project_ids is None:
        self._set_query_final(query, False)
        return
    for no_final_subscriptions_project in (
        get_config("skip_final_subscriptions_projects") or "[]"
    )[1:-1].split(","):
        if (
            no_final_subscriptions_project
            and int(no_final_subscriptions_project) in project_ids
            and isinstance(query_settings, SubscriptionQuerySettings)
        ):
            metrics.increment(name="subscriptions_skipped_final")
            self._set_query_final(query, False)
            return
    for denied_project_id_string in (
        get_config("post_replacement_consistency_projects_denylist") or "[]"
    )[1:-1].split(","):
        if (
            denied_project_id_string
            and int(denied_project_id_string) in project_ids
        ):
            metrics.increment(name=CONSISTENCY_DENYLIST_METRIC)
            self._set_query_final(query, True)
            return
    flags: ProjectsQueryFlags = ProjectsQueryFlags.load_from_redis(
        list(project_ids), self.__replacer_state_name
    )
    query_overlaps_replacement = self._query_overlaps_replacements(
        query, flags.latest_replacement_time
    )
    if not query_overlaps_replacement:
        self._set_query_final(query, False)
        return
    tags = self._initialize_tags(query_settings, flags)
    set_final = False
    if flags.needs_final:
        tags["cause"] = "final_flag"
        metrics.increment(
            name=FINAL_METRIC,
            tags=tags,
        )
        set_final = True
    elif flags.group_ids_to_exclude:
        # If the number of groups to exclude exceeds our limit, the query
        # should just use final instead of the exclusion set.
        max_group_ids_exclude = get_config(
            "max_group_ids_exclude",
            settings.REPLACER_MAX_GROUP_IDS_TO_EXCLUDE,
        )
        assert isinstance(max_group_ids_exclude, int)
        groups_to_exclude = self._groups_to_exclude(
            query, flags.group_ids_to_exclude
        )
        if (
            len(flags.group_ids_to_exclude) > 2 * max_group_ids_exclude
            or len(groups_to_exclude) > max_group_ids_exclude
        ):
            tags["cause"] = "max_groups"
            metrics.increment(
                name=FINAL_METRIC,
                tags=tags,
            )
            set_final = True
        elif groups_to_exclude:
            query.add_condition_to_ast(
                not_in_condition(
                    FunctionCall(
                        None,
                        "assumeNotNull",
                        (Column(None, None, self.__groups_column),),
                    ),
                    [Literal(None, p) for p in groups_to_exclude],
                )
            )
    self._set_query_final(query, set_final)