{"record":{"id":"7e40794a0f2c6293","repo":"pathwaycom/pathway","slug":"datasink-not-supported","errorCode":null,"errorMessage":"datasink not supported","messagePattern":"datasink not supported","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"python/pathway/internals/graph_runner/operator_handler.py","lineNumber":211,"sourceCode":"        elif isinstance(datasink, CallbackDataSink):\n            self.scope.subscribe_table(\n                table=engine_table,\n                column_paths=column_paths,\n                on_change=datasink.on_change,\n                on_time_end=datasink.on_time_end,\n                on_end=datasink.on_end,\n                skip_persisted_batch=datasink.skip_persisted_batch,\n                skip_errors=datasink.skip_errors,\n                unique_name=datasink.unique_name,\n                sort_by_indices=datasink.sort_by_indices(table),\n            )\n        elif isinstance(datasink, ExportDataSink):\n            exported_table = self.scope.export_table(\n                table=engine_table, column_paths=column_paths\n            )\n            datasink.callback(self.scope, exported_table)\n        else:\n            raise RuntimeError(\"datasink not supported\")\n\n\nclass ContextualizedIntermediateOperatorHandler(\n    OperatorHandler[ContextualizedIntermediateOperator],\n    operator_type=ContextualizedIntermediateOperator,\n):\n    def _run(\n        self,\n        operator: ContextualizedIntermediateOperator,\n        output_storages: dict[Table, Storage],\n    ):\n        for table in operator.intermediate_and_output_tables:\n            context = table._id_column.context\n            evaluator_cls = ExpressionEvaluator.for_context(context)\n            output_storage = output_storages[table]\n            evaluator = evaluator_cls(\n                context, self.scope, self.state, self.scope_context\n            )","sourceCodeStart":193,"sourceCodeEnd":229,"githubUrl":"https://github.com/pathwaycom/pathway/blob/fa2f74a4649b7c5908690cf60137263d8d80de5f/python/pathway/internals/graph_runner/operator_handler.py#L193-L229","documentation":"OutputOperatorHandler lowers each output operator to an engine sink and recognizes a fixed set of datasink types (persisted sinks, exports, etc.). Unknown datasink objects fall through to RuntimeError('datasink not supported') — the mirror of the datasource error, hit when a custom or unrecognized DataSink type is attached to the graph.","triggerScenarios":"Attaching a custom DataSink subclass to pw.io without a corresponding handler; version skew where a datasink class exists but this build's handler list lacks its branch; constructing sinks via internal APIs not meant for direct use.","commonSituations":"Custom output integrations implemented by subclassing internals instead of using the python/callback sink APIs; stale virtualenvs after upgrade; experimental sinks copied between Pathway versions.","solutions":["Use the supported sink extension point — pw.io.python's write side or pw.io._internal apprehendable callback sinks — rather than subclassing DataSink","If subclassing is required, verify your Pathway version's OutputOperatorHandler handles your sink type and update the subclass to a supported base class","Align versions: reinstall/pin the same pathway version that introduced your sink class so class and handler match"],"exampleFix":"// before\nclass MySink(pathway.internals.datasinks.DataSink):\n    ...\npw.io._internal.write(table, MySink())  # no handler -> error\n// after\n@pw.io.pythonConnector\nclass MyWriter:\n    def on_change(self, key, row, time, is_add): ...\n    def on_end(self): ...\n\npw.io.python.write(table, MyWriter())","handlingStrategy":"type-guard","validationCode":"KNOWN_SINKS = {'PersistedDataSink', 'ExportDataSink', 'DataSink'}\n\ndef sink_type_name(sink) -> str:\n    return type(sink).__name__\n\nassert sink_type_name(sink) in KNOWN_SINKS","typeGuard":"def is_supported_datasink(sink) -> bool:\n    return type(sink).__name__ in {'DataSink', 'ExportDataSink', 'PersistedDataSink'}","tryCatchPattern":"try:\n    build_graph()\nexcept RuntimeError as e:\n    if \"datasink not supported\" in str(e):\n        # replace custom sink with a pw.io python writer callback and rebuild\n        ...","preventionTips":["Implement outputs via supported writer/callback APIs, not DataSink subclasses","Keep pathway version pinned and consistent across environments","Smoke-test the full graph build in CI to catch unsupported sink types early"],"tags":["pathway","datasink","custom-connector","internals","output"],"backgroundTag":null,"analyzedSha":"fa2f74a4649b7c5908690cf60137263d8d80de5f","analyzedAt":"2026-08-15T01:48:17.006Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}