{"record":{"id":"e89752bb1d9342ef","repo":"perspective-dev/perspective","slug":"table-name-not-set-in-model","errorCode":null,"errorMessage":"table_name not set in model","messagePattern":"table_name not set in model","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/anywidget/src/js/index.js","lineNumber":130,"sourceCode":"        },\n        () => {\n            model.send({ type: \"hangup\", client_id }, null);\n        },\n    );\n\n    const on_custom_msg = (msg, buffers) => {\n        if (msg.type === \"binary_msg\" && msg.client_id === client_id) {\n            const [dataview] = buffers;\n            psp_client.handle_response(dataview.buffer);\n        }\n    };\n    model.on(\"msg:custom\", on_custom_msg);\n    model.send({ type: \"connect\", client_id }, null);\n\n    const binding_mode = model.get(\"binding_mode\");\n    const table_name = model.get(\"table_name\");\n    if (!table_name) {\n        throw new Error(\"table_name not set in model\");\n    }\n\n    const table_promise = psp_client.open_table(table_name).then(async (t) => {\n        if (binding_mode === \"client-server\") {\n            const local_client = await perspective.worker();\n            const remote_view = await t.view();\n            return await local_client.table(remote_view);\n        } else if (binding_mode === \"server\") {\n            return t;\n        } else {\n            throw new Error(`unknown binding mode: ${binding_mode}`);\n        }\n    });\n\n    // The viewer's `load()` also accepts a `Client` (with `table` naming the\n    // binding in `ViewerConfig`) since the workspace->viewer merge, but the\n    // single-table widget loads a `Table` directly and treats `table_name` as\n    // the source of truth. The config's derived `table` field therefore has no","sourceCodeStart":112,"sourceCodeEnd":148,"githubUrl":"https://github.com/perspective-dev/perspective/blob/11c8238c0c9c0b9e490b5a6a2dc277afad1e980a/packages/anywidget/src/js/index.js#L112-L148","documentation":"The anywidget render() function reads the `table_name` trait from the Jupyter model before establishing the Perspective client-server connection; a falsy (missing/empty) value means the Python side never set the trait, so no table can be opened. This is a fail-fast guard on required widget state.","triggerScenarios":"Thrown at packages/anywidget/src/js/index.js:130 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set the `table_name` attribute on the Python PerspectiveWidget before the frontend render (e.g. widget.table_name = \"my_table\")","Verify the Python model's trait defaults include a valid table name for the binding_mode in use","Log model.get(\"table_name\") in the notebook to confirm what the kernel is sending"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"11c8238c0c9c0b9e490b5a6a2dc277afad1e980a","analyzedAt":"2026-09-09T00:35:19.377Z","contentChangedAt":"2026-09-09T00:35:19.377Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}