Skip to content

Commit 2073e2d

Browse files
committed
Merge branch 'main' into fix/preserve-node-results
2 parents 152cdc9 + 75d213e commit 2073e2d

246 files changed

Lines changed: 1891 additions & 9542 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.

‎.gitignore‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ target/
5656
*.so
5757
*.pyd
5858
*.dylib
59-
.dlt/
6059
.amp/portals/*
6160
/.env
6261

‎.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.238.0"
2+
".": "0.238.2"
33
}

‎CHANGELOG.md‎

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

3+
## [0.238.2](https://github.com/sqlstack-io/sqlbuild/compare/v0.238.1...v0.238.2) (2026-11-17)
4+
5+
6+
### Performance Improvements
7+
8+
* **compile:** stop repeating per-call SQL macro work ([#1549](https://github.com/sqlstack-io/sqlbuild/issues/1549)) ([4740e84](https://github.com/sqlstack-io/sqlbuild/commit/4740e84b4533d1459d03dafa0e820bffd1b4f814))
9+
10+
## [0.238.1](https://github.com/sqlstack-io/sqlbuild/compare/v0.238.0...v0.238.1) (2026-11-17)
11+
12+
13+
### Bug Fixes
14+
15+
* **rules:** report custom rule node findings at model file positions ([#1546](https://github.com/sqlstack-io/sqlbuild/issues/1546)) ([48e4132](https://github.com/sqlstack-io/sqlbuild/commit/48e4132371aa42374dc2b41cf98ee4f6d7519031))
16+
317
## [0.238.0](https://github.com/sqlstack-io/sqlbuild/compare/v0.237.0...v0.238.0) (2026-11-17)
418

519

‎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/project/rules/quoted_aliases.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ def mixed_case_names_stay_in_exports(*, model: Model, ctx: RuleContext) -> list[
2929
findings.append(
3030
ctx.finding(
3131
subject=model,
32+
node=node,
3233
message=f"Quoted mixed-case name {node.name!r} in `{text}`",
3334
)
3435
)

‎benchmarks/duckshop/project/tests/test_rule_quoted_aliases.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ def test_given_quoted_mixed_case_alias_outside_an_export_when_evaluating_then_re
3030
)
3131

3232
assert result.finding_count == 1
33+
assert (result.findings[0].line, result.findings[0].column) == (3, 3)
3334
assert result.findings[0].message == (
3435
"Quoted mixed-case name 'listingId' in `l.listing_id AS \"listingId\"`"
3536
)

‎crates/sqlbuild-analysis/src/compiler/_helpers/sql_tests/planning.rs‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,22 @@ pub(crate) struct SqlTestPatterns {
118118
pub(crate) identifier: Regex,
119119
}
120120

121+
/// The SQL-test patterns, compiled once; each scenario and test clones them with its syntax.
122+
static COMPILED_PATTERNS: OnceLock<Result<SqlTestPatterns, String>> = OnceLock::new();
123+
121124
impl SqlTestPatterns {
122125
pub(crate) fn new(lexical: LexicalSyntax) -> Result<Self, String> {
126+
let compiled: &Self = COMPILED_PATTERNS
127+
.get_or_init(|| Self::compiled(LexicalSyntax::default()))
128+
.as_ref()
129+
.map_err(Clone::clone)?;
130+
Ok(Self {
131+
lexical,
132+
..compiled.clone()
133+
})
134+
}
135+
136+
fn compiled(lexical: LexicalSyntax) -> Result<Self, String> {
123137
Ok(Self {
124138
reference: compile_pattern(r#"(?i)__ref\(\"([^\"]+)\"\)"#)?,
125139
source: compile_pattern(r#"(?i)__source\(\"([^\"]+)\"\)"#)?,

‎crates/sqlbuild-analysis/src/python_plan/main/run_lifecycle.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use crate::python_plan::main::upstream_closure::upstream_closure;
66
use crate::python_plan::models::{LifecycleNode, RunLifecycle};
77
use crate::python_selection::constants::{ASSET_KIND, LOADER_KIND, TASK_KIND};
88

9-
/// Ingress is every selected warehouse loader and its selected upstream tasks, assets and loaders.
9+
/// Ingress is every selected loader and its selected upstream tasks, assets and loaders.
1010
#[must_use]
1111
pub fn run_lifecycle(
1212
selected: &BTreeSet<String>,
@@ -19,7 +19,7 @@ pub fn run_lifecycle(
1919
.filter(|name| {
2020
nodes
2121
.get(name.as_str())
22-
.is_some_and(|node| node.kind == LOADER_KIND && !node.external_loader)
22+
.is_some_and(|node| node.kind == LOADER_KIND)
2323
})
2424
.cloned()
2525
.collect();

‎crates/sqlbuild-analysis/src/python_plan/models.rs‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
pub struct LifecycleNode {
66
/// `task`, `asset`, `loader` or `check`.
77
pub kind: String,
8-
/// Whether the node is a loader that owns its own warehouse connection.
9-
pub external_loader: bool,
108
}
119

1210
/// Selected Python nodes split into ingress and read-side regions, each sorted.

‎crates/sqlbuild-analysis/src/python_plan/tests/helpers.rs‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,13 @@ pub(crate) fn edges(rows: &[(&str, &[&str])]) -> HashMap<String, Vec<String>> {
1313
.collect()
1414
}
1515

16-
pub(crate) fn lifecycle_nodes(rows: &[(&str, &str, bool)]) -> HashMap<String, LifecycleNode> {
16+
pub(crate) fn lifecycle_nodes(rows: &[(&str, &str)]) -> HashMap<String, LifecycleNode> {
1717
rows.iter()
18-
.map(|(name, kind, external_loader)| {
18+
.map(|(name, kind)| {
1919
(
2020
(*name).to_owned(),
2121
LifecycleNode {
2222
kind: (*kind).to_owned(),
23-
external_loader: *external_loader,
2423
},
2524
)
2625
})

0 commit comments

Comments
 (0)