gooddata_sdk.catalog.workspace.model_container.CatalogWorkspaceContent
- class gooddata_sdk.catalog.workspace.model_container.CatalogWorkspaceContent(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)Returns a new instance of catalog which contains only those datasets (attributes and facts) that are valid in the provided context.
create_workspace_content_catalog
(...)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.Attribute, gooddata_sdk.compute.model.metric.Metric, gooddata_sdk.compute.model.base.Filter, gooddata_sdk.catalog.workspace.entity_model.content_objects.dataset.CatalogLabel, gooddata_sdk.catalog.workspace.entity_model.content_objects.dataset.CatalogFact, gooddata_sdk.catalog.workspace.entity_model.content_objects.metric.CatalogMetric, List[Union[gooddata_sdk.compute.model.attribute.Attribute, gooddata_sdk.compute.model.metric.Metric, gooddata_sdk.compute.model.base.Filter, gooddata_sdk.catalog.workspace.entity_model.content_objects.dataset.CatalogLabel, gooddata_sdk.catalog.workspace.entity_model.content_objects.dataset.CatalogFact, gooddata_sdk.catalog.workspace.entity_model.content_objects.metric.CatalogMetric]], gooddata_sdk.compute.model.execution.ExecutionDefinition]) gooddata_sdk.catalog.workspace.model_container.CatalogWorkspaceContent
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.base.ObjId, Dict[str, Dict[str, str]], Dict[str, str]]) Optional[gooddata_sdk.catalog.workspace.entity_model.content_objects.dataset.CatalogAttribute]
Get attribute by label id.
- get_dataset(dataset_id: Union[str, gooddata_sdk.compute.model.base.ObjId]) Optional[gooddata_sdk.catalog.workspace.entity_model.content_objects.dataset.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.base.ObjId]) Optional[gooddata_sdk.catalog.workspace.entity_model.content_objects.metric.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