{"record":{"id":"b6a103aaa340a6bb","repo":"pathwaycom/pathway","slug":"not-supported-type-of-debug-data","errorCode":null,"errorMessage":"not supported type of debug data","messagePattern":"not supported type of debug data","errorType":"exception","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"python/pathway/internals/datasource.py","lineNumber":135,"sourceCode":"class ImportDataSource(DataSource):\n    callback: Callable[[api.Scope], api.ExportedTable]\n\n    def is_bounded(self) -> bool:\n        return False\n\n    def is_append_only(self) -> bool:\n        return False\n\n\ndef debug_datasource(debug_data) -> StaticDataSource | None:\n    if debug_data is None:\n        return None\n    elif isinstance(debug_data, pd.DataFrame):\n        return PandasDataSource(\n            data=debug_data.copy(), schema=schema_from_pandas(debug_data)\n        )\n    else:\n        raise TypeError(\"not supported type of debug data\")\n\n\n@dataclass(frozen=True)\nclass ErrorLogDataSource(DataSource):\n    def is_bounded(self) -> bool:\n        return False\n\n    def is_append_only(self) -> bool:\n        return True\n","sourceCodeStart":117,"sourceCodeEnd":145,"githubUrl":"https://github.com/pathwaycom/pathway/blob/fa2f74a4649b7c5908690cf60137263d8d80de5f/python/pathway/internals/datasource.py#L117-L145","documentation":"pw.debug.table_from_markdown / debug_datasource accepts only None or a pandas DataFrame as inline debug data. Passing any other type (list of tuples, dict, markdown string, csv string) raises TypeError at graph-build time, because only the pandas path is implemented.","triggerScenarios":"pw.debug.table_from_markdown(\"a|b\\n1|2\") misused through APIs that route to debug_datasource with a raw string or list; internal calls in pw.debug helpers when given a non-DataFrame, non-None payload.","commonSituations":"Using pw.debug functions with non-pandas inputs; library-level code calling table_from_markdown/debug from dict or list data in newer versions where routing changed.","solutions":["Convert your data to a pandas DataFrame first: pd.DataFrame(rows, columns=[...]).","Use the intended debug helpers for markdown: pw.debug.table_from_markdown('''a\\nb''') rather than passing through lower-level APIs.","Pass None explicitly when no debug data is wanted."],"exampleFix":"# before\nrows = [(\"a\", 1), (\"b\", 2)]\nt = pw.debug.table_from_rows_like_debug(rows)  # wrong type reaches debug_datasource\n\n# after\nimport pandas as pd\ndf = pd.DataFrame(rows, columns=[\"name\", \"val\"])\nt = pw.debug.table_from_pandas(df)","handlingStrategy":"type-guard","validationCode":"import pandas as pd\nassert debug_data is None or isinstance(debug_data, pd.DataFrame), 'debug data must be None or a pandas DataFrame'","typeGuard":"import pandas as pd\n\ndef debug_data_valid(d) -> bool:\n    return d is None or isinstance(d, pd.DataFrame)","tryCatchPattern":null,"preventionTips":["Convert raw rows to pd.DataFrame before feeding debug APIs.","Use the specific pw.debug.table_from_markdown / table_from_pandas helpers."],"tags":["pathway","debug","type-error","developer-tooling"],"backgroundTag":null,"analyzedSha":"fa2f74a4649b7c5908690cf60137263d8d80de5f","analyzedAt":"2026-08-15T01:48:17.006Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}