Skip to content

Commit 99723c2

Browse files
Merge pull request #1058 from gooddata/snapshot-master-ea3d46ae-to-rel/dev
[bot] Merge master/ea3d46ae into rel/dev
2 parents 6308f32 + ea3d46a commit 99723c2

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

gooddata-sdk/gooddata_sdk/catalog/workspace/declarative_model/workspace/workspace.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ def change_wdf_refs_id(self, mapping: dict[str, str]) -> None:
7979
class CatalogDeclarativeWorkspace(Base):
8080
id: str
8181
name: str
82+
description: Optional[str] = None
8283
model: Optional[CatalogDeclarativeWorkspaceModel] = None
8384
parent: Optional[CatalogWorkspaceIdentifier] = None
8485
permissions: list[CatalogDeclarativeSingleWorkspacePermission] = attr.field(factory=list)

gooddata-sdk/gooddata_sdk/catalog/workspace/entity_model/workspace.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,21 @@ class CatalogWorkspace(Base):
2121
id: str = attr.field(init=False, default=attr.Factory(lambda self: self.workspace_id, takes_self=True))
2222
name: str
2323
parent_id: Optional[str] = attr.field(default=None)
24+
description: Optional[str] = attr.field(default=None)
2425

2526
@classmethod
2627
def from_api(cls, entity: dict[str, Any]) -> CatalogWorkspace:
2728
ea = entity["attributes"]
2829
er = entity.get("relationships")
29-
return cls(workspace_id=entity["id"], name=ea["name"], parent_id=safeget(er, ["parent", "data", "id"]))
30+
return cls(
31+
workspace_id=entity["id"],
32+
name=ea["name"],
33+
parent_id=safeget(
34+
er,
35+
["parent", "data", "id"],
36+
),
37+
description=ea.get("description"),
38+
)
3039

3140
def to_api(self) -> JsonApiWorkspaceInDocument:
3241
kwargs = dict()
@@ -36,12 +45,13 @@ def to_api(self) -> JsonApiWorkspaceInDocument:
3645
data=JsonApiWorkspaceToOneLinkage(id=self.parent_id, type="workspace")
3746
)
3847
)
48+
attributes_dict = {"name": self.name}
49+
if self.description:
50+
attributes_dict["description"] = self.description
3951
return JsonApiWorkspaceInDocument(
4052
data=JsonApiWorkspaceIn(
4153
id=self.id,
42-
attributes=JsonApiWorkspaceInAttributes(
43-
name=self.name,
44-
),
54+
attributes=JsonApiWorkspaceInAttributes(**attributes_dict),
4555
**kwargs,
4656
)
4757
)

0 commit comments

Comments
 (0)