From 28808db2ca322a1f3c22d871b8ea0d37592c504a Mon Sep 17 00:00:00 2001 From: Brad Date: Tue, 24 Oct 2023 17:59:30 +1000 Subject: [PATCH] Allow passing basename_template to catalog.write_data (#1303) --- nautilus_trader/persistence/catalog/parquet.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nautilus_trader/persistence/catalog/parquet.py b/nautilus_trader/persistence/catalog/parquet.py index cddbc4e7c08d..f082c00b6d5d 100644 --- a/nautilus_trader/persistence/catalog/parquet.py +++ b/nautilus_trader/persistence/catalog/parquet.py @@ -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, )