styling: no runtime validation of column configs — unknown displayer or color_rule fails silently in the browser
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
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 todefault: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 returnsundefined, so the column just isn't colored. val_column/exist_columnpointing 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 rulesgetStylerimplements.- any
val_column/exist_columnexists in the frame (style_columnsalready hasdf).
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
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di buckaroo-data/buckaroo
-
Histograms JS
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
buckaroo-data/buckaroo#1089 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Histograms
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
buckaroo-data/buckaroo#1087 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Histograms
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
buckaroo-data/buckaroo#1086 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Histograms
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
buckaroo-data/buckaroo#1083 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Histograms
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
buckaroo-data/buckaroo#1082 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di buckaroo-data/buckaroo
Issue simili
-
request-theme
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 66/100
LizardByte/ThemerrDB#9575 ·
I maintainer di solito rispondono entro 1 giorno
-
Author Page: noshin-nawalApertaauthor-page correction
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
acl-org/acl-anthology#10599 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
zilliztech/memsearch#818 ·
I maintainer di solito rispondono entro 1 giorno
-
[FAQ] Commit ID for ProjectsForse già presa @github-actions l’ha presa oggi. Apertafaq-proposal
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 84/100
DataTalksClub/faq#503 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
README.zh-CN/ja/es still hard-code 501 test counts after README.md went count-freeForse già presa @Aaqibhafeezkhan l’ha presa oggi. Apertabeginner documentation good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
BistaDinesh03/critique#164 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno