Summary
The boxplot / violin stat drops non-grouping aesthetic columns from its output, so a mapped scalar aesthetic fails validation after the stat has run, with an error that names an internal column list. Grouping aesthetics (fill, stroke) survive because they partition the summary; scalar ones (linewidth, size, linetype, opacity) do not.
Reproduction
VISUALISE species AS x, body_mass AS y, bill_len AS linewidth FROM ggsql:penguins
DRAW boxplot
Failed to generate Vega-Lite output: Validation error: Column 'linewidth' referenced in
aesthetic 'linewidth' (layer 1 (global data)) does not exist.
Available columns: __ggsql_aes_pos1__, __ggsql_aes_type__, __ggsql_aes_pos2__, and __ggsql_aes_pos2end__
Control — the same query with sex AS fill renders fine.
Expected
Either carry a scalar aesthetic through the stat (it is constant within a group whenever it is part of the grouping, and otherwise needs a documented aggregate), or fail with an error that names the actual constraint ("aesthetic linewidth cannot be mapped on a boxplot layer") rather than leaking __ggsql_aes_* columns to the user.
Summary
The boxplot / violin stat drops non-grouping aesthetic columns from its output, so a mapped scalar aesthetic fails validation after the stat has run, with an error that names an internal column list. Grouping aesthetics (
fill,stroke) survive because they partition the summary; scalar ones (linewidth,size,linetype,opacity) do not.Reproduction
Control — the same query with
sex AS fillrenders fine.Expected
Either carry a scalar aesthetic through the stat (it is constant within a group whenever it is part of the grouping, and otherwise needs a documented aggregate), or fail with an error that names the actual constraint ("aesthetic
linewidthcannot be mapped on aboxplotlayer") rather than leaking__ggsql_aes_*columns to the user.