Skip to content

Commit c481831

Browse files
committed
Merge remote-tracking branch 'origin/main' into HEAD
# Conflicts: # tests/e2e/src/sqlbuild/cli/commands/main/build/no_tests_no_audits/test_build_no_tests_no_audits.py
2 parents ebe1b7a + b4b19c8 commit c481831

90 files changed

Lines changed: 2328 additions & 437 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.release-please-manifest.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "0.223.0"
2+
".": "0.224.0"
33
}

‎CHANGELOG.md‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,22 @@
11
# Changelog
22

3+
## [0.224.0](https://github.com/sqlstack-io/sqlbuild/compare/v0.223.0...v0.224.0) (2026-11-14)
4+
5+
6+
### ⚠ BREAKING CHANGES
7+
8+
* **server:** --launchers, --oidc-config and --trusted-proxy-config are replaced by sqb server --config server.toml with [[launchers.docker]], [[launchers.local]], [oidc] and [trusted_proxy] sections. The old flags fail with a pointer to --config.
9+
10+
### Features
11+
12+
* publish Python nodes for jobs, roles and server runs ([#1472](https://github.com/sqlstack-io/sqlbuild/issues/1472)) ([2909eda](https://github.com/sqlstack-io/sqlbuild/commit/2909edafaac51adc6dee780105f018fa60d1f390))
13+
* **server:** configure the server with server.toml and run workers on Podman ([#1470](https://github.com/sqlstack-io/sqlbuild/issues/1470)) ([88cbbd1](https://github.com/sqlstack-io/sqlbuild/commit/88cbbd1cc5339bbb4813855df78e5bc5fb0719b3))
14+
15+
16+
### Bug Fixes
17+
18+
* **worker:** fail a function whose unit test fails, and name it on downstream skips ([#1471](https://github.com/sqlstack-io/sqlbuild/issues/1471)) ([4502c30](https://github.com/sqlstack-io/sqlbuild/commit/4502c306ff68aad46bc882891a4852c7d0f637a5))
19+
320
## [0.223.0](https://github.com/sqlstack-io/sqlbuild/compare/v0.222.0...v0.223.0) (2026-11-14)
421

522

‎Cargo.lock‎

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎benchmarks/duckshop/README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ function, a hook-created JavaScript function, 192 unit tests and 4 scenarios, in
136136
| Ordering, numbers and text | NULL ordering under `DESC`; ties in ordered aggregates, `MAX_BY`, `MODE` and `ANY_VALUE`; default window frames; `UNION ALL BY NAME`; `ROUND` half-way values, decimal division, `MOD` and 38-digit amounts; integers past 2^53 against `FLOAT`; regular expressions and backslash escapes; `LIKE ... ESCAPE` and `ILIKE ANY`; `SPLIT_PART` and `SUBSTR` before the start; `NOT IN` with a NULL; names in many scripts; `JOIN ... USING` between `NUMBER(18,0)`, `NUMBER(38,0)` and text keys, with the types of the merged and qualified keys; NULL arithmetic and the types of NULL, decimal and exponent literals, `COUNT`, `ROW_NUMBER`, `%` and `NULLIF`; `MEDIAN` at scales 0 to 15; `DIV0` by literal zeros; `MODE`, `MEDIAN` and `COUNT_IF` over no rows; aggregates inside window functions and `QUALIFY`; `ROLLUP` totals; `TRUNC` of `FLOAT`; infinity words in other scripts; `CASE` without `ELSE` and `DECODE` over text; regular expressions with a `?` after a lazy quantifier, classes opening with `]`, empty matches and `.` against a carriage return; case-insensitive matches outside ASCII; `ILIKE` with a long s; `JAROWINKLER_SIMILARITY` of accented names in both cases; Base64 text with line feeds; `STARTSWITH`, `ENDSWITH`, `SUBSTRING`, `POSITION` with `IN` and with a comma, `CHARINDEX`, `CHR`, `REGEXP_SUBSTR_ALL`, `::STRING` and `CAST ... AS STRING`; `HEX_ENCODE`, `HEX_DECODE_STRING`, `TRY_HEX_DECODE_STRING` and `TRY_BASE64_DECODE_BINARY`; a comment attached to a text literal; `FLOOR` with and without a scale, `BITAND`, `ZEROIFNULL`, `::BIGINT` and `::DOUBLE`; `IS NOT DISTINCT FROM` and `EQUAL_NULL`; a comma join after an explicit join; `HASH_AGG` read in two row orders |
137137
| Lineage and analysis | clauses whose columns decide rows without being output (`WHERE`, `QUALIFY`, `GROUP BY` by position and `ALL`, `ORDER BY` under `LIMIT`, `EXISTS`, a `FLATTEN` input, `ROLLUP` by position, `EXCEPT` under `LIMIT`); `RIGHT JOIN ... USING`, `NATURAL JOIN`, a `USING` key under a later outer join, and unmatched `ASOF JOIN` rows; `CONNECT BY` beside a column named `level`; a recursive CTE without `RECURSIVE` whose columns shift per iteration; `LAST_DAY` with a date part; positional columns and the names Snowflake gives unaliased expressions; `TEXT(5)` and widened `COUNT` contracts; `LAG` and `LEAD` with one, two and three arguments; a comma-joined `LATERAL` whose nested derived table reads the left item; relations aliased `first` and `last`, one without `AS`, the words of Snowflake's read-order clauses; untyped and typed `FILTER` lambdas over `ARRAY_AGG` in a grouped query; column expression ranges in compiled SQL that SQL and Python macros, a variable and cursor bounds rewrote, and columns qualified by their reference call, whose ranges are dropped |
138138
| Python functions | volatile tokens and numbers from a column, a constant and no argument, and `DIV0` of a volatile call beside look-alike names, checked by assertions that hold for any values; a handler answering NULL input without `STRICT`; Python `None` as JSON null, and datetimes, Decimals and integers past 2^53 handed to `VARIANT` and `FLOAT` results |
139-
| Scenarios and lifecycle | typed values across model boundaries; `VARIANT` expected output; a star under a lower-case contract and a quoted camelCase export; a snapshot keyed and compared on quoted camelCase columns; a cursor-window incremental model over far-apart fixture loads; a change log merged across two loads, checked against a full rebuild |
139+
| Scenarios and lifecycle | typed values across model boundaries; `VARIANT` expected output; a star under a lower-case contract and a quoted camelCase export; a snapshot keyed and compared on quoted camelCase columns; a cursor-window incremental model over far-apart fixture loads; a change log merged across two loads, checked against a full rebuild, and a keyed cursor `delete_insert` copy of it whose rows move out of the window between loads |
140140
| Translation refusals | one model per construct that translation tools refuse or guard, most putting a construct refused only under strict checking before one refused by default, so a model shows both: `FLOAT` values through sums, averages, running totals, arrays, objects, `HASH`, `TO_CHAR` and `::NUMBER(38, 10)`; `VARIANT` dates, decimals and XML; `ARRAY_AGG` without `WITHIN GROUP`, sparse arrays and `ARRAY(NUMBER)` casts; `REDUCE`, `FILTER` and `TRANSFORM` lambdas; patterns and `REGEXP_REPLACE` replacements built from columns, and lazy patterns; `TRY_TO_DATE` with a format from a column; zoned literals, `CONVERT_TIMEZONE` from `CURRENT_TIMESTAMP`, `SEQ8`, `GENERATOR` with an expression `ROWCOUNT`; `PIVOT`, `ANY_VALUE`, `IGNORE NULLS` around `IFF`, unaliased columns read by Snowflake's name, `UNION` branches whose column is always NULL; `TO_NUMBER`, `TO_DECIMAL` and `TRY_BASE64_DECODE_BINARY`; an open (uncontracted) source `edge__supplier_notes`, the table function, read for one basket and after `LATERAL` for every basket, and the hook-created function. `rpt_edge_case_model_keys` and `rpt_edge_case_array_model_keys` read every model in the group, so a refusal there also refuses a downstream model |
141141

142142
Unit-test expectations in the edge-case area are captured on Snowflake under the `edge` target's

‎benchmarks/duckshop/RUNBOOK.md‎

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -196,21 +196,27 @@ every token being distinct.
196196

197197
`int_edge_delivery_status` merges a shipment delivery change log incrementally, and the
198198
`edge_delivery_status_matches_rebuild` audit fails if it differs from a rebuild from the whole log.
199-
To exercise the merge across loads, start without the table, load the first load only, build, then
200-
load everything and build again:
199+
`int_edge_delivery_status_replaced` copies it with a keyed cursor `delete_insert`, and its `unique`
200+
audit fails if a shipment's earlier row survives. To exercise both across loads, start without the
201+
tables, load the first load only, build, then load everything and build again:
201202

202203
```bash
203204
sqb query --target edge "DROP TABLE IF EXISTS <database>.<schema>.int_edge_delivery_status"
205+
sqb query --target edge "DROP TABLE IF EXISTS <database>.<schema>.int_edge_delivery_status_replaced"
204206
sqb load --target edge --select edge__delivery_updates --vars '{"edge_delivery_batch": "1"}'
205207
sqb build --target edge --no-load \
206-
--select int_edge_delivery_update_versions int_edge_delivery_status int_edge_delivery_status_rebuilt
208+
--select int_edge_delivery_update_versions int_edge_delivery_status int_edge_delivery_status_rebuilt \
209+
int_edge_delivery_status_replaced
207210
sqb load --target edge --select edge__delivery_updates
208211
sqb build --target edge --no-load \
209-
--select int_edge_delivery_update_versions int_edge_delivery_status int_edge_delivery_status_rebuilt
212+
--select int_edge_delivery_update_versions int_edge_delivery_status int_edge_delivery_status_rebuilt \
213+
int_edge_delivery_status_replaced
210214
```
211215

212216
The second build plans `int_edge_delivery_status` as a `merge` over the second load, which carries
213217
a late older version, a redelivered version, a delete and a new shipment, and the audit passes.
218+
It plans `int_edge_delivery_status_replaced` as a `delete_insert` that replaces each recomputed
219+
shipment by key, and its audits pass.
214220
Load with `sqb load` and build with `--no-load`, so that each build reads exactly the load you
215221
chose.
216222

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
MODEL (
2+
description """
3+
One row per shipment, copied from the merged delivery status by delete and insert. A shipment
4+
with a later version moves its source_loaded_at out of the window an earlier build wrote, so
5+
only its unique_key stops the later build from adding a second row for it.
6+
""",
7+
tags [edge_case],
8+
materialized incremental,
9+
incremental_strategy delete_insert,
10+
unique_key [shipment_id],
11+
cursor source_loaded_at,
12+
cursor_type timestamp,
13+
cursor_grain second,
14+
cursor_inputs (
15+
int_edge_delivery_status source_loaded_at,
16+
),
17+
columns (
18+
shipment_id (type VARCHAR, nullable false, audits [not_null, unique]),
19+
order_ref (type VARCHAR),
20+
delivery_status (type VARCHAR),
21+
ordered_on (type DATE),
22+
delivered_on (type DATE),
23+
is_deleted (type BOOLEAN),
24+
latest_seq (type NUMBER(38, 0)),
25+
source_loaded_at (type TIMESTAMP_NTZ, nullable false, audits [not_null]),
26+
),
27+
);
28+
29+
WITH final AS (
30+
SELECT
31+
s.shipment_id,
32+
s.order_ref,
33+
s.delivery_status,
34+
s.ordered_on,
35+
s.delivered_on,
36+
s.is_deleted,
37+
s.latest_seq,
38+
s.source_loaded_at
39+
FROM __ref("int_edge_delivery_status") AS s
40+
WHERE
41+
s.source_loaded_at >= __cursor_start()
42+
AND s.source_loaded_at < __cursor_end()
43+
)
44+
45+
SELECT *
46+
FROM final
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
TEST (
2+
name "int_edge_delivery_status_replaced__copies_only_shipments_loaded_in_the_window",
3+
cursor_start "2026-03-02 00:00:00",
4+
cursor_end "2026-03-03 00:00:00",
5+
);
6+
7+
WITH __ref__int_edge_delivery_status AS (
8+
SELECT
9+
v.shipment_id,
10+
v.order_ref,
11+
v.delivery_status,
12+
v.ordered_on::DATE AS ordered_on,
13+
v.delivered_on::DATE AS delivered_on,
14+
v.is_deleted,
15+
v.latest_seq::NUMBER(38, 0) AS latest_seq,
16+
v.source_loaded_at::TIMESTAMP_NTZ AS source_loaded_at
17+
FROM VALUES
18+
('SH-1', 'DS-O-3001', 'in_transit', '2026-02-27', NULL, FALSE, 12, '2026-03-02 10:00:00'),
19+
('SH-3', 'DS-O-3003', 'delivered', '2026-02-20', '2026-02-25', FALSE, 30, '2026-03-01 10:00:00'),
20+
('SH-4', 'DS-O-3004', 'in_transit', '2026-02-26', NULL, TRUE, 41, '2026-03-02 23:59:59'),
21+
('SH-6', 'DS-O-3006', 'label_created', '2026-03-02', NULL, FALSE, 60, '2026-03-03 00:00:00') AS v(
22+
shipment_id,
23+
order_ref,
24+
delivery_status,
25+
ordered_on,
26+
delivered_on,
27+
is_deleted,
28+
latest_seq,
29+
source_loaded_at
30+
)
31+
),
32+
33+
__expected__int_edge_delivery_status_replaced AS (
34+
SELECT
35+
'SH-1' AS shipment_id,
36+
'in_transit' AS delivery_status,
37+
FALSE AS is_deleted,
38+
12 AS latest_seq,
39+
'2026-03-02 10:00:00'::TIMESTAMP_NTZ(9) AS source_loaded_at
40+
UNION ALL
41+
SELECT
42+
'SH-4' AS shipment_id,
43+
'in_transit' AS delivery_status,
44+
TRUE AS is_deleted,
45+
41 AS latest_seq,
46+
'2026-03-02 23:59:59'::TIMESTAMP_NTZ(9) AS source_loaded_at
47+
)
48+
49+
SELECT 1

‎crates/sqlbuild-cli/Cargo.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "sqlbuild-cli"
3-
version = "0.223.0"
3+
version = "0.224.0"
44
description = "The native `sqb` executable: reused compiles and Python-free commands served without Python, every other command handed to the Python CLI."
55
edition.workspace = true
66
license-file = "LICENSE"

‎crates/sqlbuild-core/src/janitor_text/_helpers/usage.rs‎

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22
33
use crate::cli_text::main::format_count_noun::format_count_noun;
44
use crate::janitor_text::_helpers::phases::noun;
5-
use crate::janitor_text::constants::{
6-
KEEP_WITHOUT_USAGE_NOTICE, READER_LIMIT, USAGE_NOT_CHECKED_PREFIX, WINDOW_UNITS,
7-
};
5+
use crate::janitor_text::constants::{READER_LIMIT, USAGE_NOT_CHECKED_PREFIX, WINDOW_UNITS};
86
use crate::janitor_text::models::{ArchiveCandidateText, JanitorPlanText, UsageCheckText};
97

108
/// The usage check when it ran and could read usage.
@@ -81,14 +79,10 @@ pub(crate) fn usage_notices(plan: &JanitorPlanText) -> Vec<String> {
8179
if check.checked {
8280
return check.notices.clone();
8381
}
84-
let mut notices: Vec<String> = vec![format!(
82+
vec![format!(
8583
"{USAGE_NOT_CHECKED_PREFIX}{}",
8684
check.reason.as_deref().unwrap_or("unknown reason")
87-
)];
88-
if check.keep_in_use {
89-
notices.push(KEEP_WITHOUT_USAGE_NOTICE.to_owned());
90-
}
91-
notices
85+
)]
9286
}
9387

9488
/// The prompt line stating how many archived relations are in use, or which are kept.

‎crates/sqlbuild-core/src/janitor_text/constants.rs‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ pub(crate) const SECONDS_PER_HOUR: u64 = 3600;
2525
/// How many readers each in-use line names before `+N more`.
2626
pub(crate) const READER_LIMIT: usize = 3;
2727
pub(crate) const USAGE_NOT_CHECKED_PREFIX: &str = "usage not checked: ";
28-
pub(crate) const KEEP_WITHOUT_USAGE_NOTICE: &str =
29-
"nothing kept in use: no usage could be checked, so relations in use are archived too";
3028
/// Single-unit usage windows and the noun of their unit.
3129
pub(crate) const WINDOW_UNITS: [(&str, &str); 4] = [
3230
("d", "day"),

0 commit comments

Comments
 (0)