apache/superset · error · ValueError

created_by_fk_or_editor only supports 'eq'; got '{c.opr}'

Error message

created_by_fk_or_editor only supports 'eq'; got '{c.opr}'

What it means

ValueError raised in DashboardDAO's filter extension (superset/daos/dashboard.py:128): the synthetic filter column 'created_by_fk_or_editor' (dashboards created by a user OR edited by that user's subject) only supports the 'eq' operator; any other operator string is rejected before the query runs.

Source

Thrown at superset/daos/dashboard.py:128

                operator_enum = ColumnOperatorEnum(c.opr)
                subq = (
                    select(dashboard_editors.c.dashboard_id)
                    .join(
                        Subject.__table__,
                        Subject.__table__.c.id == dashboard_editors.c.subject_id,
                    )
                    .where(
                        Subject.__table__.c.type == 1,
                        operator_enum.apply(Subject.__table__.c.user_id, c.value),
                    )
                )
                query = query.filter(
                    Dashboard.id.in_(subq)  # type: ignore[attr-defined,unused-ignore]
                )
            elif c.col == "created_by_fk_or_editor":
                if c.opr != "eq":
                    raise ValueError(
                        f"created_by_fk_or_editor only supports 'eq'; got '{c.opr}'"
                    )
                from superset.subjects.models import dashboard_editors, Subject

                editor_subq = (
                    select(dashboard_editors.c.dashboard_id)
                    .join(
                        Subject.__table__,
                        Subject.__table__.c.id == dashboard_editors.c.subject_id,
                    )
                    .where(
                        Subject.__table__.c.type == 1,
                        Subject.__table__.c.user_id == c.value,
                    )
                )
                query = query.filter(
                    or_(
                        Dashboard.created_by_fk == c.value,  # type: ignore[attr-defined,unused-ignore]

View on GitHub (pinned to f4587218dd)

Solutions

  1. Use "opr": "eq" with a scalar user id.
  2. For membership over several creators, issue multiple eq queries or use created_by_fk with in.
  3. Check the dashboard resource's filter metadata (CHART_CUSTOM_FIELDS analog / filters endpoint) before sending.

Example fix

# before
filters=[{"col": "created_by_fk_or_editor", "opr": "ne", "value": 1}]

# after
filters=[{"col": "created_by_fk_or_editor", "opr": "eq", "value": 1}]
Defensive patterns

Strategy: validation

Validate before calling

def dashboard_filters_valid(filters) -> bool:
    return all(
        not (f.get("col") == "created_by_fk_or_editor" and f.get("opr") != "eq")
        for f in filters or []
    )

Type guard

def is_eq_filter(f: dict) -> bool:
    return f.get("opr") == "eq"

Try / catch

try:
    DashboardDAO.find(query=", filters=filters)
except ValueError as ex:
    if "created_by_fk_or_editor" in str(ex):
        filters = [{**f, "opr": "eq"} for f in filters]
        results = DashboardDAO.find(query=", filters=filters)

Prevention

When it happens

Trigger: Calling /api/v1/dashboard/ or DashboardDAO.find with filters=[{"col": "created_by_fk_or_editor", "opr": "ne"|"in"|...}] — the mirror of the chart variant.

Common situations: Shared filter-payload builders used across chart and dashboard endpoints that assume a uniform operator set; MCP tool clients probing filter columns.

Related errors


AI-assisted analysis of apache/superset@f4587218dd (2026-08-14). Data as JSON: /api/errors/cc7cab57f2beb818. Report an issue: GitHub.