Skip to content

feat(gooddata-sdk): [AUTO] Add ErrorInfo schema and error field to SearchResult#1604

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

feat(gooddata-sdk): [AUTO] Add ErrorInfo schema and error field to SearchResult#1604
yenkins-admin wants to merge 3 commits into
masterfrom
auto/openapi-sync-C011-20260512-r59682

Conversation

@yenkins-admin
Copy link
Copy Markdown
Contributor

Summary

Added integration test test_search_ai_error_field to test_compute_service.py to exercise the new ErrorInfo error field on SearchResult. No SDK wrapper code changes were required because compute/service.py already returns the raw SearchResult API model, and the auto-generated client (updated by the diff) already includes the optional error: ErrorInfo field. The test verifies both the success path (error absent, results present) and the failure path (error.reason is str, error.status_code is int).

Impact: new_feature | Services: gooddata-afm-client
Tickets: GDAI-1672

Files changed

  • packages/gooddata-sdk/tests/compute/test_compute_service.py

Agent decisions

Decisions (2)

No SDK wrapper class for ErrorInfo — Return raw SearchResult from API client unchanged; access result.error.reason and result.error.status_code directly

  • Alternatives: Create CatalogErrorInfo SDK wrapper class, Create a CatalogSearchResult wrapper
  • Why: The existing compute/service.py pattern returns raw API models (SearchResult, ChatResult, ChatHistoryResult) without wrapping them in Catalog* classes. Adding SDK wrappers would break the pattern and is not necessary since the auto-generated client already exposes the fields.

Where to place the new test — Add test_search_ai_error_field to existing test_compute_service.py (module-level skipped)

  • Alternatives: Create a separate test file for error scenarios
  • Why: All compute/AI tests are in this file and are module-skipped because gen-ai is not available in the test environment. Adding the new test here keeps all AI search tests together and consistent.
Assumptions to verify (3)
  • The auto-generated gooddata_api_client already reflects the diff (ErrorInfo model and SearchResult.error field are present — confirmed by reading gooddata-api-client/gooddata_api_client/model/search_result.py and error_info.py)
  • The existing module-level pytest.skip() in test_compute_service.py is intentional and the new test will also be skipped until the skip is removed for a live recording run
  • result.error is None on a normal successful search response (the field is optional in the OpenAPI spec)
Risks (1)
  • test_search_ai_error_field may record a success cassette (no error) if the search runs normally against staging; the error path (METADATA_SYNC_IN_PROGRESS) requires timing the recording during a sync window
Layers touched (1)
  • tests — Added test_search_ai_error_field integration test for the new ErrorInfo.error field on SearchResult
    • packages/gooddata-sdk/tests/compute/test_compute_service.py

Source commits (gdc-nas)

  • 259fb34 Merge pull request #22412 from gooddata/malmiron/GDAI-1672-error-message
OpenAPI diff
@@ gooddata-afm-client.json @@
+      "ErrorInfo": {
+        "description": "Structured error, present when the search could not run (e.g. metadata sync in progress). Absent on success.",
+        "properties": {
+          "reason": { "description": "Stable machine-readable error code.", "example": "METADATA_SYNC_IN_PROGRESS", "type": "string" },
+          "statusCode": { "format": "int32", "type": "integer" }
+        },
+        "required": ["reason", "statusCode"]
+      }
       "SearchResult": {
         "properties": {
+          "error": { "$ref": "ErrorInfo" }
         }
       }

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 (d7f2e1c).
⚠️ Report is 18 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1604   +/-   ##
=======================================
  Coverage   78.96%   78.96%           
=======================================
  Files         231      231           
  Lines       15578    15578           
=======================================
  Hits        12301    12301           
  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