Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion benchmarks/duckshop/RUNBOOK.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ sqb scenario test --run-on local --exclude edge_cases
```

The local run converts each scenario's fixtures and models from Snowflake SQL to DuckDB with
SQLQuack and runs them on your machine, with no warehouse connection. A scenario SQLQuack can't
SQLBabel and runs them on your machine, with no warehouse connection. A scenario SQLBabel can't
convert is listed under `Can't run locally` and fails the run; report it rather than rewriting the
scenario to avoid the construct.

Expand Down
18 changes: 9 additions & 9 deletions crates/sqlbuild-cli/src/argv/command_table.json
Original file line number Diff line number Diff line change
Expand Up @@ -3652,7 +3652,7 @@
"local",
"warehouse"
],
"help": "Where unit tests run: auto (locally when SQLQuack converts them, otherwise on the warehouse), local or warehouse; overrides the target and [settings] test_run_on",
"help": "Where unit tests run: auto (locally when SQLBabel converts them, otherwise on the warehouse), local or warehouse; overrides the target and [settings] test_run_on",
"group": 1
},
{
Expand Down Expand Up @@ -7947,31 +7947,31 @@
"removed_options": [
{
"option": "--sync-snapshots",
"instead": "scenarios now convert their fixture CTEs with SQLQuack, so there are no snapshots to sync; run sqb scenario test --run-on local"
"instead": "scenarios now convert their fixture CTEs with SQLBabel, so there are no snapshots to sync; run sqb scenario test --run-on local"
},
{
"option": "--refresh",
"instead": "scenarios now convert their fixture CTEs with SQLQuack, so there are no snapshots to sync; run sqb scenario test --run-on local"
"instead": "scenarios now convert their fixture CTEs with SQLBabel, so there are no snapshots to sync; run sqb scenario test --run-on local"
},
{
"option": "--force",
"instead": "scenarios now convert their fixture CTEs with SQLQuack, so there are no snapshots to limit; drop the flag"
"instead": "scenarios now convert their fixture CTEs with SQLBabel, so there are no snapshots to limit; drop the flag"
},
{
"option": "--max-snapshot-rows",
"instead": "scenarios now convert their fixture CTEs with SQLQuack, so there are no snapshots to limit; drop the flag"
"instead": "scenarios now convert their fixture CTEs with SQLBabel, so there are no snapshots to limit; drop the flag"
},
{
"option": "--max-snapshot-total-rows",
"instead": "scenarios now convert their fixture CTEs with SQLQuack, so there are no snapshots to limit; drop the flag"
"instead": "scenarios now convert their fixture CTEs with SQLBabel, so there are no snapshots to limit; drop the flag"
},
{
"option": "--max-snapshot-bytes",
"instead": "scenarios now convert their fixture CTEs with SQLQuack, so there are no snapshots to limit; drop the flag"
"instead": "scenarios now convert their fixture CTEs with SQLBabel, so there are no snapshots to limit; drop the flag"
},
{
"option": "--max-snapshot-total-bytes",
"instead": "scenarios now convert their fixture CTEs with SQLQuack, so there are no snapshots to limit; drop the flag"
"instead": "scenarios now convert their fixture CTEs with SQLBabel, so there are no snapshots to limit; drop the flag"
}
],
"actions": [
Expand Down Expand Up @@ -8190,7 +8190,7 @@
"removed_choices": [
{
"value": "capture",
"instead": "scenarios now convert their fixture CTEs with SQLQuack, so there is nothing to capture; run sqb scenario test --run-on local and delete tests/_scenario_snapshots/"
"instead": "scenarios now convert their fixture CTEs with SQLBabel, so there is nothing to capture; run sqb scenario test --run-on local and delete tests/_scenario_snapshots/"
}
],
"choices_help": []
Expand Down
4 changes: 2 additions & 2 deletions crates/sqlbuild-config/src/project/_helpers/sections.rs
Original file line number Diff line number Diff line change
Expand Up @@ -986,7 +986,7 @@ pub(crate) fn load_scenario(payload: Option<&ConfigValue>, file: ConfigFile) ->
file,
format!(
"[scenario] option(s) were removed: {}; scenarios now convert their fixture CTEs \
with SQLQuack, so there are no snapshots to capture or type. Delete them, and \
with SQLBabel, so there are no snapshots to capture or type. Delete them, and \
delete tests/_scenario_snapshots/",
removed.join(", ")
),
Expand Down Expand Up @@ -1114,7 +1114,7 @@ pub(crate) fn load_testing(payload: Option<&ConfigValue>, file: ConfigFile) -> L
_ => Err(ConfigFailure::at(
file,
format!(
"[testing.local] allow takes `{} = true` or `false` for a SQLQuack known \
"[testing.local] allow takes `{} = true` or `false` for a SQLBabel known \
difference",
key_name(name)
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -769,7 +769,7 @@ fn given_invalid_testing_section_when_loading_then_it_is_rejected() {
ReviewConfigErrorTestCase {
description: "an allowance that is not true or false",
project: "name = 'orders'\nadapter = 'snowflake'\n[testing.local]\nallow = { hash = 'yes' }\n",
expected_fragment: "[testing.local] allow takes `hash = true` or `false` for a SQLQuack known difference",
expected_fragment: "[testing.local] allow takes `hash = true` or `false` for a SQLBabel known difference",
},
ReviewConfigErrorTestCase {
description: "a misspelt testing.local key",
Expand Down
4 changes: 2 additions & 2 deletions crates/sqlbuild-core/src/run_on/_helpers/kinds.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! Who can act on a refusal: the project's SQL, a setting, SQLQuack or SQLBuild, or nobody.
//! Who can act on a refusal: the project's SQL, a setting, SQLBabel or SQLBuild, or nobody.

use crate::run_on::constants::{DUCKDB_ERROR_CATEGORY, KNOWN_DIFFERENCE_CODE};
use crate::run_on::models::RefusalGroup;
Expand All @@ -10,7 +10,7 @@ pub(crate) enum RefusalKind {
Fix,
/// A known difference the project can allow in `sqlbuild_project.toml`.
Allow,
/// A construct SQLQuack or SQLBuild does not handle yet.
/// A construct SQLBabel or SQLBuild does not handle yet.
Gap,
/// DuckDB failed on converted SQL, or SQLBuild's own comparison holds the construct.
Internal,
Expand Down
2 changes: 1 addition & 1 deletion crates/sqlbuild-core/src/run_on/_helpers/summary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ fn item_count(groups: &[&RefusalGroup]) -> usize {
.len()
}

/// `SQ0003 <message>`, or an unplaced cause's category and its first constructs.
/// `SBL0003 <message>`, or an unplaced cause's category and its first constructs.
fn row_text(group: &RefusalGroup, code_width: usize) -> String {
let code: &str = group.refusal.code.as_deref().unwrap_or("");
let text: String = if group.unplaced {
Expand Down
2 changes: 1 addition & 1 deletion crates/sqlbuild-core/src/run_on/_helpers/text.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ pub(crate) fn group_counts(group: &RefusalGroup, nouns: (&str, &str)) -> String
counts.join(" \u{00b7} ")
}

/// The block's head message: the category of an unplaced group, else SQLQuack's message.
/// The block's head message: the category of an unplaced group, else SQLBabel's message.
pub(crate) fn group_message(group: &RefusalGroup) -> String {
let refusal: &LocalRefusal = &group.refusal;
if group.unplaced {
Expand Down
6 changes: 3 additions & 3 deletions crates/sqlbuild-core/src/run_on/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ pub(crate) const ON_THE_WAREHOUSE_TITLE: &str = "On the warehouse";
pub(crate) const RUNS_ON_LABEL: &str = "runs on";
/// The width the refusal report lays its counts out to when output has no terminal width.
pub(crate) const REPORT_FALLBACK_COLUMNS: usize = 120;
/// What a local item relied on from the project: SQLQuack allowances and overrides.
/// What a local item relied on from the project: SQLBabel allowances and overrides.
pub(crate) const RELIED_ON_LABEL: &str = "relied on";
pub(crate) const NOTE_LABEL: &str = "= note:";
pub(crate) const EXPANDED_LABEL: &str = "= expanded from";
pub(crate) const USED_BY_LABEL: &str = "= used by";
/// The help of a cause that has none of its own under `--run-on local`: `run these <items> on the warehouse …`.
pub(crate) const RUN_ELSEWHERE_HELP_PREFIX: &str = "run these ";
pub(crate) const RUN_ELSEWHERE_HELP_SUFFIX: &str = " on the warehouse with --run-on auto";
/// SQLQuack's code for a known difference the project has not allowed.
pub(crate) const KNOWN_DIFFERENCE_CODE: &str = "SQ0008";
/// SQLBabel's code for a known difference the project has not allowed.
pub(crate) const KNOWN_DIFFERENCE_CODE: &str = "SBL0008";
/// The category of a refusal DuckDB raised while running converted SQL.
pub(crate) const DUCKDB_ERROR_CATEGORY: &str = "DuckDB internal error";
pub(crate) const FIX_TITLE: &str = "Fix in your SQL";
Expand Down
2 changes: 1 addition & 1 deletion crates/sqlbuild-core/src/run_on/main/with_run_on_json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ pub fn with_run_on_json(
serde_json::to_string(&document).map_err(|error| error.to_string())
}

/// Each refusal once per construct and place, as SQLQuack's `--json` reports it, with its items.
/// Each refusal once per construct and place, as SQLBabel's `--json` reports it, with its items.
fn refusals(decisions: &[RunOnDecision]) -> Vec<Value> {
let mut found: Vec<(LocalRefusal, Vec<String>)> = Vec::new();
for decision in decisions {
Expand Down
4 changes: 2 additions & 2 deletions crates/sqlbuild-core/src/run_on/models.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ pub struct RunOnLayers {
pub settings: Option<String>,
}

/// One SQLQuack refusal, or one of SQLBuild's own reasons, placed in the file holding it.
/// One SQLBabel refusal, or one of SQLBuild's own reasons, placed in the file holding it.
#[derive(Clone, Debug, Default, PartialEq, Eq)]
pub struct LocalRefusal {
pub category: String,
Expand Down Expand Up @@ -80,7 +80,7 @@ pub struct MacroPlace {
}

impl LocalRefusal {
/// `<category>: <construct>`, as SQLQuack's census labels a refusal.
/// `<category>: <construct>`, as SQLBabel's census labels a refusal.
#[must_use]
pub fn title(&self) -> String {
format!("{}: {}", self.category, self.construct)
Expand Down
22 changes: 11 additions & 11 deletions crates/sqlbuild-core/src/run_on/tests/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pub(super) fn local(name: &str) -> RunOnDecision {
}
}

/// A test SQLQuack refuses at `line` of `stg_orders.sql` for `construct`.
/// A test SQLBabel refuses at `line` of `stg_orders.sql` for `construct`.
pub(super) fn refused(name: &str, construct: &str, line: i64) -> RunOnDecision {
RunOnDecision {
relied_on: Vec::new(),
Expand All @@ -24,19 +24,19 @@ pub(super) fn refused(name: &str, construct: &str, line: i64) -> RunOnDecision {
}
}

/// SQLQuack's HASH refusal at `line` of `stg_orders.sql`.
/// SQLBabel's HASH refusal at `line` of `stg_orders.sql`.
fn hash_refusal(construct: &str, line: i64) -> LocalRefusal {
LocalRefusal {
category: "a known difference that isn't allowed".to_owned(),
construct: construct.to_owned(),
reason: "fn:HASH needs known divergence `hash`".to_owned(),
code: Some("SQ0008".to_owned()),
code: Some("SBL0008".to_owned()),
message: Some("HASH gives a different value in DuckDB".to_owned()),
label: Some("DuckDB computes its own hash, never Snowflake's".to_owned()),
notes: vec!["Equal inputs still get equal hashes within one run.".to_owned()],
help: Some(
"allow it for local tests in sqlbuild_project.toml with \
`[testing.local] allow = { hash = true }`; `sqlquack explain hash` says when it is safe"
`[testing.local] allow = { hash = true }`; `sqlbabel explain hash` says when it is safe"
.to_owned(),
),
path: Some("sql/models/staging/stg_orders.sql".to_owned()),
Expand All @@ -52,7 +52,7 @@ fn hash_refusal(construct: &str, line: i64) -> LocalRefusal {
}
}

/// A test SQLQuack refuses without a place in any file.
/// A test SQLBabel refuses without a place in any file.
pub(super) fn unplaced(name: &str) -> RunOnDecision {
RunOnDecision {
relied_on: Vec::new(),
Expand Down Expand Up @@ -202,8 +202,8 @@ pub(super) fn many_causes() -> Vec<RunOnDecision> {
LocalRefusal {
category: "outside a rule's type conditions".to_owned(),
construct: format!("fn:{function}"),
code: Some("SQ0003".to_owned()),
message: Some(format!("SQLQuack can't convert {function} for these types")),
code: Some("SBL0003".to_owned()),
message: Some(format!("SQLBabel can't convert {function} for these types")),
label: Some("TIMESTAMP_TZ".to_owned()),
notes: vec!["a Snowflake TIMESTAMP_TZ stores each value's own UTC offset; DuckDB's TIMESTAMPTZ keeps only the instant".to_owned()],
help: Some(helps[index % 3].to_owned()),
Expand Down Expand Up @@ -239,7 +239,7 @@ pub(super) fn many_causes() -> Vec<RunOnDecision> {
refused_with_code(
&format!("test_gap_{index}"),
&format!("FN_GAP_{index}"),
"SQ0002",
"SBL0002",
)
.refusals[0]
.clone(),
Expand All @@ -254,9 +254,9 @@ pub(super) fn many_causes() -> Vec<RunOnDecision> {
add(
format!("test_guard_{guard}"),
LocalRefusal {
category: "SQLQuack guard".to_owned(),
category: "SQLBabel guard".to_owned(),
construct: guard.to_owned(),
reason: format!("SQLQuack's guard {guard} raised in DuckDB"),
reason: format!("SQLBabel's guard {guard} raised in DuckDB"),
width: 1,
..LocalRefusal::default()
},
Expand All @@ -277,7 +277,7 @@ pub(super) fn many_causes() -> Vec<RunOnDecision> {
add(
"test_generated".to_owned(),
LocalRefusal {
message: Some("SQLQuack can't convert JOIN for these types".to_owned()),
message: Some("SQLBabel can't convert JOIN for these types".to_owned()),
path: Some("tests/sql/test_generated.yml".to_owned()),
line: None,
generated: true,
Expand Down
Loading
Loading