Skip to content

Commit 54e2b9d

Browse files
committed
feat: Partition GCS blobs by symbol and simplify the final parquet filename to only include time.
1 parent e235855 commit 54e2b9d

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

processor/load/gcs.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@ def save(self, data_type, data):
1616

1717
blob_name = (
1818
f"core/{data_type}/"
19+
f"symbol={self.symbol}/"
1920
f"year={now.strftime('%Y')}/"
2021
f"month={now.strftime('%m')}/"
2122
f"day={now.strftime('%d')}/"
22-
f"{now.strftime('%Y-%m-%d %H:%M')}_{self.symbol}.parquet"
23+
f"{now.strftime('%H:%M')}.parquet"
2324
)
2425
self.gcs.upload_parquet(blob_name, df)

shared/worker/redis_to_gcs.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,11 @@ async def _transfer(self, data_type: str):
6262

6363
blob_name = (
6464
f"{self.gcs_path_prefix}/{data_type}/"
65+
f"symbol={SYMBOL}/"
6566
f"year={now.strftime('%Y')}/"
6667
f"month={now.strftime('%m')}/"
6768
f"day={now.strftime('%d')}/"
68-
f"{now.strftime('%Y-%m-%d %H:%M')}_{SYMBOL}.parquet"
69+
f"{now.strftime('%H:%M')}.parquet"
6970
)
7071

7172
self.gcs.upload_parquet(blob_name, df)

0 commit comments

Comments
 (0)