From a8f1b97edaf7c1dbe36f2fae6e5c6bccc1bab2f5 Mon Sep 17 00:00:00 2001 From: Carson Date: Wed, 14 Oct 2026 11:03:01 -0500 Subject: [PATCH 1/2] fix: remove dead Spec.layer_sql/stat_sql bindings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit These methods mirrored a vestigial Rust API. Since ggsql PR #82 (the scale-syntax rewrite, first released in v0.1.6), Spec::new() has populated the backing fields with `vec![None; ...]` — the methods have always returned None in every released crate. ggsql PR #569 (the dialect/SQL-construction centralization) removed them from the Rust API entirely, so they no longer compile against ggsql main. Nothing consumes them: the only usage in this repo was a smoke test asserting the calls don't crash, and querychat (R and Python) never calls them. Removing them restores forward-compatibility with ggsql main at zero functional cost. Verified by building and testing against both crates.io ggsql 0.5.2 and a local ggsql main checkout. --- src/lib.rs | 30 ------------------------------ tests/test_ggsql.py | 2 -- 2 files changed, 32 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index e1a4bc9..e559fe7 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1228,36 +1228,6 @@ impl PySpec { .transpose() } - /// Layer filter/source query, or None if using global data. - /// - /// Parameters - /// ---------- - /// index : int - /// The layer index (0-based). - /// - /// Returns - /// ------- - /// str | None - /// The filter SQL query, or None if the layer uses global data directly. - fn layer_sql(&self, index: usize) -> Option { - self.inner.layer_sql(index).map(|s| s.to_string()) - } - - /// Stat transform query, or None if no stat transform. - /// - /// Parameters - /// ---------- - /// index : int - /// The layer index (0-based). - /// - /// Returns - /// ------- - /// str | None - /// The stat transform SQL query, or None if no stat transform. - fn stat_sql(&self, index: usize) -> Option { - self.inner.stat_sql(index).map(|s| s.to_string()) - } - /// Validation warnings from preparation. /// /// Returns diff --git a/tests/test_ggsql.py b/tests/test_ggsql.py index 3d47051..9cb8f22 100644 --- a/tests/test_ggsql.py +++ b/tests/test_ggsql.py @@ -543,8 +543,6 @@ def test_can_introspect_spec(self): # Layer-specific accessors (may return None) _ = spec.layer_data(0) _ = spec.stat_data(0) - _ = spec.layer_sql(0) - _ = spec.stat_sql(0) class TestCustomReader: From 99a33fdc710a486bc05669482038755e4af5b9fe Mon Sep 17 00:00:00 2001 From: Carson Date: Wed, 14 Oct 2026 11:08:27 -0500 Subject: [PATCH 2/2] docs: changelog entry for Spec.layer_sql/stat_sql removal --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ab860a7..42ef58d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ - Enabled the crate's `spatial` feature, so `DRAW spatial` map layers now render through the Vega-Lite writer instead of raising "Spatial visualization requires the 'spatial' feature to be enabled". Spatial layers require DuckDB's `spatial` extension at runtime: ggsql issues `LOAD spatial` automatically but never `INSTALL` it, so run `INSTALL spatial` once per machine (e.g. via `DuckDBReader.execute_sql()`; the download is cached under `~/.duckdb/extensions`). Works with WKB geometry columns and the built-in `ggsql:world` dataset, including named map projections such as `PROJECT TO equal_earth`. +### Removed + +- Removed `Spec.layer_sql()` and `Spec.stat_sql()`. These mirrored a vestigial Rust API that returned `None` in every released crate since v0.1.6 (the backing fields were never populated after the scale-syntax rewrite) and was removed upstream in ggsql PR #569. No functionality is lost. + ### Changed - Data now crosses the Python↔Rust boundary via the zero-copy Arrow C Data Interface instead of Arrow IPC serialization, reducing memory copies and peak RSS for large results (on a 1M-row × 50-col register+read microbenchmark: ~5.7× faster, ~1 GB lower peak RSS). Set `GGSQL_ARROW_IPC=1` to restore the previous IPC behavior. The minimum pyarrow version is now 15.