Commit f6078cd
committed
fix(format): keep MODEL/AUDIT header dialect-agnostic (#5773)
format_model_expressions rendered every parsed expression with the target
dialect, including the SQLMesh-specific MODEL/AUDIT/METRIC header. That header
is SQLMesh DDL, not standard SQL, so transpiling it corrupts boolean properties:
under tsql (which has no TRUE keyword) a property like `allow_partials true`
was rewritten to `allow_partials (1 = 1)`.
Render meta expressions (is_meta_expression) with dialect=None so the header
stays as written, while the actual query/statement body still transpiles to the
target dialect.
Signed-off-by: Anas Khan <83116240+anxkhn@users.noreply.github.com>1 parent 991a327 commit f6078cd
2 files changed
Lines changed: 39 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
783 | 783 | | |
784 | 784 | | |
785 | 785 | | |
786 | | - | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
787 | 790 | | |
788 | 791 | | |
789 | 792 | | |
| |||
815 | 818 | | |
816 | 819 | | |
817 | 820 | | |
818 | | - | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
819 | 829 | | |
820 | 830 | | |
821 | 831 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
230 | 230 | | |
231 | 231 | | |
232 | 232 | | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
233 | 260 | | |
234 | 261 | | |
235 | 262 | | |
| |||
0 commit comments