Skip to content

feat(gooddata-sdk): [AUTO] Add ExecutionResultLimitBreak schema for partial results#1622

Open
yenkins-admin wants to merge 2 commits into
masterfrom
auto/openapi-sync-C002-20260518-r25465
Open

feat(gooddata-sdk): [AUTO] Add ExecutionResultLimitBreak schema for partial results#1622
yenkins-admin wants to merge 2 commits into
masterfrom
auto/openapi-sync-C002-20260518-r25465

Conversation

@yenkins-admin
Copy link
Copy Markdown
Contributor

Summary

Added ExecutionResultLimitBreak SDK class and limit_breaks property on ExecutionResult to expose the new limitBreaks field. The diff adds a new ExecutionResultLimitBreak schema (with limit, limitType, value fields) and a limitBreaks array to ExecutionResultMetadata. The SDK wrapper reads limitBreaks from the metadata dict at runtime and deserialises each item via ExecutionResultLimitBreak.from_api(), handling camelCase-to-snake_case rename and optional value field. Also fixed pre-existing ty errors: EmptyValueHandling instance-variable annotations in filter.py and pyarrow in allowed-unresolved-imports.

Impact: new_feature | Services: gooddata-afm-client

Source commits (gdc-nas):

  • 71bb41a by Mike Zelenskij — Merge pull request #22984 from gooddata/c.mze-cq-2334

Files changed

  • packages/gooddata-sdk/src/gooddata_sdk/compute/model/execution.py
  • packages/gooddata-sdk/src/gooddata_sdk/__init__.py
  • packages/gooddata-sdk/src/gooddata_sdk/compute/model/filter.py
  • packages/gooddata-sdk/pyproject.toml
  • packages/gooddata-sdk/tests/compute/test_execution_result_limit_break.py

Agent decisions

Decisions (4)

placement of ExecutionResultLimitBreak — Added as @define class directly in execution.py before ResultSizeDimensionsLimitsExceeded

  • Alternatives: Create a new separate file, Put in compute/model/init.py
  • Why: All execution-related classes live in execution.py; adding there maintains cohesion and avoids a one-class file.

accessing limitBreaks from ExecutionResult — Read self._metadata through a local Any-typed alias to bypass the models.ExecutionResultMetadata annotation

  • Alternatives: Cast to dict explicitly, Change _metadata type annotation
  • Why: Keeps the existing type annotation intact for documentation while allowing .get() on the runtime dict (which is a plain Python dict due to _check_return_type=False).

return type for absent limitBreaks — Return [] when limitBreaks is absent from metadata

  • Alternatives: Return None, Return None | list[ExecutionResultLimitBreak]
  • Why: API says 'Absent when result is complete'. Empty list is idiomatic Python and spares callers from None checks.

pyarrow in allowed-unresolved-imports — Added pyarrow and pyarrow.** to tool.ty.analysis.allowed-unresolved-imports

  • Alternatives: # type: ignore on import lines, Install pyarrow unconditionally
  • Why: pyarrow is an optional extras dependency. allowed-unresolved-imports is the established pattern (gooddata_api_client already there).
Assumptions to verify (3)
  • limitBreaks lives under ExecutionResultMetadata based on the diff context line position near that schema; the SDK reads it as metadata['limitBreaks'] at runtime.
  • The demo workspace contains a label 'campaign_channel_id' (confirmed in demo_catalog_list_labels.yaml fixture) for the integration test.
  • The generated API client (gooddata-api-client) will be regenerated on the next cycle to natively include ExecutionResultLimitBreak and the limitBreaks attribute_map.
Risks (2)
  • If limitBreaks is on ExecutionResult directly rather than ExecutionResultMetadata, limit_breaks always returns [] because it reads from self._metadata. The truncated diff made placement ambiguous.
  • Integration test uses label 'campaign_channel_id'; if that label doesn't exist when the cassette is recorded, the test fails.
Layers touched (3)
  • entity_model — Added ExecutionResultLimitBreak @define class with from_api() classmethod and limit_breaks property on ExecutionResult
    • packages/gooddata-sdk/src/gooddata_sdk/compute/model/execution.py
  • public_api — Re-exported ExecutionResultLimitBreak from the sole public SDK surface
    • packages/gooddata-sdk/src/gooddata_sdk/__init__.py
  • tests — Parametrised unit tests for from_api field-rename/None-guard logic; unit tests for limit_breaks absent/present; integration test with VCR cassette
    • packages/gooddata-sdk/tests/compute/test_execution_result_limit_break.py
OpenAPI diff
--- a/gooddata-afm-client.json
+++ b/gooddata-afm-client.json
@@ -2995,6 +3057,30 @@
+      "ExecutionResultLimitBreak": {
+        "description": "Describes a limit that was broken, resulting in partial data being returned.",
+        "properties": {
+          "limit": {
+            "description": "The configured threshold value.",
+            "format": "int64",
+            "type": "integer"
+          },
+          "limitType": {
+            "description": "Type of the limit that was broken, e.g. \"rowCount\".",
+            "type": "string"
+          },
+          "value": {
+            "description": "The actual value that triggered the limit; null when it cannot be determined exactly.",
+            "format": "int64",
+            "type": "integer"
+          }
+        },
+        "required": [ "limit", "limitType" ],
+        "type": "object"
+      },
@@ -3002,6 +3088,13 @@
           "limitBreaks": {
+            "description": "Limits that were broken during result computation, causing the result to be partial. Absent when the result is complete.",
+            "items": {
+              "$ref": "#/components/schemas/ExecutionResultLimitBreak"
+            },
+            "type": "array"
+          },

Workflow run


Generated by SDK OpenAPI Sync workflow

@codecov
Copy link
Copy Markdown

codecov Bot commented May 18, 2026

Codecov Report

❌ Patch coverage is 91.66667% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.03%. Comparing base (38b0798) to head (9f70ace).

Files with missing lines Patch % Lines
...ta-sdk/src/gooddata_sdk/compute/model/execution.py 90.47% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1622      +/-   ##
==========================================
+ Coverage   79.01%   79.03%   +0.02%     
==========================================
  Files         231      231              
  Lines       15619    15638      +19     
==========================================
+ Hits        12341    12360      +19     
  Misses       3278     3278              

☔ 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