@@ -299,20 +299,20 @@ def _compute(
299
299
#
300
300
301
301
302
- def _extract_for_metrics_only (response : Execution , cols : list , col_to_metric_idx : dict ) -> dict :
302
+ def _extract_for_metrics_only (execution : Execution , cols : list , col_to_metric_idx : dict ) -> dict :
303
303
"""
304
304
Internal function that extracts data for metrics-only columns when there are no attribute columns.
305
305
306
306
Args:
307
- response (Execution): The execution response to extract data from.
307
+ execution (Execution): The execution response to extract data from.
308
308
cols (list): A list of column names.
309
309
col_to_metric_idx (dict): A mapping of pandas column names to metric dimension indices.
310
310
311
311
Returns:
312
312
dict: A dictionary containing the extracted data.
313
313
"""
314
- exec_def = response .exec_def
315
- result = response .read_result (len (exec_def .metrics ))
314
+ exec_def = execution .exec_def
315
+ result = execution .read_result (len (exec_def .metrics ))
316
316
if len (result .data ) == 0 :
317
317
return {col : [] for col in cols }
318
318
@@ -345,7 +345,7 @@ def _typed_result(attributes: list[CatalogAttribute], attribute: Attribute, resu
345
345
346
346
347
347
def _extract_from_attributes_and_maybe_metrics (
348
- response : Execution ,
348
+ execution : Execution ,
349
349
attributes : list [CatalogAttribute ],
350
350
cols : list [str ],
351
351
col_to_attr_idx : dict [str , int ],
@@ -357,7 +357,7 @@ def _extract_from_attributes_and_maybe_metrics(
357
357
optionally metrics columns.
358
358
359
359
Args:
360
- response (Execution): The execution response to extract data from.
360
+ execution (Execution): The execution response to extract data from.
361
361
attributes (list[CatalogAttribute]): The catalog of attributes.
362
362
cols (list[str]): A list of column names.
363
363
col_to_attr_idx (dict[str, int]): A mapping of pandas column names to attribute dimension indices.
@@ -370,11 +370,11 @@ def _extract_from_attributes_and_maybe_metrics(
370
370
- dict: A dictionary containing the extracted data.
371
371
- dict: A dictionary containing the extracted index data.
372
372
"""
373
- exec_def = response .exec_def
373
+ exec_def = execution .exec_def
374
374
offset = [0 for _ in exec_def .dimensions ]
375
375
limit = [len (exec_def .metrics ), _RESULT_PAGE_LEN ] if exec_def .has_metrics () else [_RESULT_PAGE_LEN ]
376
376
attribute_dim = 1 if exec_def .has_metrics () else 0
377
- result = response .read_result (limit = limit , offset = offset )
377
+ result = execution .read_result (limit = limit , offset = offset )
378
378
safe_index_to_attr_idx = index_to_attr_idx if index_to_attr_idx is not None else dict ()
379
379
380
380
# mappings from column name to Attribute
@@ -401,7 +401,7 @@ def _extract_from_attributes_and_maybe_metrics(
401
401
break
402
402
403
403
offset [attribute_dim ] = result .next_page_start (attribute_dim )
404
- result = response .read_result (limit = limit , offset = offset )
404
+ result = execution .read_result (limit = limit , offset = offset )
405
405
406
406
return data , index
407
407
@@ -442,20 +442,20 @@ def compute_and_extract(
442
442
filter_by = filter_by ,
443
443
)
444
444
445
- response , col_to_attr_idx , col_to_metric_idx , index_to_attr_idx = result
445
+ execution , col_to_attr_idx , col_to_metric_idx , index_to_attr_idx = result
446
446
447
447
if on_execution_submitted is not None :
448
- on_execution_submitted (response )
448
+ on_execution_submitted (execution )
449
449
450
- exec_def = response .exec_def
450
+ exec_def = execution .exec_def
451
451
cols = list (columns .keys ())
452
452
453
453
if not exec_def .has_attributes ():
454
- return _extract_for_metrics_only (response , cols , col_to_metric_idx ), dict ()
454
+ return _extract_for_metrics_only (execution , cols , col_to_metric_idx ), dict ()
455
455
else :
456
456
attributes = get_catalog_attributes_for_extract (sdk , workspace_id , exec_def .attributes )
457
457
return _extract_from_attributes_and_maybe_metrics (
458
- response ,
458
+ execution ,
459
459
attributes ,
460
460
cols ,
461
461
col_to_attr_idx ,
0 commit comments