Skip to content

Commit e8724e7

Browse files
committed
feat: add locale to gooddata-sdk
jira: CQ-1650 risk: low
1 parent 898c8fd commit e8724e7

File tree

2 files changed

+15
-0
lines changed
  • packages/gooddata-sdk/src/gooddata_sdk/catalog/workspace

2 files changed

+15
-0
lines changed

packages/gooddata-sdk/src/gooddata_sdk/catalog/workspace/declarative_model/workspace/logical_model/dataset/dataset.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ class CatalogDeclarativeAttribute(Base):
7777
description: Optional[str] = None
7878
tags: Optional[list[str]] = None
7979
is_hidden: Optional[bool] = None
80+
locale: Optional[str] = None
8081

8182
@staticmethod
8283
def client_class() -> type[DeclarativeAttribute]:
@@ -153,6 +154,8 @@ class CatalogDeclarativeLabel(Base):
153154
tags: Optional[list[str]] = None
154155
value_type: Optional[str] = None
155156
is_hidden: Optional[bool] = None
157+
locale: Optional[bool] = None
158+
translations: Optional[dict[str, str]] = None
156159

157160
@staticmethod
158161
def client_class() -> type[DeclarativeLabel]:

packages/gooddata-sdk/src/gooddata_sdk/catalog/workspace/entity_model/content_objects/dataset.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,14 @@ def value_type(self) -> bool:
3636
def is_hidden(self) -> Optional[bool]:
3737
return safeget(self.json_api_attributes, ["isHidden"])
3838

39+
@property
40+
def locale(self) -> Optional[str]:
41+
return safeget(self.json_api_attributes, ["locale"])
42+
43+
@property
44+
def translations(self) -> Optional[dict[str, str]]:
45+
return safeget(self.json_api_attributes, ["translations"])
46+
3947
def as_computable(self) -> Attribute:
4048
return Attribute(local_id=self.id, label=self.id)
4149

@@ -73,6 +81,10 @@ def granularity(self) -> Union[str, None]:
7381
def is_hidden(self) -> Optional[bool]:
7482
return safeget(self.json_api_attributes, ["isHidden"])
7583

84+
@property
85+
def locale(self) -> Optional[bool]:
86+
return safeget(self.json_api_attributes, ["locale"])
87+
7688
def primary_label(self) -> Union[CatalogLabel, None]:
7789
# use cast as mypy is not applying next, it claims, type is filter[CatalogLabel]
7890
return cast(Union[CatalogLabel, None], next(filter(lambda x: x.primary, self.labels), None))

0 commit comments

Comments
 (0)