Commit 29065a9
committed
fix(format): stop kind's own render policy from transpiling scalar siblings
Recursing _holds_expression into nested Pydantic models to correctly
classify TimeColumn (IncrementalByTimeRangeKind.time_column) as
warehouse SQL had the side effect of also matching ModelMeta.kind
itself, since some member of the ModelKind union holds an expression
field. That routed the entire kind (...) subtree through a
dialect-specific generator, so on tsql a scalar sibling like
forward_only TRUE was rewritten to (1 = 1) -- which reparses fine but
silently evaluates to False on reload via str_to_bool.
kind's own nested properties are already independently dialect-tagged
via the ModelKind expression node's own meta when _props_sql recurses
into them, so the outer kind property's policy should never route its
subtree through render_with_model_dialect. Stop _holds_expression at
_ModelKind subclasses to restore that.
Signed-off-by: mday-io <mdaytn@gmail.com>1 parent ae92536 commit 29065a9
2 files changed
Lines changed: 69 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
744 | 744 | | |
745 | 745 | | |
746 | 746 | | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
747 | 757 | | |
| 758 | + | |
| 759 | + | |
748 | 760 | | |
749 | 761 | | |
750 | 762 | | |
| 763 | + | |
| 764 | + | |
751 | 765 | | |
752 | 766 | | |
753 | 767 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
516 | 516 | | |
517 | 517 | | |
518 | 518 | | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 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 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
519 | 574 | | |
520 | 575 | | |
521 | 576 | | |
| |||
0 commit comments