OmniSciDB  72c90bc290
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
test_results_set.py
Go to the documentation of this file.
1 from heavydb.cursor import make_row_results_set
2 from heavydb.thrift.ttypes import (
3  TRowSet,
4  TColumnType,
5  TColumn,
6  TColumnData,
7  TQueryResult,
8 )
9 from heavydb.common.ttypes import TTypeInfo
10 
11 
13  def test_nulls_handled(self):
14 
15  rs = TQueryResult(
16  TRowSet(
17  row_desc=[
18  TColumnType(
19  col_name='a', col_type=TTypeInfo(type=0, nullable=True)
20  ),
21  TColumnType(
22  col_name='b', col_type=TTypeInfo(type=1, nullable=True)
23  ),
24  TColumnType(
25  col_name='c', col_type=TTypeInfo(type=2, nullable=True)
26  ),
27  TColumnType(
28  col_name='d', col_type=TTypeInfo(type=3, nullable=True)
29  ),
30  TColumnType(
31  col_name='e', col_type=TTypeInfo(type=4, nullable=True)
32  ),
33  TColumnType(
34  col_name='f', col_type=TTypeInfo(type=5, nullable=True)
35  ),
36  TColumnType(
37  col_name='g', col_type=TTypeInfo(type=6, nullable=True)
38  ),
39  TColumnType(
40  col_name='h', col_type=TTypeInfo(type=7, nullable=True)
41  ),
42  TColumnType(
43  col_name='i', col_type=TTypeInfo(type=8, nullable=True)
44  ),
45  TColumnType(
46  col_name='j', col_type=TTypeInfo(type=9, nullable=True)
47  ),
48  TColumnType(
49  col_name='k',
50  col_type=TTypeInfo(type=10, nullable=True),
51  ),
52  ],
53  rows=[],
54  columns=[
55  TColumn(
56  data=TColumnData(int_col=[-2147483648]), nulls=[True]
57  ),
58  TColumn(
59  data=TColumnData(int_col=[-2147483648]), nulls=[True]
60  ),
61  TColumn(
62  data=TColumnData(int_col=[-2147483648]), nulls=[True]
63  ),
64  TColumn(
65  data=TColumnData(real_col=[-2147483648]), nulls=[True]
66  ), # noqa
67  TColumn(
68  data=TColumnData(real_col=[-2147483648]), nulls=[True]
69  ), # noqa
70  TColumn(
71  data=TColumnData(real_col=[-2147483648]), nulls=[True]
72  ), # noqa
73  TColumn(
74  data=TColumnData(str_col=[-2147483648]), nulls=[True]
75  ),
76  TColumn(
77  data=TColumnData(int_col=[-2147483648]), nulls=[True]
78  ),
79  TColumn(
80  data=TColumnData(int_col=[-2147483648]), nulls=[True]
81  ),
82  TColumn(
83  data=TColumnData(int_col=[-2147483648]), nulls=[True]
84  ),
85  TColumn(
86  data=TColumnData(int_col=[-2147483648]), nulls=[True]
87  ),
88  ],
89  is_columnar=True,
90  )
91  )
92 
93  result = list(make_row_results_set(rs))
94  assert result == [(None,) * 11]
def make_row_results_set
Definition: cursor.py:179