Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

styling: no runtime validation of column configs — unknown displayer or color_rule fails silently in the browser

Aperta
#976 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
49/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
python, typescript
Ambito
data, frontend

Direzione di ricerca

Start with style_columns and the TypedDicts in styling_core.py:60-158, then trace the supported names through Displayer.ts:302 and Styler.tsx:163. Check how the column config and dataframe are available during styling. Done means invalid names or missing referenced columns fall back to the parent style, with tests covering those cases and how Python and TypeScript name lists stay aligned.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Problem

A styling class can return a column config that is structurally a dict, passes every Python check, and is still wrong: a displayer name that no JS displayer implements, a color_rule that getStyler doesn't handle, or a val_column / exist_column naming a column that isn't in the frame. Nothing validates it on the way out. The TypedDicts in styling_core.py:60-158 are annotations only — no runtime check — and the TS types on the other side (DFWhole.ts:176) are erased at build time.

The failure is then silent or misleading:

  • unknown displayer: getBaseFormatter (Displayer.ts:302) falls through to default: and formats the column as a string, so a numeric column silently loses its formatting.
  • unknown color_rule: getStyler (Styler.tsx:163) has no default branch and returns undefined, so the column just isn't colored.
  • val_column / exist_column pointing at a missing column: the rule runs against data that isn't there.

The MRO fallback added in #968 doesn't help with any of these, because nothing raises. #971 (reporting styling exceptions) doesn't either, for the same reason.

Impact

This is the remaining hole in "a user's styling subclass can't break the table." Exceptions are handled; configs that are well-formed but meaningless are not. The typo cases ('flaot', 'color_statik') are the common ones, and they present as "my formatting/color setting doesn't do anything" with nothing in the logs.

Suggested fix

Validate each column config in style_columns after it's built, before it goes on the wire:

  • displayer_args['displayer'] is one of the known displayer names.
  • color_map_config['color_rule'] is one of the rules getStyler implements.
  • any val_column / exist_column exists in the frame (style_columns already has df).

A failed check should be treated like an exception from style_column: fall back to the parent class for that column, and, once #971 lands, record the reason on the column so it's visible in the UI.

Keeping the name lists in sync between Python and TS is the part worth thinking about — one generated list, or a test that asserts the Python literals match the switch cases in Displayer.ts / Styler.tsx.

Context

Came out of reviewing #968. Related: #966 (headers lost on a styling exception, fixed in #968), #971 (surface styling exceptions in the column config).

Lingua principale
Python
Stelle
685
Fork
17
Merge medio
23h 34m
PR unite (30g)
24

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di buckaroo-data/buckaroo

Tutte le issue di buckaroo-data/buckaroo

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.