Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "timdex_dataset_api"
version = "4.0.0"
version = "4.1.0"
description = "Python library for interacting with a TIMDEX parquet dataset"
readme = "README.md"
requires-python = ">=3.12"
Expand Down
4 changes: 1 addition & 3 deletions timdex_dataset_api/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -622,9 +622,7 @@ def _iter_data_chunks(self, data_query: str) -> Iterator[pa.RecordBatch]:
self.conn.execute("""set threads=16;""")
try:
cursor = self.conn.execute(data_query)
yield from cursor.fetch_record_batch(
rows_per_batch=self.config.read_batch_size
)
yield from cursor.to_arrow_reader(batch_size=self.config.read_batch_size)
finally:
if self.location_scheme == "s3":
self.conn.execute(f"""set threads={self.conn_factory.threads};""")
Expand Down
4 changes: 2 additions & 2 deletions timdex_dataset_api/embeddings.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,8 +372,8 @@ def read_batches_iter(
**filters,
)
cursor = self.conn.execute(data_query)
yield from cursor.fetch_record_batch(
rows_per_batch=self.timdex_dataset.config.read_batch_size
yield from cursor.to_arrow_reader(
batch_size=self.timdex_dataset.config.read_batch_size
)

logger.debug(f"read() elapsed: {round(time.perf_counter() - start_time, 2)}s")
Expand Down
1 change: 1 addition & 0 deletions timdex_dataset_api/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ def _install_extensions(self, conn: DuckDBPyConnection) -> None:
secrets_dir.mkdir(parents=True, exist_ok=True)
extensions_dir.mkdir(parents=True, exist_ok=True)

conn.execute(f"set home_directory='{duckdb_home.as_posix()}';")
conn.execute(f"set secret_directory='{secrets_dir.as_posix()}';")
conn.execute(f"set extension_directory='{extensions_dir.as_posix()}';")

Expand Down
Loading
Loading