What happened?
Three chart settings take a colour but are declared as plain strings, so the schema is {"type":"string"} with no pattern and the form renders a free-text box. What is legal is stated only in @JsonPropertyDescription("must be a valid CSS color or hex color string").
| Operator |
Setting |
Reaches plotly as |
LineChartOpDesc (LineConfig) |
Line Color |
line={'color': …} on go.Scatter |
ContinuousErrorBandsOpDesc (BandConfig) |
Fill Color, plus the inherited Line Color |
fillcolor=… |
FigureFactoryTableOpDesc |
Font Color |
font_colors=[…] on ff.create_table |
Generating each module from main and executing it: red renders; #ggg and 1 fail with ValueError: Invalid value of type 'builtins.str' received for the 'color' property of scatter.line; nosuchcolor fails the same way on the table's font. Nothing checks the value before the run, and the error names a plotly property rather than the field the user filled in.
Expected: the field states what it accepts in a way the form can enforce. An enum will not do — plotly takes 3- and 6-digit hex, rgb/rgba/hsl/hsla/hsv/hsva, var(--…) and 148 CSS names — but a pattern derived from ColorValidator in _plotly_utils/basevalidators.py covers all of those and rejects the values above. Empty should stay legal: every one of these paths omits the colour argument when the field is blank.
How to reproduce?
- Chain a source with two numeric columns into Line Chart and configure one line.
- Type
#ggg into that line's Line Color.
- Run — the operator fails with the error below;
red succeeds.
Version/Branch
1.3.0-incubating-SNAPSHOT (main)
Relevant log output
ValueError: Invalid value of type 'builtins.str' received for the 'color' property of scatter.line
Received value: '#ggg'
What happened?
Three chart settings take a colour but are declared as plain strings, so the schema is
{"type":"string"}with nopatternand the form renders a free-text box. What is legal is stated only in@JsonPropertyDescription("must be a valid CSS color or hex color string").LineChartOpDesc(LineConfig)line={'color': …}ongo.ScatterContinuousErrorBandsOpDesc(BandConfig)fillcolor=…FigureFactoryTableOpDescfont_colors=[…]onff.create_tableGenerating each module from
mainand executing it:redrenders;#gggand1fail withValueError: Invalid value of type 'builtins.str' received for the 'color' property of scatter.line;nosuchcolorfails the same way on the table's font. Nothing checks the value before the run, and the error names a plotly property rather than the field the user filled in.Expected: the field states what it accepts in a way the form can enforce. An
enumwill not do — plotly takes 3- and 6-digit hex,rgb/rgba/hsl/hsla/hsv/hsva,var(--…)and 148 CSS names — but apatternderived fromColorValidatorin_plotly_utils/basevalidators.pycovers all of those and rejects the values above. Empty should stay legal: every one of these paths omits the colour argument when the field is blank.How to reproduce?
#ggginto that line's Line Color.redsucceeds.Version/Branch
1.3.0-incubating-SNAPSHOT (main)
Relevant log output