def _normalize(self, name, columns, points):
        """Normalize data for the InfluxDB's data model."""

        for i, _ in enumerate(points):
            # Supported type:
            # https://docs.influxdata.com/influxdb/v1.5/write_protocols/line_protocol_reference/
            if points[i] is None:
                # Ignore points with None value
                del(points[i])
                del(columns[i])
                continue
            try:
                points[i] = float(points[i])
            except (TypeError, ValueError):
                pass
            else:
                continue
            try:
                points[i] = str(points[i])
            except (TypeError, ValueError):
                pass
            else:
                continue

        return [{'measurement': name,
                 'tags': self.parse_tags(self.tags),
                 'fields': dict(zip(columns, points))}]
def _normalize ( self , name , columns , points ) : for i , _ in enumerate ( points ) : if points [ i ] is None : del ( points [ i ] ) del ( columns [ i ] ) continue try : points [ i ] = float ( points [ i ] ) except ( TypeError , ValueError ) : pass else : continue try : points [ i ] = str ( points [ i ] ) except ( TypeError , ValueError ) : pass else : continue return [ { 'measurement' : name , 'tags' : self . parse_tags ( self . tags ) , 'fields' : dict ( zip ( columns , points ) ) } ]
Normalize data for the InfluxDB's data model.