Commit f29af30
fix: improve Jinja preprocessing robustness
- Use __jinja_expr__ placeholder for adapter.dispatch/return/log instead
of empty string to avoid invalid SQL in expression positions
- Add Jinja auto-preprocessing to lineage.check and sql.explain
- Improve sql.optimize fallback: preserve original SQL when only Jinja
preprocessing occurred (no actual rewrites)
- Simplify sql.format: drop the SQL comment approach, just format the
preprocessed SQL cleanly
- Update tests to verify __jinja_expr__ placeholder behavior
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent 7a9fdb8 commit f29af30
3 files changed
Lines changed: 36 additions & 16 deletions
File tree
- packages/altimate-engine
- src/altimate_engine
- sql
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
472 | 472 | | |
473 | 473 | | |
474 | 474 | | |
475 | | - | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
476 | 481 | | |
477 | 482 | | |
478 | 483 | | |
| |||
500 | 505 | | |
501 | 506 | | |
502 | 507 | | |
503 | | - | |
| 508 | + | |
504 | 509 | | |
505 | 510 | | |
506 | 511 | | |
507 | 512 | | |
508 | 513 | | |
509 | 514 | | |
510 | 515 | | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
511 | 521 | | |
512 | | - | |
| 522 | + | |
513 | 523 | | |
514 | 524 | | |
515 | 525 | | |
| |||
569 | 579 | | |
570 | 580 | | |
571 | 581 | | |
572 | | - | |
573 | 582 | | |
574 | 583 | | |
575 | 584 | | |
576 | 585 | | |
577 | | - | |
578 | | - | |
579 | | - | |
580 | | - | |
581 | 586 | | |
582 | 587 | | |
583 | 588 | | |
584 | | - | |
585 | | - | |
586 | 589 | | |
587 | 590 | | |
588 | 591 | | |
589 | 592 | | |
590 | | - | |
| 593 | + | |
591 | 594 | | |
592 | 595 | | |
593 | | - | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
594 | 609 | | |
595 | 610 | | |
596 | 611 | | |
| |||
Lines changed: 6 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
199 | 200 | | |
200 | 201 | | |
201 | 202 | | |
202 | | - | |
203 | | - | |
204 | | - | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
205 | 207 | | |
206 | 208 | | |
207 | 209 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
402 | 402 | | |
403 | 403 | | |
404 | 404 | | |
| 405 | + | |
405 | 406 | | |
406 | 407 | | |
407 | 408 | | |
408 | 409 | | |
409 | 410 | | |
410 | 411 | | |
| 412 | + | |
411 | 413 | | |
412 | 414 | | |
413 | 415 | | |
| |||
416 | 418 | | |
417 | 419 | | |
418 | 420 | | |
| 421 | + | |
419 | 422 | | |
420 | 423 | | |
421 | 424 | | |
| |||
0 commit comments