Skip to content
This repository was archived by the owner on Jan 24, 2023. It is now read-only.

Commit 5cc881c

Browse files
Ariel Shtulgkorland
authored andcommitted
change return type of range values to float from string (#26)
* change return type of range values to float from string
1 parent 121b612 commit 5cc881c

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

redistimeseries/client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def list_to_dict(aList):
3030
for i in range(len(aList))}
3131

3232
def parse_range(response):
33-
return [tuple((l[0], l[1].decode())) for l in response]
33+
return [tuple((l[0], float(l[1]))) for l in response]
3434

3535
def parse_m_range(response):
3636
res = []
@@ -43,7 +43,7 @@ def parse_m_get(response):
4343
res = []
4444
for item in response:
4545
res.append({ nativestr(item[0]) : [list_to_dict(item[1]),
46-
item[2], nativestr(item[3])]})
46+
item[2], float(item[3])]})
4747
return res
4848

4949
def parseToList(response):

test_commands.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,10 @@ def testMGet(self):
128128
rts.add(1, '*', 15)
129129
rts.add(2, '*', 25)
130130
res = rts.mget(['Test=This'])
131-
self.assertEqual('15', res[0]['1'][2])
132-
self.assertEqual('25', res[1]['2'][2])
131+
self.assertEqual(15, res[0]['1'][2])
132+
self.assertEqual(25, res[1]['2'][2])
133133
res = rts.mget(['Taste=That'])
134-
self.assertEqual('25', res[0]['2'][2])
134+
self.assertEqual(25, res[0]['2'][2])
135135

136136
def testInfo(self):
137137
'''Test TS.INFO calls'''

0 commit comments

Comments
 (0)