gooddata_sdk.catalog.Catalog

class gooddata_sdk.catalog.Catalog(valid_obj_fun: functools.partial[dict[str, set[str]]], datasets: list[CatalogDataset], metrics: list[CatalogMetric])

Bases: object

__init__(valid_obj_fun: functools.partial[dict[str, set[str]]], datasets: list[CatalogDataset], metrics: list[CatalogMetric]) None

Methods

__init__(valid_obj_fun, datasets, metrics)

catalog_with_valid_objects(ctx)

Returns a new instance of catalog which contains only those datasets (attributes and facts) that are valid in the provided context.

find_label_attribute(id_obj)

Get attribute by label id.

get_dataset(dataset_id)

Gets dataset by id.

get_metric(metric_id)

Gets metric by id.

Attributes

datasets

metrics

catalog_with_valid_objects(ctx: Union[gooddata_sdk.compute_model.Attribute, gooddata_sdk.compute_model.Metric, gooddata_sdk.compute_model.Filter, gooddata_sdk.catalog.CatalogLabel, gooddata_sdk.catalog.CatalogFact, gooddata_sdk.catalog.CatalogMetric, List[Union[gooddata_sdk.compute_model.Attribute, gooddata_sdk.compute_model.Metric, gooddata_sdk.compute_model.Filter, gooddata_sdk.catalog.CatalogLabel, gooddata_sdk.catalog.CatalogFact, gooddata_sdk.catalog.CatalogMetric]], gooddata_sdk.compute.ExecutionDefinition]) gooddata_sdk.catalog.Catalog

Returns a new instance of catalog which contains only those datasets (attributes and facts) that are valid in the provided context. The context is composed of one more more entities of the semantic model and the filtered catalog will contain only those entities that can be safely added on top of that existing context.

Parameters

ctx – existing context. you can specify context in one of the following ways: - single item or list of items from the execution model - single item or list of items from catalog model; catalog fact, label or metric may be added - the entire execution definition that is used to compute analytics

Returns

find_label_attribute(id_obj: Union[str, gooddata_sdk.compute_model.ObjId, Dict[str, Dict[str, str]], Dict[str, str]]) Optional[gooddata_sdk.catalog.CatalogAttribute]

Get attribute by label id.

get_dataset(dataset_id: Union[str, gooddata_sdk.compute_model.ObjId]) Optional[gooddata_sdk.catalog.CatalogDataset]

Gets dataset by id. The id can be either an instance of ObjId or string containing serialized ObjId (‘dataset/some.dataset.id’) or contain just the id part (‘some.dataset.id’).

Parameters

dataset_id – fully qualified dataset entity id (type/id) or just the identifier of dataset entity

Returns

instance of CatalogDataset or None if no such dataset in catalog

:rtype CatalogDataset

get_metric(metric_id: Union[str, gooddata_sdk.compute_model.ObjId]) Optional[gooddata_sdk.catalog.CatalogMetric]

Gets metric by id. The id can be either an instance of ObjId or string containing serialized ObjId (‘metric/some.metric.id’) or contain just the id part (‘some.metric.id’).

Parameters

metric_id – fully qualified metric entity id (type/id) or just the identifier of metric entity

Returns

instance of CatalogMetric or None if no such metric in catalog

:rtype CatalogMetric