mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Set the epoch timestamp when uploading data to dynamoDB (#130273)
This is to move away the `_event_time` field from Rockset, which we cannot use when reimport the data Pull Request resolved: https://github.com/pytorch/pytorch/pull/130273 Approved by: https://github.com/clee2000
This commit is contained in:
@ -4,6 +4,8 @@ import gzip
|
||||
import io
|
||||
import json
|
||||
import os
|
||||
|
||||
import time
|
||||
import zipfile
|
||||
from pathlib import Path
|
||||
from typing import Any, Callable, Dict, List, Optional
|
||||
@ -153,6 +155,9 @@ def upload_to_dynamodb(
|
||||
for doc in docs:
|
||||
if generate_partition_key:
|
||||
doc["dynamoKey"] = generate_partition_key(repo, doc)
|
||||
# This is to move away the _event_time field from Rockset, which we cannot use when
|
||||
# reimport the data
|
||||
doc["timestamp"] = int(round(time.time() * 1000))
|
||||
batch.put_item(Item=doc)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user