Commit 9725f9c
docs(formatter): fix null semantics — None excluded by exclude_none, not SQLGlot default
At the FormatConfig/YAML layer, normalize_functions=None is excluded from
generator_options by PydanticModel.dict(exclude_none=True). format_model_expressions
therefore uses its own False default, so YAML null behaves like false — not like
SQLGlot's direct None deferral.
Changes:
- FormatConfig docstring: distinguish None (excluded -> False path) from True
(defers to SQLGlot default -> uppercase); remove the incorrect claim they are
equivalent
- format_model_expressions docstring: clarify that direct None passes None to the
SQLGlot generator (dialect-dependent) while the config path never reaches this
because None is excluded before the call
- docs/reference/configuration.md: describe null as taking the false-default path;
true remains the value that defers to SQLGlot's generator default
- tests: add test_format_config_normalize_functions_none asserting that
FormatConfig(normalize_functions=None).generator_options omits the key and that
the resulting format call preserves custom function casing (False behaviour)
Signed-off-by: Alberto Suman <alberto.suman@1komma5grad.com>
Co-authored-by: Cursor <cursoragent@cursor.com>1 parent 567e421 commit 9725f9c
4 files changed
Lines changed: 46 additions & 8 deletions
File tree
- docs/reference
- sqlmesh/core
- config
- tests/core
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
117 | | - | |
| 117 | + | |
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
27 | 30 | | |
28 | 31 | | |
29 | 32 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
807 | 807 | | |
808 | 808 | | |
809 | 809 | | |
810 | | - | |
811 | | - | |
812 | | - | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
813 | 817 | | |
814 | 818 | | |
815 | 819 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
527 | 527 | | |
528 | 528 | | |
529 | 529 | | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
530 | 561 | | |
531 | 562 | | |
532 | 563 | | |
| |||
0 commit comments