-
Notifications
You must be signed in to change notification settings - Fork 102
/
MLDB-1921_merge_ds_strings.py
40 lines (32 loc) · 1.13 KB
/
MLDB-1921_merge_ds_strings.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#
# MLDB-1921_merge_ds_strings.py
# Francois-Michel L'Heureux, 2016-09-30
# This file is part of MLDB. Copyright 2016 Datacratic. All rights reserved.
#
mldb = mldb_wrapper.wrap(mldb) # noqa
class Mldb1921MergeDsStrings(MldbUnitTest): # noqa
@classmethod
def setUpClass(cls):
ds = mldb.create_dataset({'id' : 'ds1', 'type' : 'sparse.mutable'})
ds.record_row('row1', [['A', 1, 0]])
ds.commit()
ds = mldb.create_dataset({'id' : 'ds2', 'type' : 'sparse.mutable'})
ds.record_row('row1', [['B', 2, 0]])
ds.commit()
@unittest.expectedFailure
def test_it(self):
mldb.put('/v1/datasets/merged_ds', {
'type' : 'merged',
'params' : {
'datasets' : ['ds1', 'ds2']
# explicit way to define datasets
#'datasets' : [{'id' : 'ds1'}, {'id' : 'ds2'}]
}
})
res = mldb.query("SELECT A, B FROM merged_ds ORDER BY rowName()")
self.assertTableResultEquals(res, [
['_rowName', 'A', 'B'],
['row1', 1, 2]
])
if __name__ == '__main__':
mldb.run_tests()