{"record":{"id":"a25ec9ad3c698e05","repo":"HKUDS/Vibe-Trading","slug":"alpha-id-panel-missing-required-columns-missin","errorCode":null,"errorMessage":"{alpha_id}: panel missing required columns {missing}","messagePattern":"(.+?): panel missing required columns (.+?)","errorType":"validation","errorClass":"SkipAlpha","httpStatus":null,"severity":"warning","filePath":"agent/src/factors/registry.py","lineNumber":334,"sourceCode":"            \"errors\": [\n                {\"alpha_id\": e.alpha_id, \"reason\": e.reason} for e in self._load_errors\n            ],\n        }\n\n    def compute(self, alpha_id: str, panel: dict[str, pd.DataFrame]) -> pd.DataFrame:\n        \"\"\"Lazy-import the alpha module and run its ``compute(panel)``.\n\n        Raises:\n            KeyError: alpha_id unknown.\n            SkipAlpha: required column / sector tag absent in panel.\n            RegistryError: import/compute failed or output failed sanity checks.\n        \"\"\"\n        alpha = self.get(alpha_id)\n        meta = alpha.meta\n\n        missing = [c for c in meta.get(\"columns_required\", []) if c not in panel]\n        if missing:\n            raise SkipAlpha(f\"{alpha_id}: panel missing required columns {missing}\")\n        missing_extra = [c for c in meta.get(\"extras_required\", []) if c not in panel]\n        if missing_extra:\n            raise SkipAlpha(f\"{alpha_id}: panel missing extras {missing_extra}\")\n        if meta.get(\"requires_sector\") and \"sector\" not in panel:\n            raise SkipAlpha(f\"{alpha_id}: panel missing sector tag\")\n\n        try:\n            module = self._load_module(alpha)\n        except Exception as exc:  # noqa: BLE001 — isolate import failure\n            raise RegistryError(f\"{alpha_id}: import failed: {exc}\") from exc\n\n        compute_fn = getattr(module, \"compute\", None)\n        if compute_fn is None:\n            raise RegistryError(f\"{alpha_id}: module has no compute() function\")\n\n        try:\n            result = compute_fn(panel)\n        except Exception as exc:  # noqa: BLE001 — isolate compute failure","sourceCodeStart":316,"sourceCodeEnd":352,"githubUrl":"https://github.com/HKUDS/Vibe-Trading/blob/80ffdda44c5c4db0dd84d70e051cca591cea67df/agent/src/factors/registry.py#L316-L352","documentation":"Registry.compute checks the panel against the alpha's declared columns_required metadata before running compute(). If any required column (e.g. 'open', 'volume', 'vwap') is absent from the panel dict, it raises SkipAlpha so the caller can skip this factor rather than crash inside pandas.","triggerScenarios":"compute(alpha_id, panel) where panel lacks one of meta['columns_required'] — e.g. an OHLC-only panel passed to an alpha requiring 'vwap'.","commonSituations":"Building panels from a data source that omits adjusted volume or vwap; mixing zoo families (Alpha101 vs GTJA191) with different column needs; forgetting to add benchmark/returns columns.","solutions":["Add the missing column(s) to the panel before compute","Pick alphas whose columns_required match your panel (filter via meta)","Wrap compute in a SkipAlpha handler to skip cleanly in batch runs"],"exampleFix":"# before\nout = registry.compute('alpha_029', {'close': close_df})\n# after\npanel = {'close': close_df, 'open': open_df, 'volume': vol_df, 'high': high_df, 'low': low_df, 'returns': ret_df}\nout = registry.compute('alpha_029', panel)","handlingStrategy":"validation","validationCode":"meta = registry.get(alpha_id).meta\nmissing = [c for c in meta.get('columns_required', []) if c not in panel]\nif missing: skip(alpha_id, f'missing {missing}')","typeGuard":"def panel_has(panel: dict, meta: dict) -> bool:\n    return all(c in panel for c in meta.get('columns_required', []))","tryCatchPattern":"try:\n    out = registry.compute(aid, panel)\nexcept SkipAlpha:\n    continue","preventionTips":["Build full OHLCV+ panels by default","Filter the alpha list by meta before batch runs"],"tags":["data-validation","panel","registry"],"backgroundTag":"missing-required-column","analyzedSha":"80ffdda44c5c4db0dd84d70e051cca591cea67df","analyzedAt":"2026-08-28T12:46:38.989Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}