Repository navigation
refactor: share one exception constructor and text reader across the Python bindings - #1528
Merged
Merged
Conversation
…Python bindings The binding crates built their error-class exceptions and read optional text values with about forty private copies of the same few lines. - Add exception_from to the records construct helpers. new_error now takes optional code and help keywords, replacing new_helped_error; new_plain_error and host_error delegate to it, and each command's error wrapper is one call. - Add the base readers optional_text (a str value or None) and text_item (a dict item as optional text). They replace the per-crate dict readers, the compile setup and planner envelope readers, and the execution history reader. The strict None-or-str readers in compile targets and execution history are renamed nullable_text so the two meanings no longer share a name. - Drop the scoped dupes allowlist entries for these clusters, give the dbt manifest-object and argv builders their own entries, and lower the Python-crossing budgets and the sqlbuild-python line cap to the new counts.
kvlonge
enabled auto-merge
November 17, 2026 00:38
kvlonge
added a commit
that referenced
this pull request
Nov 17, 2026
…on the large-project tree Applies the slice's shared new_error/exception_from constructor and the base optional_text/text_item readers, keeping the large-project tree's behaviour. - The tree's own optional_text calls (its local reader in cli dispatch and the planner's reader) are unchanged; only the calls the slice converted use the base reader. - The Python-tests input error keeps the tree's help text, which names tests/orchestration/. - main's within_identity_pass, which the tree does not have, is not carried over. Validation: cargo check --workspace --all-targets passes with no warnings, and every line the tree added to a touched file is still present. Nothing is built or tested yet. fensu reports 349 faults; the three new ones ask to lower Python-crossing budgets that keep the tree's values for the final pass.
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
The Python binding crates raised their error-class exceptions and read optional text values through about forty private copies of the same few lines, hidden by duplicate-code allowlist entries that deferred the consolidation.
Changes
exception_fromin the records construct helpers builds an exception class with a message and thecodeandhelpkeywords that are given.new_errortakes optionalcodeandhelpand replacesnew_helped_error;new_plain_error,host_errorand each command's error wrapper delegate to it.optional_text(astrvalue orNone) andtext_item(a dict item as optional text) replace the per-crate copies. The strict None-or-str readers in compile targets and execution history are renamednullable_text, so the two meanings no longer share a name. The lossy output-capture reader stays separate.fensu.toml: the scoped[dupes]entries are gone; the dbt manifest-object and argv builders get their own entries; Python-crossing budgets drop from 3,598 to 3,567 and thesqlbuild-pythonline cap from 66,831 to 66,709.Behaviour is unchanged: omitting
codeorhelpmatches passingNonefor every class involved.No DuckShop case applies: this changes how native errors are built, not a project shape, data value or lifecycle sequence.
Verification
_nativesurface identical to main; dense 3,000-model compile output identical (11,175 files).make check-ciandmake teston the final head.