Problem
When style_column raises, StylingAnalysis.style_columns (buckaroo/dataflow/styling_core.py:477-483) logs a warning and falls back to default_styling. The warning only goes to the Python logger (~/.buckaroo/logs/server.log for the server). Nothing in the column config sent to the frontend records that styling failed, so the browser UI, and callers that read initial_state off the websocket, can't tell a column that is plain obj on purpose from one whose styling code threw.
After #968 the failed column keeps its real header, so the table no longer looks broken, but the failure is now even easier to miss: one column quietly renders unstyled.
Suggested fix
Add an optional field to the column config, e.g. styling_error: str, set to f"{type(exc).__name__}: {exc}" in the except branch of style_columns. This needs:
- Python: add it as
NotRequired[str] to BaseColumnConfig / NormalColumnConfig / MultiIndexColumnConfig (styling_core.py:134-158).
- TS: add
styling_error?: string to BaseColumnConfig in packages/buckaroo-js-core/src/components/DFViewerParts/DFWhole.ts:176.
- Frontend: show it somewhere visible, e.g. a warning marker plus tooltip on the header. Make sure the field isn't passed through into the AG-Grid colDef.
The empty-col_meta pass during instantiation (len(col_meta) == 0 and len(cls.requires_summary) > 0) swallows its exception on purpose and should not set the field.
Context
Split out from the second suggestion in #966. The header fix is in #968.
Problem
When
style_columnraises,StylingAnalysis.style_columns(buckaroo/dataflow/styling_core.py:477-483) logs a warning and falls back todefault_styling. The warning only goes to the Python logger (~/.buckaroo/logs/server.logfor the server). Nothing in the column config sent to the frontend records that styling failed, so the browser UI, and callers that readinitial_stateoff the websocket, can't tell a column that is plainobjon purpose from one whose styling code threw.After #968 the failed column keeps its real header, so the table no longer looks broken, but the failure is now even easier to miss: one column quietly renders unstyled.
Suggested fix
Add an optional field to the column config, e.g.
styling_error: str, set tof"{type(exc).__name__}: {exc}"in theexceptbranch ofstyle_columns. This needs:NotRequired[str]toBaseColumnConfig/NormalColumnConfig/MultiIndexColumnConfig(styling_core.py:134-158).styling_error?: stringtoBaseColumnConfiginpackages/buckaroo-js-core/src/components/DFViewerParts/DFWhole.ts:176.The empty-
col_metapass during instantiation (len(col_meta) == 0 and len(cls.requires_summary) > 0) swallows its exception on purpose and should not set the field.Context
Split out from the second suggestion in #966. The header fix is in #968.