{"record":{"id":"a201ff29e9c6f8c2","repo":"pathwaycom/pathway","slug":"cannot-plot-diff-table-in-a-static-mode","errorCode":null,"errorMessage":"Cannot plot diff table in a static mode","messagePattern":"Cannot plot diff table in a static mode","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"warning","filePath":"python/pathway/stdlib/viz/table_viz.py","lineNumber":124,"sourceCode":"        disabled=True,\n        show_index=False,\n        height=table_height,\n        sorters=sorters,\n        pagination=\"local\",\n        page_size=page_size,\n        sizing_mode=\"stretch_width\",\n    )\n\n    def color_negative_red(row):\n        color = \"red\" if row[\"diff\"] < 0 else \"green\"\n        return [f\"color: {color}\" for _ in row]\n\n    if not snapshot:\n        dynamic_table.style.apply(color_negative_red, axis=1)  # type:ignore[union-attr]\n\n    if bounded:\n        if not snapshot:\n            raise NotImplementedError(\n                \"Cannot plot diff table in a static mode\"\n            )  # todo: implement with support for _time and _diff\n        [captured] = gr.run_tables(self)\n        output_data = api.squash_updates(captured)\n        keys = list(output_data.keys())\n        dict_data = {\n            name: [_format_types(output_data[key][index]) for key in keys]\n            for index, name in enumerate(self._columns.keys())\n        }\n        dynamic_table.value = pd.DataFrame(dict_data)\n    else:\n        integrated = {}\n\n        def update(key, row, time, is_addition):\n            row[\"id\"] = key\n            if not snapshot:\n                row[\"time\"] = time\n                row[\"diff\"] = is_addition * 2 - 1","sourceCodeStart":106,"sourceCodeEnd":142,"githubUrl":"https://github.com/pathwaycom/pathway/blob/fa2f74a4649b7c5908690cf60137263d8d80de5f/python/pathway/stdlib/viz/table_viz.py#L106-L142","documentation":"The visualization helper for Pathway tables supports two rendering modes: a dynamic Bokeh view over updating tables and a static snapshot view. When bounded=True (diff-friendly rendering with _time/_diff handling) is combined with snapshot=True (static mode), the code explicitly raises NotImplementedError because static rendering of diff tables (with _diff coloring) is not implemented.","triggerScenarios":"Calling the table viz/plot API with bounded=True and snapshot=True on a table that produces diffs; using a static export helper (e.g. for docs/notebooks) on a table observed with updates; a wrapper that defaults to snapshot=True while the plot path defaults to bounded=True.","commonSituations":"Exporting pipeline state to a static HTML/screenshot where the code path chose diff-aware rendering; upgrading Pathway so viz defaults changed (snapshot for non-bokeh environments like CI headless rendering); plotting a table from an updating connector with the bounded flag copied from example code.","solutions":["Set snapshot=False to render the dynamic diff-aware view","Or keep snapshot=True but plot a non-diff (squashed/integrated) representation: materialize the table first (e.g. via pw.debug.compute_and_print-style capture or an io connector) and plot that snapshot table without bounded=True","Check the viz call signature for your Pathway version; pass bounded/snapshot explicitly rather than relying on defaults"],"exampleFix":"# before\nviz(table, snapshot=True, bounded=True)  # NotImplementedError\n\n# after\nviz(table, snapshot=False, bounded=True)  # dynamic diff view","handlingStrategy":"validation","validationCode":"assert not (snapshot and bounded), 'diff-aware bounded rendering is unsupported in static snapshot mode; use snapshot=False'","typeGuard":null,"tryCatchPattern":"try:\n    viz(table, snapshot=True, bounded=True)\nexcept NotImplementedError:\n    viz(table, snapshot=False, bounded=True)","preventionTips":["Pass snapshot/bounded explicitly instead of relying on defaults","For static exports, plot a captured/squashed table without bounded=True","Watch release notes when viz defaults change between Pathway versions"],"tags":["pathway","visualization","not-implemented","static-export"],"backgroundTag":null,"analyzedSha":"fa2f74a4649b7c5908690cf60137263d8d80de5f","analyzedAt":"2026-08-15T01:48:17.006Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}