Repository navigation
refactor: read native record fields directly across the bindings - #1123
Merged
Merged
Conversation
SQL rules read each compiled model's relative path, sql_analysis opt-out, authored and expanded SQL and dynamic pivot proof from the native facts and analysis instead of Python attributes. The proof's cache-key text is encoded natively as the same sorted compact JSON json.dumps produced, so SQL rule cache keys are unchanged; hand-built models keep reading their record fields.
Native records now keep their class layout, so records::fields::field reads a declared field straight from the record's values without the Python attribute protocol, falling back to getattr for other objects. SQL test and scenario facts and the fixture-format schemas read their inputs this way, and discovered model files' paths, header values and column locations through the native model file record.
Rule planning, dispatch, catalogue selection, finalization, results and format --fix now read native record fields in place, rebuild records with records::fields::replaced instead of dataclasses.replace, and call the rule helpers (plan, SQL rules, finish, finalize, selection, catalogue, compiled project builds) directly instead of through module attributes. Rules configurations and custom payloads encode natively as the JSON the selection and request paths parsed, falling back to Python's encoder for values only it spells (non-finite or wide numbers, non-text keys). Duplicate-literal hints read finding files natively, and project views answer settings, scenarios and scope index reads from stored fields.
…records SQL rule runs, lint settings and compiled expansions, rule guidance, early SQL lint planning and fix-verification facts read native record fields in place, and project views answer diagnostics reads from their stored fields.
…ython attribute protocol
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
Rust still read SQLBuild's own native records through the Python attribute protocol at thousands of sites, and rule planning and dispatch still went through module lookups.
Changes
Verification