Fix missing feature gates - #545
Open
teunbrand wants to merge 2 commits into
Open
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.