Skip to content

Commit 8d7b97f

Browse files
committed
explicit public apis
1 parent f2131e6 commit 8d7b97f

File tree

8 files changed

+25
-3
lines changed

8 files changed

+25
-3
lines changed

pyiceberg/avro/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,8 @@
2121
STRUCT_DOUBLE = struct.Struct("<d") # little-endian double
2222
STRUCT_INT32 = struct.Struct("<i")
2323
STRUCT_INT64 = struct.Struct("<q")
24+
25+
# Imported after struct constants to avoid circular imports in encoder/decoder.
26+
from pyiceberg.avro.file import AvroFile, AvroFileHeader, AvroOutputFile # noqa: E402
27+
28+
__all__ = ["AvroFile", "AvroFileHeader", "AvroOutputFile"]

pyiceberg/avro/codecs/__init__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,10 @@
5050

5151
# Map to convert the naming from Iceberg to Avro
5252
CODEC_MAPPING_ICEBERG_TO_AVRO: dict[str, str] = {"gzip": "deflate", "zstd": "zstandard"}
53+
54+
__all__ = [
55+
"AvroCompressionCodec",
56+
"AVRO_CODEC_KEY",
57+
"CODEC_MAPPING_ICEBERG_TO_AVRO",
58+
"KNOWN_CODECS",
59+
]

pyiceberg/avro/decoder.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@
1717
import io
1818
from abc import ABC, abstractmethod
1919
from io import SEEK_CUR
20-
from typing import (
21-
cast,
22-
)
20+
from typing import cast
2321

2422
from pyiceberg.avro import STRUCT_DOUBLE, STRUCT_FLOAT
2523
from pyiceberg.io import InputStream
2624
from pyiceberg.typedef import UTF8
2725

26+
__all__: list[str] = []
27+
2828

2929
class BinaryDecoder(ABC):
3030
"""Decodes bytes into Python physical primitives."""

pyiceberg/avro/encoder.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
from pyiceberg.io import OutputStream
2222
from pyiceberg.typedef import UTF8
2323

24+
__all__: list[str] = []
25+
2426

2527
class BinaryEncoder:
2628
"""Encodes Python physical types into bytes."""

pyiceberg/avro/file.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@
5050
)
5151
from pyiceberg.utils.schema_conversion import AvroSchemaConversion
5252

53+
__all__: list[str] = []
54+
5355
VERSION = 1
5456
MAGIC = bytes(b"Obj" + bytearray([VERSION]))
5557
MAGIC_SIZE = len(MAGIC)

pyiceberg/avro/reader.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@
4444
from pyiceberg.utils.lazydict import LazyDict
4545
from pyiceberg.utils.singleton import Singleton
4646

47+
__all__: list[str] = []
48+
4749

4850
def _skip_map_array(decoder: BinaryDecoder, skip_entry: Callable[[], None]) -> None:
4951
"""Skips over an array or map.

pyiceberg/avro/resolver.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@
107107
UUIDType,
108108
)
109109

110+
__all__: list[str] = []
111+
110112
STRUCT_ROOT = -1
111113

112114

pyiceberg/avro/writer.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@
3636
from pyiceberg.utils.decimal import decimal_required_bytes, decimal_to_bytes
3737
from pyiceberg.utils.singleton import Singleton
3838

39+
__all__: list[str] = []
40+
3941

4042
@dataclass(frozen=True)
4143
class Writer(Singleton):

0 commit comments

Comments
 (0)