{"record":{"id":"9e563871a1cfb492","repo":"cube-js/cube","slug":"filter-group-expects-filter-params-args-to-be-pass","errorCode":null,"errorMessage":"FILTER_GROUP expects FILTER_PARAMS args to be passed. For example FILTER_GROUP(FILTER_PARAMS.foo.bar.filter('bar'), FILTER_PARAMS.foo.jar.filter('jar')). But found: ${f}","messagePattern":"FILTER_GROUP expects FILTER_PARAMS args to be passed\\. For example FILTER_GROUP\\(FILTER_PARAMS\\.foo\\.bar\\.filter\\('bar'\\), FILTER_PARAMS\\.foo\\.jar\\.filter\\('jar'\\)\\)\\. But found: (.+?)","errorType":"validation","errorClass":"UserError","httpStatus":null,"severity":"error","filePath":"packages/cubejs-schema-compiler/src/adapter/BaseQuery.js","lineNumber":5421,"sourceCode":"    // eslint-disable-next-line prefer-spread\n    return filterParamArg.__column().apply(\n      null,\n      filterParams.map(allocateParam),\n    );\n  }\n\n  filterGroupFunction() {\n    const { allFilters } = this;\n    return this.filterGroupFunctionImpl(allFilters);\n  }\n\n  filterGroupFunctionImpl(allFilters) {\n    const allocateParam = this.paramAllocator.allocateParam.bind(this.paramAllocator);\n    const newGroupFilter = this.newGroupFilter.bind(this);\n    return (...filterParamArgs) => {\n      const groupMembers = filterParamArgs.map(f => {\n        if (!f.__member) {\n          throw new UserError(`FILTER_GROUP expects FILTER_PARAMS args to be passed. For example FILTER_GROUP(FILTER_PARAMS.foo.bar.filter('bar'), FILTER_PARAMS.foo.jar.filter('jar')). But found: ${f}`);\n        }\n        return f.__member();\n      });\n\n      const aliases = allFilters ?\n        allFilters\n          .map(v => (v.query ? v.query.allBackAliasMembersExceptSegments() : {}))\n          .reduce((a, b) => ({ ...a, ...b }), {})\n        : {};\n      // Filtering aliases that somehow relate to this group members\n      const aliasesForGroupMembers = Object.entries(aliases)\n        .filter(([key, value]) => groupMembers.includes(key))\n        .map(([_key, value]) => value);\n      const filter = BaseQuery.findAndSubTreeForFilterGroup(\n        newGroupFilter({ operator: 'and', values: allFilters }),\n        groupMembers,\n        newGroupFilter,\n        aliasesForGroupMembers","sourceCodeStart":5403,"sourceCodeEnd":5439,"githubUrl":"https://github.com/cube-js/cube/blob/7d981676b36392fec34088b9afab6bdcad40207c/packages/cubejs-schema-compiler/src/adapter/BaseQuery.js#L5403-L5439","documentation":"FILTER_GROUP() combines multiple FILTER_PARAMS conditions into one grouped filter. Every argument must be a FILTER_PARAMS arg object exposing __member(). Passing anything else (a raw string, SQL fragment, undefined, or result of a non-FILTER_PARAMS function) fails the check and throws this UserError.","triggerScenarios":"FILTER_GROUP('some string'), FILTER_GROUP(orders.bar.filter('x')) where orders.bar is not a FILTER_PARAMS arg, or FILTER_GROUP() with no args; nesting a plain filter expression inside FILTER_GROUP.","commonSituations":"Mixing normal filter helpers with FILTER_GROUP; forgetting to wrap members in FILTER_PARAMS.<cube>.<member>.filter(...); typos so the call chain returns undefined.","solutions":["Wrap every argument in FILTER_PARAMS.<cube>.<member>.filter('...') before passing to FILTER_GROUP","Ensure each referenced member actually has a filter() defined via FILTER_PARAMS in the model","Remove non-FILTER_PARAMS arguments or move them into the members' filter conditions"],"exampleFix":"// before\nsql: `FILTER_GROUP(orders.status, ${FILTER_SQL})`\n// after\nsql: `FILTER_GROUP(FILTER_PARAMS.orders.status.filter('status'), FILTER_PARAMS.orders.region.filter('region'))`","handlingStrategy":"validation","validationCode":"function validateFilterGroupArgs(...args) {\n  if (!args.length || args.some(a => !a || typeof a.__member !== 'function'))\n    throw new Error('FILTER_GROUP args must be FILTER_PARAMS.<cube>.<member>.filter(...) results');\n}","typeGuard":"const isFilterParamMember = (f) => typeof f === 'object' && f !== null && typeof f.__member === 'function';","tryCatchPattern":"try { await cubeApi.query(q); } catch (e) { if (/FILTER_GROUP expects FILTER_PARAMS args/.test(e.message)) console.error('Wrap each arg in FILTER_PARAMS...filter()'); throw e; }","preventionTips":["Never pass raw strings or plain filters into FILTER_GROUP","Build FILTER_GROUP args by spreading only FILTER_PARAMS.filter() results","Type-check generated SQL templates that interpolate FILTER_GROUP"],"tags":["filter-params","filter-group","validation"],"backgroundTag":"filter-params-arg-not-found","analyzedSha":"7d981676b36392fec34088b9afab6bdcad40207c","analyzedAt":"2026-09-02T03:45:10.400Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}