Skip to content

feat(gooddata-sdk): [AUTO] Add parameters include option to analyticalDashboards and visualizations#1601

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

feat(gooddata-sdk): [AUTO] Add parameters include option to analyticalDashboards and visualizations#1601
yenkins-admin wants to merge 2 commits into
masterfrom
auto/openapi-sync-C005-20260512-r59682

Conversation

@yenkins-admin
Copy link
Copy Markdown
Contributor

Summary

Added integration test for the visualization objects entity endpoint to cover the API change that added a 'parameters' relationship to JsonApiVisualizationObjectOut and changed the 'included' array type from JsonApiVisualizationObjectOutIncludes to JsonApiMetricOutIncludes (which now includes JsonApiParameterOutWithLinks). The existing SDK wrapper code (VisualizationService) required no changes because it already uses _check_return_type=False and SideLoads handles any type of included object. Similarly the AnalyticalDashboard entity response change (added parameters relationship + included) requires no SDK wrapper changes since no SDK method wraps that entity endpoint directly.

Impact: modification | Services: gooddata-metadata-client

Files changed

  • packages/gooddata-sdk/tests/catalog/test_catalog_workspace_content.py

Agent decisions

Decisions (4)

No SDK model changes — Left SDK wrapper code (VisualizationService, SideLoads) unchanged

  • Alternatives: Add explicit parameter handling to VisualizationService, Add a property on Visualization to expose parameter side loads
  • Why: The API change adds parameters to existing response shapes. The VisualizationService already uses _check_return_type=False for all API calls, so it accepts any response shape. SideLoads stores all included objects by type/id key and does not type-check individual entries. The new JsonApiParameterOutWithLinks objects will be automatically included in side loads if present.

No AnalyticalDashboard entity test — Only added test for VisualizationService, not for analytical dashboard entity endpoint

  • Alternatives: Add a new SDK method for analytical dashboard entity reads, Test via raw entities_api client call
  • Why: The SDK has no direct wrapper for the analytical dashboard entity endpoint. Dashboard operations in the SDK go through the layout API (declarative model). Adding a test would require either a new SDK method or calling the raw API client directly, which is out of scope for this change.

Integration test placement — Added test to test_catalog_workspace_content.py

  • Alternatives: Create a new test file tests/visualization/test_visualization_service_integration.py
  • Why: The VisualizationService is related to workspace content, and all other workspace content integration tests live in this file. No separate visualization service integration test file exists.

Test assertion style — Used len > 0 and isinstance checks instead of specific counts

  • Alternatives: Assert specific count (fragile across environments), Assert specific visualization IDs (tightly coupled to demo workspace state)
  • Why: The demo workspace visualization count could vary between environments. The key correctness assertion is that the endpoint returns valid Visualization objects, not a specific count.
Assumptions to verify (4)
  • The demo test workspace contains at least one visualization object, so len(visualizations) > 0 will be true when the cassette is recorded.
  • JsonApiVisualizationObjectOutIncludes was already removed from the generated client (confirmed: no file found at gooddata-api-client/gooddata_api_client/model/json_api_visualization_object_out_includes.py), and no SDK code references it.
  • The ty check errors observed (unresolved-import for cattrs, requests, gooddata_code_convertors, etc.) are pre-existing environment setup issues, not introduced by these changes.
  • The parameters relationship in analytical dashboards is only relevant to the entity-level API, not the declarative layout API used by CatalogWorkspaceContentService.get_declarative_analytics_model().
Risks (2)
  • test_get_visualizations_with_parameters will fail if the demo workspace has no visualization objects when the cassette is recorded.
  • If the server returns a response where parameters are included in the visualization object included array, the SideLoads class will include them. If any downstream code only expects specific types in side loads, it could break — but inspection shows SideLoads is a generic dict-of-dicts.
Layers touched (1)
  • tests — Added test_get_visualizations_with_parameters integration test and Visualization import
    • packages/gooddata-sdk/tests/catalog/test_catalog_workspace_content.py

Source commits (gdc-nas)

  • 25451ef feat(metadata-api): add parameters to analyticalDashboards
  • cf3402f feat(metadata-api): add parameters to visualizations
OpenAPI diff
@@ gooddata-metadata-client.json (JsonApiAnalyticalDashboardOutDocument.relationships) @@
+              "parameters": {
+                "properties": { "data": { "$ref": "JsonApiParameterToManyLinkage" } },
+                "required": ["data"]
+              }
@@ gooddata-metadata-client.json (JsonApiAnalyticalDashboardOutList.included) @@
+          { "$ref": "JsonApiParameterOutWithLinks" }
@@ gooddata-metadata-client.json (JsonApiVisualizationObjectOutDocument.relationships) @@
+              "parameters": {
+                "properties": { "data": { "$ref": "JsonApiParameterToManyLinkage" } }
+              }
@@ gooddata-metadata-client.json (JsonApiVisualizationObjectOutDocument.included ref) @@
-              "$ref": "JsonApiVisualizationObjectOutIncludes"
+              "$ref": "JsonApiMetricOutIncludes"
-      "JsonApiVisualizationObjectOutIncludes": { "oneOf": [ Attribute, Dataset, Fact, Label, Metric, UserIdentifier ] }

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 79.00%. Comparing base (12c8d84) to head (475e813).
⚠️ Report is 18 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1601      +/-   ##
==========================================
+ Coverage   78.96%   79.00%   +0.03%     
==========================================
  Files         231      231              
  Lines       15578    15578              
==========================================
+ Hits        12301    12307       +6     
+ Misses       3277     3271       -6     

☔ 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