Commit ea59785
committed
fix: address whole-PR review findings
Three issues caught in the final review against the spec:
* Multi-path CLI invocations were still loading state. The
LOCAL_ONLY_COMMANDS check was inside `if len(paths) == 1:`, mirroring
the existing `SKIP_LOAD_COMMANDS` shape. But unlike load-skipping,
local-only behaviour is independent of project count - multi-project
monorepo users running `sqlmesh --paths a --paths b format` should
not hit state either. Lifted the check out of the conditional.
Verified empirically: multi-path format against an unreachable
Postgres state now exits 0.
* `GenericContext.__init__` had `load_state` inserted between `load`
and `users`, shifting positional arguments for any caller outside
this repo passing `users`, `config_loader_kwargs`, or `selector`
positionally. Moved `load_state` to the end of the signature. In-repo
callers (cli/main.py, magics.py, github controller) all use kwargs
so they are unaffected.
* The lint test was running with the linter disabled, so no built-in
rule actually executed under `load_state=False`. Added the existing
pattern's `LinterConfig(enabled=False, ...)` -> `enabled=True,
rules=["nomissingexternalmodels"]` rewrite so the test exercises a
real rule's code path while state is patched to raise.
Plan updated to reflect the final signature placement and the lifted
CLI check.
Coding-Agent: pi
Model: anthropic/claude-opus-4-7
Signed-off-by: Joe Hartshorn <8881940+j-hartshorn@users.noreply.github.com>1 parent addfc19 commit ea59785
4 files changed
Lines changed: 22 additions & 7 deletions
File tree
- docs/2026-05-21_local-only-format
- sqlmesh
- cli
- core
- tests/core/linter
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
98 | | - | |
| 98 | + | |
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
| |||
135 | 135 | | |
136 | 136 | | |
137 | 137 | | |
138 | | - | |
| 138 | + | |
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
119 | | - | |
| 119 | + | |
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
| |||
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
128 | | - | |
129 | | - | |
130 | 128 | | |
131 | 129 | | |
132 | 130 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
384 | 384 | | |
385 | 385 | | |
386 | 386 | | |
387 | | - | |
388 | 387 | | |
389 | 388 | | |
390 | 389 | | |
| 390 | + | |
391 | 391 | | |
392 | 392 | | |
393 | 393 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
235 | 235 | | |
236 | 236 | | |
237 | 237 | | |
238 | | - | |
| 238 | + | |
239 | 239 | | |
240 | 240 | | |
241 | 241 | | |
| |||
250 | 250 | | |
251 | 251 | | |
252 | 252 | | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
253 | 270 | | |
254 | 271 | | |
255 | 272 | | |
| |||
0 commit comments