Skip to content

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

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

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

Conversation

@yenkins-admin
Copy link
Copy Markdown
Contributor

Summary

Added ExecutionResultLimitBreak SDK wrapper class and limit_breaks property on ExecutionResult to expose the new limitBreaks field in ExecutionResultMetadata. Also fixed three pre-existing type annotation gaps in filter.py and added pyarrow to 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/compute/model/filter.py
  • packages/gooddata-sdk/src/gooddata_sdk/__init__.py
  • packages/gooddata-sdk/pyproject.toml
  • packages/gooddata-sdk/tests/compute/test_execution_limit_breaks.py

Agent decisions

Decisions (5)

ExecutionResultLimitBreak placement — Added to existing execution.py alongside other compute model classes

  • Alternatives: New file compute/model/limit_break.py
  • Why: The class is a compute-model concept (not a catalog entity), consistent with TotalDimension, TotalDefinition, TableDimension in the same file. No new file needed.

limit_breaks access key — Access metadata as metadata.get('limitBreaks') using camelCase key

  • Alternatives: Access as metadata.get('limit_breaks'), Try both keys
  • Why: When the generated API client deserializes JSON with _check_return_type=False, additional unknown properties (not in attribute_map) are stored using their original camelCase key from the JSON. The change_keys_js_to_python function only converts known attributes via attribute_map; unrecognized keys like limitBreaks pass through unchanged. Plain dicts (used in unit tests) also use camelCase.

from_api None-guard for value field — raw_value = data.get('value'); value=int(raw_value) if raw_value is not None else None

  • Alternatives: Use data.get('value') directly without int() conversion
  • Why: The value field is optional (not in required list) and can be absent or explicitly null per the spec. The None guard is required by ty's invalid-argument-type check to avoid calling int(None).

Pre-existing filter.py type errors — Added explicit EmptyValueHandling | None type annotations to _empty_value_handling in RelativeDateFilter, AllTimeDateFilter, AbsoluteDateFilter

  • Alternatives: Leave as-is (pre-existing), Cast in property return
  • Why: ty inferred the untyped instance attribute as str | None (broadening the Literal), causing invalid-return-type on the property. Adding the annotation preserves the Literal type through the property.

pyarrow in allowed-unresolved-imports — Added pyarrow.** to allowed-unresolved-imports in pyproject.toml

  • Alternatives: Leave unchanged (CI has pyarrow installed so errors don't appear there)
  • Why: pyarrow is an optional dependency (pip install gooddata-sdk[arrow]). Without it installed, ty reports unresolved-import. Adding it to allowed-unresolved-imports matches the pattern used for gooddata_api_client.** and makes ty exit 0 in environments without pyarrow.
Assumptions to verify (3)
  • The generated gooddata-api-client will be regenerated with ExecutionResultLimitBreak model and updated ExecutionResultMetadata before production use; the SDK wrapper handles the field from the raw API response dict regardless.
  • limitBreaks items in the API response always come as plain dicts (additional properties stored with camelCase keys), not as typed model objects.
  • The test workspace 'demo' with metric 'order_amount' is available in the integration test environment.
Risks (1)
  • If the generated API client's ExecutionResultMetadata model stores additional properties under snake_case keys instead of camelCase (e.g., if the serializer behavior changes), the metadata.get('limitBreaks') access would return None even when the field is present in the response.
Layers touched (3)
  • entity_model — Added ExecutionResultLimitBreak class and limit_breaks property on ExecutionResult
    • packages/gooddata-sdk/src/gooddata_sdk/compute/model/execution.py
  • public_api — Exported ExecutionResultLimitBreak
    • packages/gooddata-sdk/src/gooddata_sdk/__init__.py
  • tests — Unit tests for from_api parsing and limit_breaks property; integration test for live execution
    • packages/gooddata-sdk/tests/compute/test_execution_limit_breaks.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

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