openlibrary icon indicating copy to clipboard operation
openlibrary copied to clipboard

Tracking sqlfluff issue fixes to remove remaining files from pre-commit exclusion

Open Sanket17052006 opened this issue 8 months ago • 2 comments

We removed scripts/solr_builder/sql/prod-partial-dump.sql exclusion from the exclude list in .pre-commit-config.yaml in PR #12243 closing #11919

But the scripts/solr_builder/sql/import-partial.sql and scripts/dev-instance/patron_data.sql cannot be excluded until sqlfluff/sqlfluff#7696 and sqlfluff/sqlfluff#7697 are fixed.

After the fix we can :

  • Update the new sqlfluff version.
  • And remove scripts/dev-instance/patron_data.sql and scripts/solr_builder/sql/import-partial.sql from the exclude list in .pre-commit-config.yaml.

Releases: https://github.com/sqlfluff/sqlfluff/releases

Sanket17052006 avatar Apr 01 '26 08:04 Sanket17052006

Looks like both of the above issues are fixed. Now we just need a new release > 4.2.2 https://github.com/sqlfluff/sqlfluff/releases

RayBB avatar Jul 05 '26 19:07 RayBB

@RayBB sqlfluff 4.3.0 (released Aug 7) includes both fixes, so I checked the two excluded files against it locally:

  • scripts/dev-instance/patron_data.sql now parses. What's left is 11 style findings on lines 120–129 (LT14, ST05, RF02), all in the hand-written INSERT … (SELECT …) statements at the end.
  • scripts/solr_builder/sql/import-partial.sql: the :source placeholder parses now, but sqlfluff still can't parse the old pre-9.0 COPY option syntax on line 8, WITH delimiter E'\t' quote E'\b' csv. The equivalent modern form, WITH (FORMAT csv, DELIMITER E'\t', QUOTE E'\b'), lints clean.

I'd like to take this. The PR would bump sqlfluff to 4.3.0, remove both exclusions, switch that COPY to the modern option syntax, and fix the patron_data.sql findings (LT14 via sqlfluff fix; for ST05/RF02 either rewrite those inserts with CTEs or add a targeted -- noqa, whichever you prefer for a seed file). Is changing the COPY syntax in the solr_builder script OK, or would you rather keep that file excluded for now?

gauranshahuja avatar Sep 27 '26 19:09 gauranshahuja