Skip to content

Commit f5e3e59

Browse files
authored
fix: correct type mismatch in BinaryEncoder write (apache#2460)
1 parent 6e018c8 commit f5e3e59

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pyiceberg/avro/encoder.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,15 @@ def write_boolean(self, boolean: bool) -> None:
3939
Args:
4040
boolean: The boolean to write.
4141
"""
42-
self.write(bytearray([bool(boolean)]))
42+
self.write(bytes([bool(boolean)]))
4343

4444
def write_int(self, integer: int) -> None:
4545
"""Integer and long values are written using variable-length zig-zag coding."""
4646
datum = (integer << 1) ^ (integer >> 63)
4747
while (datum & ~0x7F) != 0:
48-
self.write(bytearray([(datum & 0x7F) | 0x80]))
48+
self.write(bytes([(datum & 0x7F) | 0x80]))
4949
datum >>= 7
50-
self.write(bytearray([datum]))
50+
self.write(bytes([datum]))
5151

5252
def write_float(self, f: float) -> None:
5353
"""Write a float as 4 bytes."""

0 commit comments

Comments
 (0)