Repository navigation
Conversation
A macro or function body that is an expression is formatted as the item of a SELECT, and every line is then moved one indent step left. Lines the formatter keeps as written, such as an unaliased Snowflake select item, were never moved right, so each run moved them one more step left and `sqb format --check` never passed. The body's code lines now move one step right before formatting, so the step taken off afterwards returns them to where they were.
A line holding only spaces inside a select item that Snowflake keeps as written now moves right before formatting too, so taking the step off afterwards leaves it where it was.
chio-labs-delivery
Bot
added this pull request to the merge queue
Nov 30, 2026
Any commits made after this event will not be merged.
An unused local macro fails compile with S010, so stg_edge_partner_payloads now calls horner_ratio on its FLOAT amount. The macro reads its subquery's inputs as constants, so the model's tests, which already run on the warehouse, keep their local and warehouse split.
chio-labs-delivery
Bot
added this pull request to the merge queue
Nov 30, 2026
Any commits made after this event will not be merged.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
sqb formatnever settled on a SQL macro whose body is an expression holding a nested, multi-line arithmetic expression in a subquery item without an alias, on Snowflake projects. Each run moved part of the body one more indent step left, so--fixalways reported a change andsqb format --checkcould never pass. The meaning was kept; the layout drifted.An expression body is formatted as the item of a
SELECT, then one indent step is taken off every line. Snowflake names an unaliased select item after its text, so the formatter keeps that item's lines as written and never indents them. Taking the step off moved them left on every run. DuckDB has no such rule, which is why DuckDB projects settled.Changes
horner_ratio, a scoped macro nesting polynomials in an unaliased subquery item.Verification
sqb formatrun twice on a Snowflake and a DuckDB project leaves the second run's file unchanged, andformat --checkpasses.sqlbuild-ruleslint_texttests, clippy-D warnings,cargo fmt,fensu check(0 faults) andfensu dupes(none).