@@ -35,7 +35,6 @@ class DataFrame(object):
35
35
def __init__ (self , ** kwargs ):
36
36
self ._client = kwargs .get ('client' , None )
37
37
self ._mapping = kwargs .get ('mapping' , None )
38
-
39
38
self ._index = list (self ._mapping .keys ())[0 ] if self ._mapping else None
40
39
self ._doc_type = DataFrame ._get_doc_type (self ._mapping ) if self ._mapping else None
41
40
self ._columns = sorted (DataFrame ._get_cols (self ._mapping )) if self ._mapping else None
@@ -281,7 +280,8 @@ def _execute(self):
281
280
282
281
res_dict = self ._client .post (data = self ._build_query ())
283
282
if self ._aggregation is None and self ._groupby is None :
284
- query = Select .from_dict (res_dict )
283
+ query = Select ()
284
+ query .explain_result (res_dict )
285
285
else :
286
286
query = Agg .from_dict (res_dict )
287
287
return query
@@ -319,6 +319,7 @@ def count(self):
319
319
[2, 1]
320
320
"""
321
321
df = DataFrame (client = self ._client ,
322
+ include_meta_fields = self ._include_meta_fields ,
322
323
mapping = self ._mapping ,
323
324
filter = self ._filter ,
324
325
groupby = self ._groupby ,
@@ -348,14 +349,18 @@ def show(self, n=10000, truncate=15):
348
349
assert n > 0
349
350
350
351
if self ._aggregation :
351
- raise TypeError ('show() is not allowed for aggregation. use collect() instead' )
352
+ raise DataFrameException ('show() is not allowed for aggregation. use collect() instead' )
352
353
353
354
query = self ._execute ()
354
355
355
356
if self ._projection :
356
357
cols = [col .field_name () for col in self ._projection ]
357
358
else :
358
359
cols = self .columns
360
+
361
+ if cols is None :
362
+ raise _unbound_index_err
363
+
359
364
sys .stdout .write (query .result_as_tabular (cols , n , truncate ))
360
365
sys .stdout .write ('time: {0}ms\n ' .format (query .millis_taken ))
361
366
0 commit comments