From bc55cd33334d6c86d0c853aece4ec2cc711882cd Mon Sep 17 00:00:00 2001 From: Ryan Rawdon Date: Wed, 12 Jun 2019 15:25:13 -0400 Subject: [PATCH] Altering rrd2whisper.py to use listcomp instead of filter() for py3 compatibility with len(), to fix #278 --- bin/rrd2whisper.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/rrd2whisper.py b/bin/rrd2whisper.py index 0fde5302..1c5ea7bb 100755 --- a/bin/rrd2whisper.py +++ b/bin/rrd2whisper.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/home/rrawdon/git/whisper-env/bin/python3 import errno import os @@ -157,7 +157,7 @@ values = [row[column_index] for row in rows] timestamps = list(range(*time_info)) datapoints = zip(timestamps, values) - datapoints = filter(lambda p: p[1] is not None, datapoints) + datapoints = [datapoint for datapoint in datapoints if datapoint[1] is not None] print(' migrating %d datapoints from archive %d' % (len(datapoints), archiveNumber)) archiveNumber -= 1 whisper.update_many(path, datapoints)