Skip to content

Commit

Permalink
Allow passing basename_template to catalog.write_data (#1303)
Browse files Browse the repository at this point in the history
  • Loading branch information
limx0 authored Oct 24, 2023
1 parent 035b4fa commit 28808db
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion nautilus_trader/persistence/catalog/parquet.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,11 +254,13 @@ def _fast_write(
table: pa.Table,
path: str,
fs: fsspec.AbstractFileSystem,
basename_template: str = "part-{i}",
) -> None:
name = basename_template.format(i=0)
fs.mkdirs(path, exist_ok=True)
pq.write_table(
table,
where=f"{path}/part-0.parquet",
where=f"{path}/{name}.parquet",
filesystem=fs,
row_group_size=self.max_rows_per_group,
)
Expand Down

0 comments on commit 28808db

Please sign in to comment.