fix(diff): cast daterange and rerun row fetches to text so repairs work#143
fix(diff): cast daterange and rerun row fetches to text so repairs work#143mason-sharp wants to merge 1 commit into
Conversation
IsKnownScalarType matched format_type names by prefix, so "daterange" passed as "date" and was the one complex type still fetched un-cast -- its Go-struct form in the diff report failed the whole upsert batch on repair (malformed range literal). Strip the typmod and require an exact match, which also covers datemultirange and UDTs sharing a scalar's prefix. table-rerun's row fetch never applied the cast policy at all; it now consults the same NeedsTextCast so rerun reports stay repairable. The typed-columns integration test gains a daterange column and a rerun leg; the cast-policy decision table covers the collision cases.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughIntroduces a NeedsTextCast helper function that centralizes logic for determining when column values must be cast to TEXT in diff SELECT expressions, based on rewritten scalar-type detection. This is wired into the table rerun fetch query, covered by unit tests, and validated in integration tests via a new daterange column and rerun-mode diff assertion. ChangesType-Aware TEXT Casting for Diff Rerun
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 0 |
| Duplication | 0 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
IsKnownScalarType matched format_type names by prefix, so "daterange" passed as "date" and was the one complex type still fetched un-cast -- its Go-struct form in the diff report failed the whole upsert batch on repair (malformed range literal). Strip the typmod and require an exact match, which also covers datemultirange and UDTs sharing a scalar's prefix.
table-rerun's row fetch never applied the cast policy at all; it now consults the same NeedsTextCast so rerun reports stay repairable.
The typed-columns integration test gains a daterange column and a rerun leg; the cast-policy decision table covers the collision cases.