Skip to content

fix: correct isinstance check to include bytearray in kafka conversion#265

Closed
archy-rock3t-cloud wants to merge 1 commit intocloudevents:mainfrom
sophotechlabs:fix/kafka-bytearray-isinstance
Closed

fix: correct isinstance check to include bytearray in kafka conversion#265
archy-rock3t-cloud wants to merge 1 commit intocloudevents:mainfrom
sophotechlabs:fix/kafka-bytearray-isinstance

Conversation

@archy-rock3t-cloud
Copy link

to_structured() in kafka/conversion.py has isinstance(data, (bytes, bytes, memoryview))
where bytes is listed twice. The second bytes should be bytearray, matching
the pattern used elsewhere in the codebase (e.g., event/base.py line 215).

Without this fix, bytearray data in structured Kafka CloudEvents is not
base64-encoded as expected by the spec.

Signed-off-by: Artem Muterko <artem@sopho.tech>
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