from __future__ import annotations import io from .object_store import ObjectStore, S3ObjectStore def open_csv_text(store: ObjectStore, key: str, *, buffer_s3: bool) -> io.TextIOBase: if buffer_s3 and isinstance(store, S3ObjectStore): return io.TextIOWrapper(io.BytesIO(store.read_bytes(key)), encoding="utf-8", newline="") return store.open_text(key) __all__ = ["open_csv_text"]