{"record":{"id":"98cbfc064d4698ce","repo":"databendlabs/databend","slug":"unsupported-source-type-expected-path-pandas-dat","errorCode":null,"errorMessage":"Unsupported source type. Expected path, pandas.DataFrame, polars.DataFrame, or pyarrow.Table.","messagePattern":"Unsupported source type\\. Expected path, pandas\\.DataFrame, polars\\.DataFrame, or pyarrow\\.Table\\.","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"src/bendpy/python/databend/__init__.py","lineNumber":239,"sourceCode":"        return _normalize_path(parquet_path)\n\n    @staticmethod\n    def _to_arrow_table(source: Any):\n        if hasattr(source, \"schema\") and hasattr(source, \"to_pydict\"):\n            return source\n\n        if hasattr(source, \"to_arrow\"):\n            return source.to_arrow()\n\n        if hasattr(source, \"to_pandas\"):\n            source = source.to_pandas()\n\n        try:\n            import pyarrow as pa\n\n            return pa.Table.from_pandas(source, preserve_index=False)\n        except Exception as exc:\n            raise TypeError(\n                \"Unsupported source type. Expected path, pandas.DataFrame, \"\n                \"polars.DataFrame, or pyarrow.Table.\"\n            ) from exc\n\n\nConnection = SessionContext\nDataFrame = Relation\n\n\ndef connect(database: str = \":memory:\", *, data_path: str | None = None) -> Connection:\n    if data_path is not None:\n        return Connection(data_path=data_path)\n\n    if database == \":memory:\":\n        conn = Connection(data_path=mkdtemp(prefix=\"databend-embedded-\"))\n        conn._ephemeral = True\n        return conn\n","sourceCodeStart":221,"sourceCodeEnd":257,"githubUrl":"https://github.com/databendlabs/databend/blob/288d84d76e20a2f8f7173bda9691eb6ece301aa9/src/bendpy/python/databend/__init__.py#L221-L257","documentation":"PermitKey::parse_key requires the second of the 3 segments (parts[1]) to be the literal 'queue'. The key has the right shape (3 segments) but is not a queue permit key — it likely belongs to another key family in the same storage tree.","triggerScenarios":"Parsing a key like '123/users/myname' or '123/foo/bar' — 3 segments, but the middle segment is not 'queue'.","commonSituations":"A generic storage-scan feeds unrelated meta keys into parse_key; a typo'd writer path wrote keys with a wrong middle segment; mixing keys across semaphore plugins.","solutions":["Verify the writer path encodes the middle segment as the literal \"queue\".","Filter keys with a cheap prefix/segment check before calling parse_key.","Search for any code building keys with a different second segment and fix or migrate it."],"exampleFix":"// before\nfor key in all_keys { let p = PermitKey::parse_key(&key)?; }\n// after\nfor key in all_keys.filter(|k| k.contains(\"/queue/\")) { let p = PermitKey::parse_key(&key)?; }","handlingStrategy":"validation","validationCode":"if !key.contains(\"/queue/\") { return skip(); }","typeGuard":"fn is_queue_key(key: &str) -> bool { key.split('/').nth_from_end(2) == Some(\"queue\") }","tryCatchPattern":"PermitKey::parse_key(key).map_err(|e| if msg_contains(&e, \"'queue'\") { warn_skip(key) } else { e.into() })?","preventionTips":["Keep one encoder for all keys in the semaphore plugin","Scan-and-parse loops should filter on the 'queue' segment","Add a round-trip test (to_key -> parse_key) to catch encoding drift"],"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"}