{"record":{"id":"c7e9af4be5d2eab0","repo":"BerriAI/litellm","slug":"export-format-self-export-format-not-supported","errorCode":null,"errorMessage":"Export format '{self.export_format}' not supported. Use 'parquet' or 'csv'.","messagePattern":"Export format '(.+?)' not supported\\. Use 'parquet' or 'csv'\\.","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"litellm/integrations/focus/export_engine.py","lineNumber":45,"sourceCode":"    ) -> None:\n        self.provider = provider\n        self.export_format = export_format\n        self.prefix = prefix\n        self._destination = FocusDestinationFactory.create(\n            provider=self.provider,\n            prefix=self.prefix,\n            config=destination_config,\n        )\n        self._serializer = self._init_serializer()\n        self._transformer = FocusTransformer()\n        self._database = FocusLiteLLMDatabase()\n\n    def _init_serializer(self) -> FocusSerializer:\n        if self.export_format == \"csv\":\n            return FocusCsvSerializer()\n        if self.export_format == \"parquet\":\n            return FocusParquetSerializer()\n        raise NotImplementedError(f\"Export format '{self.export_format}' not supported. Use 'parquet' or 'csv'.\")\n\n    async def dry_run_export_usage_data(self, limit: int | None) -> dict[str, Any]:\n        data: Final = await self._database.get_usage_data(limit=limit)\n        normalized: Final = self._transformer.transform(data)\n\n        usage_sample: Final = data.head(min(50, len(data))).to_dicts()\n        normalized_sample: Final = normalized.head(min(50, len(normalized))).to_dicts()\n\n        summary: Final = {\n            \"total_records\": len(normalized),\n            \"total_spend\": self._sum_column(data, \"spend\"),\n            \"total_tokens\": self._sum_column(data, \"total_tokens\"),\n            \"unique_teams\": self._count_unique(data, \"team_id\"),\n            \"unique_models\": self._count_unique(data, \"model\"),\n        }\n\n        return {\n            \"usage_data\": usage_sample,","sourceCodeStart":27,"sourceCodeEnd":63,"githubUrl":"https://github.com/BerriAI/litellm/blob/6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d/litellm/integrations/focus/export_engine.py#L27-L63","documentation":"FocusExportEngine._init_serializer raises NotImplementedError when export_format is neither 'csv' nor 'parquet'. The engine maps the format string to a serializer class (FocusCsvSerializer / FocusParquetSerializer); anything else has no implementation.","triggerScenarios":"Initializing FocusExportEngine with export_format='json', 'JSON', 'Parquet' (case-sensitive), or None via constructor or settings/env-driven config.","commonSituations":"Case mismatch ('CSV' vs 'csv'); copy-pasting a format from a different tool's docs; leaving an empty string default from templated config.","solutions":["Set export_format to exactly 'parquet' or 'csv' (lowercase).","Validate/normalize the value (strip + lower) in your config layer before constructing the engine.","If you need another format, subclass FocusSerializer and register it — do not expect built-in support."],"exampleFix":"# before\nFocusExportEngine(export_format=\"JSON\", ...)\n\n# after\nFocusExportEngine(export_format=\"parquet\", ...)","handlingStrategy":"validation","validationCode":"fmt = (export_format or \"\").strip().lower()\nif fmt not in {\"parquet\", \"csv\"}:\n    raise ValueError(f\"export_format must be 'parquet' or 'csv', got {export_format!r}\")\nengine = FocusExportEngine(export_format=fmt, ...)","typeGuard":"from typing import Literal\nFocusFormat = Literal[\"parquet\", \"csv\"]\n\ndef is_focus_format(v: str) -> bool:\n    return v in {\"parquet\", \"csv\"}","tryCatchPattern":null,"preventionTips":["Type the setting as Literal['parquet','csv'] in your config model so bad values fail at load.","Normalize case/whitespace on the format before constructing the engine.","Document the supported formats in the config template next to the key."],"tags":["config","focus-export","validation","export-format"],"backgroundTag":null,"analyzedSha":"6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d","analyzedAt":"2026-08-15T07:12:03.035Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}