Skip to content

feat(gooddata-sdk): [AUTO] Add dateTimeSemantics (LOCAL/UTC) field to DataSource schemas#1606

Open
yenkins-admin wants to merge 2 commits into
masterfrom
auto/openapi-sync-C014-20260512-r59682
Open

feat(gooddata-sdk): [AUTO] Add dateTimeSemantics (LOCAL/UTC) field to DataSource schemas#1606
yenkins-admin wants to merge 2 commits into
masterfrom
auto/openapi-sync-C014-20260512-r59682

Conversation

@yenkins-admin
Copy link
Copy Markdown
Contributor

Summary

Added dateTimeSemantics (LOCAL/UTC) nullable field to DeclarativeDataSource and JsonApiDataSource* SDK wrapper classes. The generated API client already contained the field; only the hand-written SDK wrappers needed updating. Changes: (1) added date_time_semantics: str | None = None to CatalogDeclarativeDataSource in declarative_model/data_source.py so it round-trips through _get_snake_dict()/from_dict(); (2) added date_time_semantics to _ATTRIBUTES list and as an instance field on CatalogDataSourceBase in entity_model/data_source.py so it is serialized in to_api() and deserialized in from_api(); (3) added test_date_time_semantics integration test that patches a data source with LOCAL and asserts the read-back value.

Impact: modification | Services: gooddata-metadata-client

Files changed

  • packages/gooddata-sdk/src/gooddata_sdk/catalog/data_source/declarative_model/data_source.py
  • packages/gooddata-sdk/src/gooddata_sdk/catalog/data_source/entity_model/data_source.py
  • packages/gooddata-sdk/tests/catalog/test_catalog_data_source.py

Agent decisions

Decisions (3)

Field placement in entity model — Added date_time_semantics after alternative_data_source_id in both _ATTRIBUTES list and field definitions

  • Alternatives: Add to _ATTRIBUTES only without a field (would break from_api deserialization), Add field only without _ATTRIBUTES (would not serialize to API)
  • Why: _ATTRIBUTES controls which fields are serialized in to_api() via asdict() filter; the instance field is needed so from_api() can deserialize it via cattrs.structure(). Both are required for a complete round-trip.

Field type for dateTimeSemantics — str | None = None (nullable optional string)

  • Alternatives: Literal["LOCAL", "UTC"] | None (stricter typing), Enum class
  • Why: All other optional string fields on these classes (cache_strategy, authentication_type, alternative_data_source_id) use str | None. Keeping the same pattern avoids inconsistency.

No public init.py export change needed — Did not modify gooddata_sdk/init.py

  • Alternatives: Export date_time_semantics as a constant
  • Why: The field is on existing exported classes. No new class was introduced, so no new export is required.
Assumptions to verify (3)
  • The generated API client (gooddata-api-client) already contains dateTimeSemantics in DeclarativeDataSource, JsonApiDataSourceIn, JsonApiDataSourceOut, and JsonApiDataSourcePatch — confirmed by grepping the generated model files.
  • The _get_snake_dict() filter (value is not None) will correctly omit the field when it is None, matching the nullable: true semantics in the OpenAPI spec.
  • The asdict() filter in CatalogDataSourceBase.to_api() omits None values — so passing None for date_time_semantics will not send the field to the API.
Risks (2)
  • test_date_time_semantics may fail if the demo data source does not support dateTimeSemantics (StarRocks/AI Lakehouse only per the API description).
  • Existing cassettes for test_store_declarative_data_sources and test_put_declarative_data_sources may need re-recording if the backend now returns dateTimeSemantics in responses.
Layers touched (3)
  • declarative_model — Added date_time_semantics: str | None = None to CatalogDeclarativeDataSource
    • packages/gooddata-sdk/src/gooddata_sdk/catalog/data_source/declarative_model/data_source.py
  • entity_model — Added date_time_semantics to _ATTRIBUTES list and as a field on CatalogDataSourceBase
    • packages/gooddata-sdk/src/gooddata_sdk/catalog/data_source/entity_model/data_source.py
  • tests — Added test_date_time_semantics integration test
    • packages/gooddata-sdk/tests/catalog/test_catalog_data_source.py

Source commits (gdc-nas)

  • 56e527c Merge pull request #22246 from gooddata/dho/cq-2235-tz-setting
OpenAPI diff
@@ gooddata-metadata-client.json (DeclarativeDataSource) @@
+          "dateTimeSemantics": {
+            "description": "Determines how datetime values are interpreted in data sources without native support for specifying this.\n- LOCAL: values assumed in local timezone, not converted.\n- UTC: values assumed in UTC, converted to user timezone.",
+            "enum": ["LOCAL", "UTC"],
+            "nullable": true,
+            "type": "string"
+          }
@@ gooddata-metadata-client.json (JsonApiDataSourceIn, JsonApiDataSourceOut, JsonApiDataSourcePatch attributes) @@
+              "dateTimeSemantics": {
+                "description": "Determines how datetime values are interpreted in data sources without native support for specifying this.",
+                "enum": ["LOCAL", "UTC"],
+                "nullable": true
+              }

Workflow run


Generated by SDK OpenAPI Sync workflow

@codecov
Copy link
Copy Markdown

codecov Bot commented May 12, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.96%. Comparing base (12c8d84) to head (ea45e21).
⚠️ Report is 18 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1606   +/-   ##
=======================================
  Coverage   78.96%   78.96%           
=======================================
  Files         231      231           
  Lines       15578    15580    +2     
=======================================
+ Hits        12301    12303    +2     
  Misses       3277     3277           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant