Skip to content

feat(gooddata-sdk): [AUTO] Add dashboard context, UI context, and widget descriptor schemas#1537

Open
yenkins-admin wants to merge 1 commit intomasterfrom
auto/openapi-sync-C002-20260413-r08503
Open

feat(gooddata-sdk): [AUTO] Add dashboard context, UI context, and widget descriptor schemas#1537
yenkins-admin wants to merge 1 commit intomasterfrom
auto/openapi-sync-C002-20260413-r08503

Conversation

@yenkins-admin
Copy link
Copy Markdown
Contributor

Summary

Implemented SDK wrapper classes for the new dashboard context, UI context, and widget descriptor schemas. Created gooddata_sdk/compute/model/ai_context.py with 10 new wrapper classes: CatalogActiveObjectIdentification, CatalogObjectReference, CatalogObjectReferenceGroup, CatalogWidgetDescriptor, CatalogInsightWidgetDescriptor, CatalogRichTextWidgetDescriptor, CatalogVisualizationSwitcherWidgetDescriptor, CatalogDashboardContext, CatalogUIContext, and CatalogUserContext. Each class implements to_api() to convert SDK objects to the corresponding gooddata_api_client models. Updated compute/service.py to add an optional user_context parameter to ai_chat() and ai_chat_stream() methods. All new classes are exported from gooddata_sdk/__init__.py. All ruff checks pass and import validation succeeds.

Impact: new_feature | Services: gooddata-afm-client
Tickets: LX-2141

Files changed

  • sdk/packages/gooddata-sdk/src/gooddata_sdk/compute/model/ai_context.py
  • sdk/packages/gooddata-sdk/src/gooddata_sdk/compute/service.py
  • sdk/packages/gooddata-sdk/src/gooddata_sdk/__init__.py

Source commits (gdc-nas)

  • 3f2b607 Merge pull request #21274 from gooddata/smac/LX-2141
  • 63dd6bf feat(gen-ai): refactor widgets polymorphism and enhance OpenAPI spec
  • 499bb70 feat(gen-ai): add support for filters for visualizations
  • 075d22d Merge pull request #21389 from gooddata/dho/trivial-fix
OpenAPI diff
+      "DashboardContext": {
+        "description": "Dashboard the user is currently viewing.",
+        "properties": {
+          "id": { "type": "string" },
+          "widgets": { "items": { "$ref": "#/components/schemas/WidgetDescriptor" } }
+        }
+      },
+      "UIContext": {
+        "description": "Ambient UI state: what the user is currently looking at.",
+        "properties": { "dashboard": { "$ref": "#/components/schemas/DashboardContext" } }
+      },
+      "InsightWidgetDescriptor": { "properties": { "filters": {...}, "resultId": {...}, "title": {...}, "visualizationId": {...}, "widgetId": {...} } },
+      "RichTextWidgetDescriptor": { "properties": { "filters": {...}, "title": {...}, "widgetId": {...} } },
+      "VisualizationSwitcherWidgetDescriptor": { "properties": { "activeVisualizationId": {...}, "filters": {...}, "visualizationIds": {...}, "widgetId": {...} } },
+      "WidgetDescriptor": { "properties": { "title": {...}, "widgetId": {...}, "widgetType": {...} } },
+      "ObjectReference": { "properties": { "id": {...}, "type": { "enum": ["WIDGET","METRIC","ATTRIBUTE","DASHBOARD"] } } },
+      "ObjectReferenceGroup": { "properties": { "context": {...}, "objects": {...} } },
       "UserContext": {
-        "description": "User context, which can affect the behavior of the underlying AI features.",
-        "required": ["activeObject"],
+        "description": "User context with ambient UI state (view) and explicitly referenced objects.",
         "properties": {
           "activeObject": { "$ref": "#/components/schemas/ActiveObjectIdentification" },
+          "referencedObjects": { "items": { "$ref": "#/components/schemas/ObjectReferenceGroup" } },
+          "view": { "$ref": "#/components/schemas/UIContext" }
         }
       }

Workflow run


Generated by SDK OpenAPI Sync workflow

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 13, 2026

Codecov Report

❌ Patch coverage is 63.92405% with 57 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.51%. Comparing base (d7f50b7) to head (c7569a7).

Files with missing lines Patch % Lines
...a-sdk/src/gooddata_sdk/compute/model/ai_context.py 66.43% 49 Missing ⚠️
...s/gooddata-sdk/src/gooddata_sdk/compute/service.py 27.27% 8 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1537      +/-   ##
==========================================
- Coverage   78.66%   78.51%   -0.15%     
==========================================
  Files         230      231       +1     
  Lines       15400    15554     +154     
==========================================
+ Hits        12114    12213      +99     
- Misses       3286     3341      +55     

☔ 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