Repository navigation
Conversation
|
Published Install: |
galdre
force-pushed
the
galdre/reference-lint
branch
from
October 27, 2026 19:45
35c31db to
62a5d6b
Compare
|
Published Install: |
escherize
added a commit
that referenced
this pull request
Nov 2, 2026
The self-review of #40 ran no live Metabase. Six of its findings are now corpus cases, recorded from Metabase, which confirms all six: false errors on a Python source table_id: null, a field-filter tag's table and files holding [] or '', and missed refusals of an input for a field-filter tag's table, a quoted name in another case, and a source.type of native. - compare: after an import Metabase took, a lint schema error is a difference, since an error says Metabase refuses the file. - corpus-gen: quoted names in another case than the table's. A run with seed 11 found the MBQL form of the quoted-name refusal (an input PUBLIC.ORDERS) and expectation SQL with template tags, which Metabase cannot parse. - The keeper starts from the cases the corpus holds, so a new run keeps only what they do not cover. - Write edited files with YAML 1.1's rules, as Metabase and the lint read them: 1.2's writer left 2024-01-01 09:00:00 unquoted, a timestamp in 1.1. gen-7-0 failed to import only for that; drop it.
Metabase ships the Sample Database as SQLite, whose tables have no schema. The examples name its tables with a null schema again, as on main, and the settings file gives it engine sqlite and a null default schema. Tests that needed an engine with schemas use the warehouse or their own H2 database.
A field-filter tag whose field names a table with a null schema does not make every run fail: without a value the tag compiles to 1 = 1. null-schema-reference now says the tag's field names a table that Metabase cannot find at pull, and keeps its message for a query that reads the table.
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.
Adds
representations lint(and alint({ folder })export): a check of the references between transforms, tables and transform tests in a folder of representation files. It needs no Metabase.What it checks
Errors, in the order findings are grouped:
schema: a transform, test or table file does not match its schema.duplicate-entity-id,duplicate-target: two files share an entity id; two transforms write one table.dangling-transform-id,wrong-type-transform-id: a test'stransform_idnames nothing, or names something that is not a transform.transform-cycle: transforms read each other's targets.missing-input,unused-input: a test's inputs do not match the tables its transform reads, by Metabase's rule (transform_testing/validator.clj,table-match?).untestable-transform,duplicate-input,expectation-reads-other-table: the other test refusals Metabase makes from the test alone.Warnings:
unknown-table,input-match-undecided(the match depends on a default schema; pass--default-schema DATABASE=SCHEMA),reads-not-checked(a source is missing or its SQL could not be read).The tables a transform reads come from a walk of the document alongside its schema, which collects every
table_id, the table of everyfield_idin a query, and the cards, metrics, measures, segments and snippets a query uses, followed to their files. Native SQL is scanned for the tables afterFROMandJOIN, with snippets pasted in.Other changes
src/lint-mutations.ts: named, known-broken copies ofexamples/v1, one or more per rule. The package ships the examples and exportsMUTATIONSandmutateExamples.src/lint.snapshot.test.ts: the lint's full output on one broken tree per rule.scripts/lint-parity.ts, run by the Import workflow: compares the lint's reads for each example transform with the tables Metabase lists for a test of it..github/workflows/release-alpha.yml: thepublish-alphalabel publishes the PR head as an alpha, as in metabase-cli.examples/v1: one more transform and three transform tests.lint()function was split into named steps by behavior-preserving refactoring commits (Category 1: …), each checked against a recorded output.Draft: the full review comes later. The alpha is for the CI runner in metabase-cli (RCI-28).