The bar chart shows normally however when I enter a formula the query errors.

See the following video for steps to reproduce: https://share.cleanshot.com/gYbA6F

Link to the insight: https://app.posthog.com/insights/eswxiLCU/edit
posthog/queries/trends/util.py
entity: Entity, team: Team, event_table_alias: Optional[str] = None, person_id_alias: str = "person_id"
) -> Tuple[str, str, Dict[str, Any]]:
    aggregate_operation = "count(*)"
    join_condition = ""
    params: Dict[str, Any] = {}
    if entity.math == "dau":
        if team.aggregate_users_by_distinct_id:
            join_condition = ""
            aggregate_operation = f"count(DISTINCT {event_table_alias + '.' if event_table_alias else ''}distinct_id)"
        else:
            join_condition = EVENT_JOIN_PERSON_SQL
            aggregate_operation = f"count(DISTINCT {person_id_alias})"
    elif entity.math == "unique_group":
        validate_group_type_index("math_group_type_index", entity.math_group_type_index, required=True)
        aggregate_operation = f"count(DISTINCT $group_{entity.math_group_type_index})"
    elif entity.math == "unique_session":
        aggregate_operation = f"count(DISTINCT {event_table_alias + '.' if event_table_alias else ''}$session_id)"
    elif entity.math in MATH_FUNCTIONS:
        if entity.math_property is None:
            raise ValidationError({"math_property": "This field is required when `math` is set."}, code="required")
        if entity.math_property == "$session_duration":
            aggregate_operation = f"{MATH_FUNCTIONS[entity.math]}(session_duration)"
        else:
            key = f"e_{entity.index}_math_prop"
            value, _ = get_property_string_expr("events", entity.math_property, f"%({key})s", "properties")
            aggregate_operation = f"{MATH_FUNCTIONS[entity.math]}(toFloat64OrNull({value}))"
            params[key] = entity.math_property
    return aggregate_operation, join_condition, params
def parse_response(stats: Dict, filter: Filter, additional_values: Dict = {}) -> Dict[str, Any]: