Skip to content

Commit

Permalink
Altering rrd2whisper.py to use listcomp instead of filter() for py3 c…
Browse files Browse the repository at this point in the history
…ompatibility with len(), to fix #278
  • Loading branch information
FliesLikeABrick authored and deniszh committed Oct 23, 2019
1 parent 986d7da commit bc55cd3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bin/rrd2whisper.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/home/rrawdon/git/whisper-env/bin/python3

import errno
import os
Expand Down Expand Up @@ -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)

0 comments on commit bc55cd3

Please sign in to comment.