12
12
from gooddata_sdk .catalog .catalog_service_base import CatalogServiceBase
13
13
from gooddata_sdk .catalog .data_source .validation .data_source import DataSourceValidator
14
14
from gooddata_sdk .catalog .depends_on import CatalogDependsOn , CatalogDependsOnDateFilter
15
+ from gooddata_sdk .catalog .filter_by import CatalogFilterBy
15
16
from gooddata_sdk .catalog .types import ValidObjects
16
17
from gooddata_sdk .catalog .validate_by_item import CatalogValidateByItem
17
18
from gooddata_sdk .catalog .workspace .declarative_model .workspace .analytics_model .analytics_model import (
@@ -564,6 +565,8 @@ def get_label_elements(
564
565
label_id : LabelElementsInputType ,
565
566
depends_on : Optional [List [DependsOnItem ]] = None ,
566
567
validate_by : Optional [List [CatalogValidateByItem ]] = None ,
568
+ exact_filter : Optional [List [str ]] = None ,
569
+ filter_by : Optional [CatalogFilterBy ] = None ,
567
570
) -> List [str ]:
568
571
"""
569
572
Get existing values for a label.
@@ -580,6 +583,11 @@ def get_label_elements(
580
583
Optional parameter specifying dependencies on other labels or date filters.
581
584
validate_by (Optional[List[CatalogValidateByItem]]):
582
585
Optional parameter specifying validation metrics, attributes, labels or facts.
586
+ exact_filter (Optional[List[str]]):
587
+ Optional parameter specifying exact filter values.
588
+ filter_by (Optional[CatalogFilterBy]):
589
+ Optional parameter specifying which label is used for filtering - primary or requested.
590
+ If omitted the server will use the default value of "REQUESTED"
583
591
Returns:
584
592
list of label values
585
593
"""
@@ -597,6 +605,13 @@ def get_label_elements(
597
605
request = ElementsRequest (
598
606
label = label_id , depends_on = [d .to_api () for d in depends_on ], validate_by = [v .to_api () for v in validate_by ]
599
607
)
608
+
609
+ if exact_filter is not None :
610
+ request .exact_filter = exact_filter
611
+
612
+ if filter_by is not None :
613
+ request .filter_by = filter_by .to_api ()
614
+
600
615
# TODO - fix return type of Paging.next in Backend + add support for this API to SDK
601
616
values = self ._actions_api .compute_label_elements_post (workspace_id , request , _check_return_type = False )
602
617
return [v ["title" ] for v in values ["elements" ]]
0 commit comments