{"record":{"id":"4e5a30dbe104394d","repo":"pathwaycom/pathway","slug":"datasource-not-supported","errorCode":null,"errorMessage":"datasource not supported","messagePattern":"datasource not supported","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"python/pathway/internals/graph_runner/operator_handler.py","lineNumber":165,"sourceCode":"                materialized_table = self.scope.empty_table(\n                    datasource.connector_properties\n                )\n                self.state.set_table(output_storages[table], materialized_table)\n        elif isinstance(datasource, ImportDataSource):\n            for table in operator.output_tables:\n                assert table.schema is not None\n                exported_table = datasource.callback(self.scope)\n                materialized_table = self.scope.import_table(exported_table)\n                self.state.set_table(output_storages[table], materialized_table)\n        elif isinstance(datasource, ErrorLogDataSource):\n            for table in operator.output_tables:\n                (materialized_table, error_log) = self.scope.error_log(\n                    properties=datasource.connector_properties\n                )\n                self.state.set_table(output_storages[table], materialized_table)\n                self.state.set_error_log(table, error_log)\n        else:\n            raise RuntimeError(\"datasource not supported\")\n\n\nclass OutputOperatorHandler(\n    OperatorHandler[OutputOperator], operator_type=OutputOperator\n):\n    def _run(\n        self,\n        operator: OutputOperator,\n        output_storages: dict[Table, Storage],\n    ):\n        datasink = operator.datasink\n        table = operator.table\n        input_storage = self.state.get_storage(table._universe)\n        engine_table = self.state.get_table(table._universe)\n        column_paths = [\n            input_storage.get_path(column) for column in table._columns.values()\n        ]\n","sourceCodeStart":147,"sourceCodeEnd":183,"githubUrl":"https://github.com/pathwaycom/pathway/blob/fa2f74a4649b7c5908690cf60137263d8d80de5f/python/pathway/internals/graph_runner/operator_handler.py#L147-L183","documentation":"InputOperatorHandler knows how to run a fixed set of datasource types (debug datasources, PandasDataSource, callbacks, ErrorLogDataSource, etc.). The final else branch raises RuntimeError('datasource not supported') for any datasource object that is none of them — typically a custom DataSource subclass missing its dedicated handler or a version/registration mismatch.","triggerScenarios":"Defining a custom DataSource subclass and feeding it into the graph without registering a matching OperatorHandler; passing an internal datasource type your Pathway version's handler set does not include (e.g. after upgrading, a renamed datasource class); mixing datasource classes across Pathway versions in one process.","commonSituations":"Building custom connectors by copying internal classes; monkey-patching or subclassing internal datasources; running partially-upgraded installations where a datasource class exists but its handler does not.","solutions":["Prefer the supported extension points (pw.io connectors, the python connector / callback APIs) instead of subclassing internals directly","If you subclass deliberately, check isinstance coverage in your Pathway version's operator_handler.py and implement/hand off to the appropriate handler","Reinstall/pin one consistent Pathway version (pip install pathway==X.Y.Z) so datasource and handler classes always ship together"],"exampleFix":"// before\nclass MySource(pathway.internals.datasource.DataSource):\n    ...\ntable = pw.io.python.read(MySource(), schema=S)  # no handler -> error\n// after\n@pw.io.pythonConnector\n# or: implement the supported python connector interface\ndef run(callback):\n    for row in my_rows():\n        callback(**row)\n\ntable = pw.io.python.read(run, schema=S)","handlingStrategy":"type-guard","validationCode":"from pathway.internals.graph_runner.operator_handler import OperatorHandler\nSUPPORTED = tuple(h for h in OperatorHandler.__subclasses__())\n\ndef has_input_handler(datasource) -> bool:\n    return type(datasource).__name__ in {\n        'PandasDataSource', 'ErrorLogDataSource', 'DataSource',\n    }","typeGuard":"def is_supported_datasource(ds) -> bool:\n    return type(ds).__name__ in {'DataSource', 'PandasDataSource', 'ErrorLogDataSource', 'DebugDataSource'}","tryCatchPattern":"try:\n    build_graph()\nexcept RuntimeError as e:\n    if \"datasource not supported\" in str(e):\n        # switch custom source to pw.io.python connector API and rebuild\n        ...","preventionTips":["Use documented connector APIs (pw.io.python read side) instead of subclassing internals","Pin a single pathway version across the project","Re-check internal class names after every Pathway upgrade"],"tags":["pathway","datasource","custom-connector","internals","version-mismatch"],"backgroundTag":null,"analyzedSha":"fa2f74a4649b7c5908690cf60137263d8d80de5f","analyzedAt":"2026-08-15T01:48:17.006Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}