1 parent 0211bc1 commit f7f4f42Copy full SHA for f7f4f42
2 files changed
python/functionstream-api-advanced/src/fs_api_advanced/codec/bool_codec.py
@@ -15,6 +15,10 @@
15
16
class BoolCodec(Codec[bool]):
17
supports_ordered_keys = True
18
+ _SIZE = 1
19
+
20
+ def encoded_size(self) -> int:
21
+ return self._SIZE
22
23
def encode(self, value: bool) -> bytes:
24
return b"\x01" if value else b"\x00"
python/functionstream-api-advanced/src/fs_api_advanced/codec/float_codec.py
@@ -18,6 +18,10 @@
class FloatCodec(Codec[float]):
"""Ordered float codec for range scans (lexicographic byte order)."""
+ _SIZE = 8
25
26
def encode(self, value: float) -> bytes:
27
bits = struct.unpack(">Q", struct.pack(">d", value))[0]
0 commit comments