Commit 0af3e08
fix(io): format dataframe-level checks in to_script
to_script(minimal=False) interpolated the raw statistics list for
dataframe-level checks straight into the script template, while the
column path 19 lines above formats its checks with _format_checks.
The generated script runs and looks correct, but the schema it builds
carries plain dicts where Check objects belong. Every validate() call on
it then fails with TypeError("'dict' object is not callable"), including
on data the original schema accepts, so the round-tripped schema is
unusable rather than merely wrong.
Format dataframe-level checks the same way the column path does.
_format_checks(None) already returns "None", so schemas without
dataframe-level checks are unaffected.
The existing test_to_script only covers column checks, so this path was
untested; add a round-trip test with a dataframe-level check.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 9d86aed commit 0af3e08
2 files changed
Lines changed: 23 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
838 | 838 | | |
839 | 839 | | |
840 | 840 | | |
841 | | - | |
| 841 | + | |
842 | 842 | | |
843 | 843 | | |
844 | 844 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1547 | 1547 | | |
1548 | 1548 | | |
1549 | 1549 | | |
| 1550 | + | |
| 1551 | + | |
| 1552 | + | |
| 1553 | + | |
| 1554 | + | |
| 1555 | + | |
| 1556 | + | |
| 1557 | + | |
| 1558 | + | |
| 1559 | + | |
| 1560 | + | |
| 1561 | + | |
| 1562 | + | |
| 1563 | + | |
| 1564 | + | |
| 1565 | + | |
| 1566 | + | |
| 1567 | + | |
| 1568 | + | |
| 1569 | + | |
| 1570 | + | |
| 1571 | + | |
1550 | 1572 | | |
1551 | 1573 | | |
1552 | 1574 | | |
| |||
0 commit comments