Repository navigation
Fix misleading error messages in conversions dispatch fallbacks - #3856
takayoshi-makabe wants to merge 3 commits into
Conversation
|
This pull request has been marked as stale due to 30 days of inactivity. It will be closed in 1 week if no further activity occurs. If you think that's incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the dev@iceberg.apache.org list. Thank you for your contributions. |
eefd5b4 to
528e3a7
Compare
The pinned ref fac544c (v8.2.0) was dropped from the ASF allowlist when it expired on 2026-09-27, so asf-allowlist-check fails on every pull request. v10.2.0 is the only setup-uv entry left without an expires_at.
|
@ebyhr @kevinjqliu Friendly ping — this is a small fix and CI is green. Would you mind taking a look when you have time? Happy to address any feedback. |
|
This pull request has been marked as stale due to 30 days of inactivity. It will be closed in 1 week if no further activity occurs. If you think that's incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the dev@iceberg.apache.org list. Thank you for your contributions. |
Rationale for this change
The
singledispatchfallbacks inconversions.pydescribe the wrong operation, so an unregistered type produces a message that sends you looking in the wrong place. Passing a type with no registered implementation to each of the five entry points today:This reworks the three to follow the shape
from_bytesalready uses, so each names the operation it performs and the value it rejected:partition_to_pyandfrom_bytesare already accurate and are left alone.One small change beyond the strings:
to_bytestakes its value parameter asvalueinstead of_so the message can include it, matching the other four. It is rendered with!r, likefrom_bytes, because the parameter also acceptsbytes.Are these changes tested?
Yes.
test_raise_on_unregistered_typeasserted the oldto_byteswording, so it is updated.to_jsonandfrom_jsonhad no fallback coverage at all — which is how the copied text survived — so cases for both are added and all five entry points are now covered.Are there any user-facing changes?
Only the text of these
TypeErrormessages. No behaviour changes: the same inputs raise the same exception type in the same places.