OmniSciDB  72c90bc290
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
tests.test_connection.TestExtras Class Reference

Public Member Functions

def test_extract_row_details
 

Detailed Description

Definition at line 103 of file test_connection.py.

Member Function Documentation

def tests.test_connection.TestExtras.test_extract_row_details (   self)

Definition at line 104 of file test_connection.py.

References heavydb._parsers._extract_column_details(), and heavydb._parsers.ColumnDetails.

105  def test_extract_row_details(self):
106  data = [
107  TColumnType(
108  col_name='date_',
109  col_type=TTypeInfo(
110  type=6,
111  encoding=4,
112  nullable=True,
113  is_array=False,
114  precision=0,
115  scale=0,
116  comp_param=32,
117  ),
118  is_reserved_keyword=False,
119  src_name='',
120  ),
121  TColumnType(
122  col_name='trans',
123  col_type=TTypeInfo(
124  type=6,
125  encoding=4,
126  nullable=True,
127  is_array=False,
128  precision=0,
129  scale=0,
130  comp_param=32,
131  ),
132  is_reserved_keyword=False,
133  src_name='',
134  ),
135  TColumnType(
136  col_name='symbol',
137  col_type=TTypeInfo(
138  type=6,
139  encoding=4,
140  nullable=True,
141  is_array=False,
142  precision=0,
143  scale=0,
144  comp_param=32,
145  ),
146  is_reserved_keyword=False,
147  src_name='',
148  ),
149  TColumnType(
150  col_name='qty',
151  col_type=TTypeInfo(
152  type=1,
153  encoding=0,
154  nullable=True,
155  is_array=False,
156  precision=0,
157  scale=0,
158  comp_param=0,
159  ),
160  is_reserved_keyword=False,
161  src_name='',
162  ),
163  TColumnType(
164  col_name='price',
165  col_type=TTypeInfo(
166  type=3,
167  encoding=0,
168  nullable=True,
169  is_array=False,
170  precision=0,
171  scale=0,
172  comp_param=0,
173  ),
174  is_reserved_keyword=False,
175  src_name='',
176  ),
177  TColumnType(
178  col_name='vol',
179  col_type=TTypeInfo(
180  type=3,
181  encoding=0,
182  nullable=True,
183  is_array=False,
184  precision=0,
185  scale=0,
186  comp_param=0,
187  ),
188  is_reserved_keyword=False,
189  src_name='',
190  ),
191  ]
192  result = _extract_column_details(data)
193 
194  expected = [
196  name='date_',
197  type='STR',
198  nullable=True,
199  precision=0,
200  scale=0,
201  comp_param=32,
202  encoding='DICT',
203  is_array=False,
204  ),
206  name='trans',
207  type='STR',
208  nullable=True,
209  precision=0,
210  scale=0,
211  comp_param=32,
212  encoding='DICT',
213  is_array=False,
214  ),
216  name='symbol',
217  type='STR',
218  nullable=True,
219  precision=0,
220  scale=0,
221  comp_param=32,
222  encoding='DICT',
223  is_array=False,
224  ),
226  name='qty',
227  type='INT',
228  nullable=True,
229  precision=0,
230  scale=0,
231  comp_param=0,
232  encoding='NONE',
233  is_array=False,
234  ),
236  name='price',
237  type='FLOAT',
238  nullable=True,
239  precision=0,
240  scale=0,
241  comp_param=0,
242  encoding='NONE',
243  is_array=False,
244  ),
246  name='vol',
247  type='FLOAT',
248  nullable=True,
249  precision=0,
250  scale=0,
251  comp_param=0,
252  encoding='NONE',
253  is_array=False,
254  ),
255  ]
256  assert result == expected
def _extract_column_details
Definition: _parsers.py:145
tuple ColumnDetails
Definition: _parsers.py:23

+ Here is the call graph for this function:


The documentation for this class was generated from the following file: