Skip to content

Fix missing feature gates - #545

Open
teunbrand wants to merge 2 commits into
posit-dev:mainfrom
teunbrand:fix_feature_combination_failurs
Open

Fix missing feature gates#545
teunbrand wants to merge 2 commits into
posit-dev:mainfrom
teunbrand:fix_feature_combination_failurs

Conversation

@teunbrand

Copy link
Copy Markdown
Collaborator

Stumbled on a small part of this in unrelated work, decided to tackle this first, which then blew up to a whole bunch of tests that didn't have the feature gates sets correctly. Mostly discovered through --no-default-features + particular combinations of features.

Eight tests in src/reader/mod.rs use the `ggsql:penguins` builtin dataset without
being gated on `builtin-data`, and three tests in
src/writer/vegalite/projection/map.rs assert on WKT-derived geoshape layers
without being gated on `spatial`. Both features are on by default, so the gaps
were invisible until `cargo test -p ggsql --no-default-features --features
"duckdb,vegalite"` — the exact combination src/CLAUDE.md documents as a testing
example — was run, which failed all 11.
Checking a broader set of --no-default-features combinations (single
reader + single writer, and the exact feature sets ggsql-wasm and
ggsql-jupyter declare) surfaced two more gaps beyond the previous fix:
tests asserting on `builtin-data`/`spatial` output without gating on
them (src/reader/mod.rs, src/writer/hephaestus/mod.rs), and tests that
fail to *compile* because they hardcode DuckDBReader or VegaLiteWriter
in a build that has neither (src/plot/layer/geom/{density,smooth,violin}.rs,
src/writer/vegalite/{layer,mod}.rs, src/reader/{sqlite,data}.rs). Also
swaps a test-only dialect stub in coord/map.rs from duckdb::DuckDbDialect
to the feature-independent AnsiDialect, since those tests never execute
real SQL and gained nothing from the duckdb dependency.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant