def _make_clients_daily_filter()

in auto_sizing/targets.py [0:0]


    def _make_clients_daily_filter(self, target: Dict[str, str]) -> str:
        conditions = []
        for dimension, value in target.items():
            dimension = dimension.replace("release", "normalized")

            if value != "all" and dimension != "user_type":
                pattern = r"[\(\[]([^\)\]]+)[\)\]]"
                if not re.search(pattern, value):
                    value = f"('{value}')"
                conditions.append(f"(UPPER({dimension}) IN {value.upper()})")

        condition_string = "\n AND ".join(conditions)
        clients_daily_sql = f"""
                COALESCE(
                    LOGICAL_OR(
                    {condition_string}
                    )
                )
                """

        return clients_daily_sql