Skip to content

A data-mapped scalar aesthetic on boxplot / violin is dropped by the stat, then fails validation #514

Description

@thomasp85

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions