Repository navigation
Lint patron_data.sql and import-partial.sql with sqlfluff 4.4.0 - #13732
Merged
RayBB merged 2 commits intoOct 12, 2026
Merged
Conversation
Collaborator
|
Thanks for the PR! The linked issue hasn't been triaged yet — triage happens on Mondays and Fridays. There are currently 64 open non-draft PRs ahead of yours. PR triage checklist (maintainers / Pierre)
Note This comment was automatically generated by Pierre, Open Library's PR first-touch assistant, on behalf of @mekarpeles. This is NOT a code review or sign-off. |
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
RayBB
approved these changes
Oct 12, 2026
RayBB
left a comment
Collaborator
There was a problem hiding this comment.
Very nice this is working as expected.
Appreciate you finding this and getting a PR open!
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.
Closes #12245
Technical
sqlfluff 4.4.0 includes the fixes for sqlfluff/sqlfluff#7696 and #7697, so the two files excluded from the
sqlfluff-linthook can be linted now. This PR bumps the hook to 4.4.0 (the latest release), removes theexclude, and fixes what the linter then reports:scripts/dev-instance/patron_data.sqlnow parses. The only findings were in the four hand-writtenINSERTstatements at the end (LT14, ST05, RF02). They are reformatted onto multiple lines, and thedatum_refinsert uses CTEs instead of subqueries inFROM. The column mapping is unchanged: the three columns are selected in the same order as before, now with explicit aliases matching the target columns. The file is loaded withpsqlfrom stdin (scripts/dev-instance/load-patron-data.sh), which handles multi-line statements.scripts/solr_builder/sql/import-partial.sql: the:sourceplaceholder parses now, but sqlfluff can't parse the pre-9.0 COPY option syntaxWITH delimiter E'\t' quote E'\b' csv. It is switched to the equivalentWITH (FORMAT csv, DELIMITER E'\t', QUOTE E'\b'). The twoSELECT *there are deliberate (the temp table mirrorstest), so they get-- noqa: AM04.pre-commit.ci's #13585 also bumps sqlfluff; whichever lands second only needs that one line rebased.
Testing
sqlfluff lint --dialect postgresover all 15 tracked.sqlfiles with both 4.3.0 and 4.4.0 (repo config): all pass.pre-commit run sqlfluff-lint --all-filespasses on 4.4.0.postgres:18.3(dev DB initialised viadocker/ol-db-init.sh): loading the old and newpatron_data.sqlproduces identicalversion/data/datum_str/datum_refrows for the test list, and the old and newimport-partial.sqlproduce identical rows intest(including quotes, backslashes and an upsert conflict).INSERTstatements inpatron_data.sqlparse, and the old and newCOPYstatements produce identical options (format=csv,delimiter=\t,quote=\x08).Stakeholders
@RayBB