{"record":{"id":"4c73d159a98822ad","repo":"databendlabs/databend","slug":"unsupported-format-for-source-path-r-use-format","errorCode":null,"errorMessage":"Unsupported format for {source_path!r}. Use format= explicitly or pass pandas/polars/pyarrow data.","messagePattern":"Unsupported format for (.+?)\\. Use format= explicitly or pass pandas/polars/pyarrow data\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"src/bendpy/python/databend/__init__.py","lineNumber":149,"sourceCode":"        source: Any,\n        *,\n        format: str | None = None,\n        pattern: str | None = None,\n        connection: str | None = None,\n    ) -> \"SessionContext\":\n        if isinstance(source, (str, Path)):\n            source_path = str(source)\n            source_format = (format or Path(source_path).suffix.lstrip(\".\")).lower()\n            if source_format in {\"parquet\", \"pq\"}:\n                self.register_parquet(name, source_path, pattern=pattern, connection=connection)\n            elif source_format in {\"csv\"}:\n                self.register_csv(name, source_path, pattern=pattern, connection=connection)\n            elif source_format in {\"json\", \"ndjson\"}:\n                self.register_ndjson(name, source_path, pattern=pattern, connection=connection)\n            elif source_format in {\"txt\", \"text\", \"tsv\"}:\n                self.register_text(name, source_path, pattern=pattern, connection=connection)\n            else:\n                raise ValueError(\n                    f\"Unsupported format for {source_path!r}. \"\n                    \"Use format= explicitly or pass pandas/polars/pyarrow data.\"\n                )\n            return self\n\n        parquet_path = self._materialize_relation_source(name, source)\n        self.register_parquet(name, parquet_path)\n        return self\n\n    def from_df(self, source: Any, *, name: str | None = None) -> Relation:\n        target = name or _random_name(\"df\")\n        self.register(target, source)\n        return self.table(target)\n\n    def read_parquet(\n        self,\n        path: str | Path,\n        *,","sourceCodeStart":131,"sourceCodeEnd":167,"githubUrl":"https://github.com/databendlabs/databend/blob/288d84d76e20a2f8f7173bda9691eb6ece301aa9/src/bendpy/python/databend/__init__.py#L131-L167","documentation":"SemaphoreStorage permit keys are encoded as '<seq>/queue/<name>'. PermitKey::parse_key splits the input on the last two '/' and refuses keys that do not yield exactly 3 '/'. This indicates the key passed to parse_key is not a semaphore permit key — either it was malformed at write time, truncated, or a foreign key from the same storage prefix was passed in.","triggerScenarios":"Calling PermitKey::parse_key (directly or via storage lookup code) with a string that has fewer than 3 slash-separated segments, e.g. 'abc', 'seq/queue', an empty string, or a key belonging to a different key namespace stored under the same root.","commonSituations":"Hand-edited or manually constructed keys in the meta store; a version change in the key encoding; iterating raw meta-service keys and assuming all are permit keys; copying keys from logs that were truncated.","solutions":["Log and inspect the offending key string printed in the message; it must look like '<u64>/queue/<name>'.","Ensure only keys produced by PermitKey::to_key()/its writer path are passed to parse_key; filter foreign keys before parsing.","Check for code that truncates or re-slashes keys (URL-encoding, path joins) between write and read.","If old data was written by an older version with a different encoding, migrate or re-create those permit records."],"exampleFix":"// before\nlet pk = PermitKey::parse_key(raw_key)?;\n// after\nif raw_key.matches('/').count() < 2 || !raw_key.contains(\"/queue/\") {\n    continue; // skip non-permit keys\n}\nlet pk = PermitKey::parse_key(raw_key)?;","handlingStrategy":"validation","validationCode":"fn is_permit_key(key: &str) -> bool { key.rsplitn(3, '/').count() == 3 && key.contains(\"/queue/\") && key.rsplitn(3,'/').last().unwrap_or(\"\").parse::<u64>().is_ok() }\nif !is_permit_key(raw) { skip(raw); }","typeGuard":"fn as_permit_key(key: &str) -> Option<&str> { key.contains(\"/queue/\").then_some(key) }","tryCatchPattern":"match PermitKey::parse_key(key) { Ok(pk) => handle(pk), Err(e) if e.kind() == io::ErrorKind::InvalidInput => skip_foreign_key(key), Err(e) => return Err(e.into()) }","preventionTips":["Only parse keys produced by PermitKey's encoder","Filter by the '/queue/' marker before parsing","Never reuse the same meta prefix for unrelated key families"],"tags":["rust","meta-service","key-parsing","semaphore"],"backgroundTag":"invalid-argument-format","analyzedSha":"288d84d76e20a2f8f7173bda9691eb6ece301aa9","analyzedAt":"2026-09-11T11:29:36.208Z","contentChangedAt":"2026-09-11T11:29:36.208Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}