{"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/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/integrations/focus/export_engine.py#L27-L63","documentation":"FocusExportEngine._init_serializer raises NotImplementedError when export_format is anything other than 'csv' or 'parquet'. The export engine serializes FOCUS billing data via a serializer chosen by exact string match, so unknown formats have no implementation to dispatch to. This fails during engine construction, before any data is read.","triggerScenarios":"Passing export_format='json', 'JSON', 'PARQUET' (case matters), or a typo like 'cv' to the FOCUS export engine; loading export_format from a config field or env var with an unexpected value; a new config value shipped without updating the engine.","commonSituations":"Assuming JSON output is supported because other litellm export paths use it; case mismatches ('CSV' vs 'csv'); stale documentation or templates suggesting 'jsonl'; copy-pasting a format value from a different integration.","solutions":["Set export_format to exactly 'parquet' or 'csv' (lowercase).","If you need JSON, export CSV and convert downstream — the engine has no JSON serializer.","Validate the value at config-load time so users get an error before the scheduler starts.","Check for leading/trailing whitespace or case differences in the configured value."],"exampleFix":"# before\nengine = FocusExportEngine(export_format='json', ...)\n\n# after\nengine = FocusExportEngine(export_format='csv', ...)","handlingStrategy":"type-guard","validationCode":"SUPPORTED_FORMATS = {'csv', 'parquet'}\nfmt = (export_format or '').strip().lower()\nif fmt not in SUPPORTED_FORMATS:\n    raise SystemExit(f'export_format must be one of {sorted(SUPPORTED_FORMATS)}, got {export_format!r}')","typeGuard":"def is_supported_export_format(fmt: str | None) -> bool:\n    return fmt in {'csv', 'parquet'}","tryCatchPattern":"try:\n    engine = FocusExportEngine(export_format=fmt, ...)\nexcept NotImplementedError as e:\n    raise ConfigError('FOCUS export_format must be csv or parquet') from e","preventionTips":["Normalize (strip/lower) and validate export_format at config-load time.","Keep the allowed-format set in one shared constant used by both validation and engine init."],"tags":["focus-export","serialization","format-validation","not-implemented"],"backgroundTag":"unsupported-format-value","analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}