From 42f59e99df10b255814dbf87c05b9e45b7cec360 Mon Sep 17 00:00:00 2001 From: Frederic Fortier Date: Mon, 11 Dec 2017 20:00:45 -0500 Subject: [PATCH] BLD: improving stats upload --- catalyst/exchange/stats_utils.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/catalyst/exchange/stats_utils.py b/catalyst/exchange/stats_utils.py index 6c5d49bd..052f3e2d 100644 --- a/catalyst/exchange/stats_utils.py +++ b/catalyst/exchange/stats_utils.py @@ -338,11 +338,13 @@ def stats_to_s3(uri, stats, algo_namespace, recorded_cols=None, if bytes_to_write is None: bytes_to_write = get_csv_stats(stats, recorded_cols=recorded_cols) - timestr = time.strftime('%Y%m%d') + now = pd.Timestamp.utcnow() + timestr = now.strftime('%Y%m%d') + pid = os.getpid() parts = uri.split('//') - obj = s3.Object(parts[1], '{}/{}-{}.csv'.format( - folder, timestr, algo_namespace + obj = s3.Object(parts[1], '{}/{}-{}-{}.csv'.format( + folder, timestr, algo_namespace, pid )) obj.put(Body=bytes_to_write)