Skip to content

Commit c18c950

Browse files
author
srikris
committed
Python 3 fix for PR: #172 from dato-code/added-groupby-aggregates
PR #172 fails on Python 3 because of None comparisons. - In Python 2: None < 1 - In Python 3: None < 2 returns an error. The test case was changed to compare list([1,None]) where the order is interchangable to comparisons on set([1,None]).
1 parent ea65a77 commit c18c950

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

oss_src/unity/python/sframe/test/test_sframe.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1151,8 +1151,8 @@ def test_min_max_with_missing_values(self):
11511151
self.assertEqual(sf2['Var of value'], [1, 0])
11521152
self.assertEqual(sf2['Stdv of value'], [1, 0])
11531153
self.assertEqual(sf2['Count Distinct of value'], [2, 1])
1154-
self.assertEqual(sorted(sf2['Distinct of value'][0]), sorted([1, None]))
1155-
self.assertEqual(sorted(sf2['Distinct of value'][1]), sorted([None]))
1154+
self.assertEqual(set(sf2['Distinct of value'][0]), set([1, None]))
1155+
self.assertEqual(set(sf2['Distinct of value'][1]), set([None]))
11561156
self.assertEqual(sf2['Frequency Count of value'][0], {1:1, None:5})
11571157
self.assertEqual(sf2['Frequency Count of value'][1], {None:4})
11581158

0 commit comments

Comments
 (0)