Skip to content

Commit 38c33cf

Browse files
authored
fix: remove dead Spec.layer_sql/stat_sql bindings (#15)
* fix: remove dead Spec.layer_sql/stat_sql bindings 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. * docs: changelog entry for Spec.layer_sql/stat_sql removal
1 parent 6d4859f commit 38c33cf

3 files changed

Lines changed: 4 additions & 32 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
- 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`.
88
- New `CachingReader.execute_sql_cached()` method that runs SQL on the reader's private in-memory cache connection — the compute surface where all ggsql-generated derived SQL executes — instead of the primary data source. This is the surface for per-connection setup that derived SQL depends on: e.g. `INSTALL`/`LOAD` of DuckDB extensions such as `spatial`, which would fail on a locked-down primary and take no effect on the cache even where it succeeds.
99

10+
### Removed
11+
12+
- 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.
13+
1014
### Changed
1115

1216
- 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.

‎src/lib.rs‎

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1255,36 +1255,6 @@ impl PySpec {
12551255
.transpose()
12561256
}
12571257

1258-
/// Layer filter/source query, or None if using global data.
1259-
///
1260-
/// Parameters
1261-
/// ----------
1262-
/// index : int
1263-
/// The layer index (0-based).
1264-
///
1265-
/// Returns
1266-
/// -------
1267-
/// str | None
1268-
/// The filter SQL query, or None if the layer uses global data directly.
1269-
fn layer_sql(&self, index: usize) -> Option<String> {
1270-
self.inner.layer_sql(index).map(|s| s.to_string())
1271-
}
1272-
1273-
/// Stat transform query, or None if no stat transform.
1274-
///
1275-
/// Parameters
1276-
/// ----------
1277-
/// index : int
1278-
/// The layer index (0-based).
1279-
///
1280-
/// Returns
1281-
/// -------
1282-
/// str | None
1283-
/// The stat transform SQL query, or None if no stat transform.
1284-
fn stat_sql(&self, index: usize) -> Option<String> {
1285-
self.inner.stat_sql(index).map(|s| s.to_string())
1286-
}
1287-
12881258
/// Validation warnings from preparation.
12891259
///
12901260
/// Returns

‎tests/test_ggsql.py‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -543,8 +543,6 @@ def test_can_introspect_spec(self):
543543
# Layer-specific accessors (may return None)
544544
_ = spec.layer_data(0)
545545
_ = spec.stat_data(0)
546-
_ = spec.layer_sql(0)
547-
_ = spec.stat_sql(0)
548546

549547

550548
class TestCustomReader:

0 commit comments

Comments
 (0)