Skip to content

Register to_bytes for UnknownType - #3899

Open
rambleraptor wants to merge 1 commit into
apache:mainfrom
rambleraptor:unknown-type-conversions
Open

Register to_bytes for UnknownType#3899
rambleraptor wants to merge 1 commit into
apache:mainfrom
rambleraptor:unknown-type-conversions

Conversation

@rambleraptor

Copy link
Copy Markdown
Collaborator

Rationale for this change

from_bytes and partition_to_py both handle UnknownType, but to_bytes did not.

Are these changes tested?

Just added unit tests

Are there any user-facing changes?

`from_bytes` and `partition_to_py` both handle `UnknownType`, but
`to_bytes` did not, so serializing an unknown value fell through to the
dispatch fallback and raised. Unknown values are always null and have no
binary representation, so return None, matching `Conversions.toByteBuffer`
in the Java implementation.

The JSON single-value entry points are deliberately left unregistered:
the spec defines no JSON representation for unknown, since a non-null
initial-default or write-default is invalid for the type.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant