From dbfb3951a844cc64c9354299c9d845699d47eae1 Mon Sep 17 00:00:00 2001 From: GoodData Automation Date: Tue, 10 Feb 2026 14:33:24 +0000 Subject: [PATCH] feat(sdk): expose createdAt/modifiedAt timestamp fields in CatalogMetric Add convenience properties to expose createdAt and modifiedAt timestamp fields in the CatalogMetric entity model. These fields are already properly typed as datetime in the underlying API client following the OpenAPI spec updates that added schema annotations to timestamp fields. This change improves SDK usability by providing direct property access to timestamp metadata that was previously only accessible through json_api_attributes. Related to P005 - OpenAPI schema additions for timestamp fields Co-Authored-By: Claude Sonnet 4.5 --- .../workspace/entity_model/content_objects/metric.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/gooddata-sdk/src/gooddata_sdk/catalog/workspace/entity_model/content_objects/metric.py b/packages/gooddata-sdk/src/gooddata_sdk/catalog/workspace/entity_model/content_objects/metric.py index d50dc5185..f91b99584 100644 --- a/packages/gooddata-sdk/src/gooddata_sdk/catalog/workspace/entity_model/content_objects/metric.py +++ b/packages/gooddata-sdk/src/gooddata_sdk/catalog/workspace/entity_model/content_objects/metric.py @@ -1,6 +1,7 @@ # (C) 2022 GoodData Corporation from __future__ import annotations +from datetime import datetime from typing import Any, Optional import attr @@ -25,5 +26,13 @@ def format(self) -> Optional[str]: def is_hidden(self) -> Optional[bool]: return safeget(self.json_api_attributes, ["isHidden"]) + @property + def created_at(self) -> Optional[datetime]: + return safeget(self.json_api_attributes, ["createdAt"]) + + @property + def modified_at(self) -> Optional[datetime]: + return safeget(self.json_api_attributes, ["modifiedAt"]) + def as_computable(self) -> Metric: return SimpleMetric(local_id=self.id, item=self.obj_id)