Skip to content

Commit 89fabd9

Browse files
fix: correct isinstance check to include bytearray in kafka conversion
Signed-off-by: Artem Muterko <artem@sopho.tech>
1 parent a38933d commit 89fabd9

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

cloudevents/kafka/conversion.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ def to_structured(
207207
raise cloud_exceptions.DataMarshallerError(
208208
f"Failed to marshall data with error: {type(e).__name__}('{e}')"
209209
)
210-
if isinstance(data, (bytes, bytes, memoryview)):
210+
if isinstance(data, (bytes, bytearray, memoryview)):
211211
attrs["data_base64"] = base64.b64encode(data).decode("ascii")
212212
else:
213213
attrs["data"] = data

0 commit comments

Comments
 (0)