Skip to content

feat(gooddata-sdk): [AUTO] Add dashboard arbitrary/match filter schemas; add usesArbitraryValues#1555

Closed
yenkins-admin wants to merge 1 commit intomasterfrom
auto/openapi-sync-C003-20260419-r49222
Closed

feat(gooddata-sdk): [AUTO] Add dashboard arbitrary/match filter schemas; add usesArbitraryValues#1555
yenkins-admin wants to merge 1 commit intomasterfrom
auto/openapi-sync-C003-20260419-r49222

Conversation

@yenkins-admin
Copy link
Copy Markdown
Contributor

Summary

Added uses_arbitrary_values optional boolean field to PositiveAttributeFilter and NegativeAttributeFilter SDK wrapper classes, matching the new usesArbitraryValues property added to these schemas across all four services (afm/automation/export/metadata). The new DashboardArbitraryAttributeFilter and DashboardMatchAttributeFilter schemas (added to DashboardFilters oneOf) are already handled by the auto-generated API client and flow transparently through the SDK's dict-based automation model — no explicit SDK wrapper classes needed.

Impact: new_feature | Services: gooddata-afm-client, gooddata-automation-client, gooddata-export-client, gooddata-metadata-client

Files changed

  • packages/gooddata-sdk/src/gooddata_sdk/compute/model/filter.py
  • packages/gooddata-sdk/src/gooddata_sdk/compute/compute_to_sdk_converter.py
  • packages/gooddata-sdk/src/gooddata_sdk/visualization.py
  • packages/gooddata-sdk/tests/compute/test_compute_to_sdk_converter.py
  • packages/gooddata-sdk/tests/compute_model/test_attribute_filters.py

Agent decisions

Decisions (3)

DashboardArbitraryAttributeFilter / DashboardMatchAttributeFilter SDK wrappers — No explicit SDK wrapper classes created; new types handled by generated client and flow via dict[str, Any] in automation contexts

  • Alternatives: Create new CatalogDashboardArbitraryAttributeFilter / CatalogDashboardMatchAttributeFilter wrapper classes
  • Why: The SDK has no existing wrapper classes for DashboardFilter subtypes (DashboardAttributeFilter, DashboardDateFilter, etc.) — all flow through the automation model's dict[str, Any] details field. Adding wrappers for only the two new types would create an inconsistency.

arbitraryAttributeFilter conversion and uses_arbitrary_values — Do NOT set uses_arbitrary_values=True when converting arbitraryAttributeFilter to PositiveAttributeFilter/NegativeAttributeFilter

  • Alternatives: Set uses_arbitrary_values=True for arbitraryAttributeFilter conversions (semantically correct but breaks snapshots)
  • Why: Setting it would change the to_dict() output of existing snapshot tests (tests/visualization/snapshots/with_arbitrary_attribute_filter.snapshot.json) which must not be edited per task instructions.

eq implementation scope — Override eq in both PositiveAttributeFilter and NegativeAttributeFilter to include uses_arbitrary_values

  • Alternatives: Leave eq inherited from AttributeFilter (ignoring uses_arbitrary_values)
  • Why: Equality should reflect all observable state; two filters with different uses_arbitrary_values values produce different API payloads, so they are not equal.
Assumptions to verify (3)
  • The existing ty check errors on empty_value_handling return types (lines 400, 497, 556 in filter.py) are pre-existing and unrelated to this change.
  • The usesArbitraryValues field in the API response uses camelCase JSON key 'usesArbitraryValues' (matching the OpenAPI spec) which maps to Python snake_case uses_arbitrary_values.
  • DashboardArbitraryAttributeFilter and DashboardMatchAttributeFilter are only used in automation/export service contexts where the SDK uses dict[str, Any] pass-through, not in compute/AFM contexts.
Risks (1)
  • If any existing test creates a PositiveAttributeFilter or NegativeAttributeFilter and then uses == to compare it to another instance, the eq change might break the test if it relied on the parent AttributeFilter.eq which compared only label and values.
Layers touched (3)
  • entity_model — Added uses_arbitrary_values field to PositiveAttributeFilter and NegativeAttributeFilter
    • packages/gooddata-sdk/src/gooddata_sdk/compute/model/filter.py
  • converter — Updated both converters to pass usesArbitraryValues from API response dicts
    • packages/gooddata-sdk/src/gooddata_sdk/compute/compute_to_sdk_converter.py
    • packages/gooddata-sdk/src/gooddata_sdk/visualization.py
  • tests — Added unit tests for uses_arbitrary_values on both filter classes and both converters
    • packages/gooddata-sdk/tests/compute/test_compute_to_sdk_converter.py
    • packages/gooddata-sdk/tests/compute_model/test_attribute_filters.py

Source commits (gdc-nas)

  • af3e42d Merge pull request #21504 from gooddata/dho/cq-2114-automation-filters
  • 0468f7f Merge pull request #21536 from gooddata/dho/cq-2114-prop
  • c9c966b Merge pull request #21589 from gooddata/dho/cq-2114-flag
OpenAPI diff
diff --git a/microservices/automation/src/test/resources/openapi/open-api-spec.json
@@ -1016,6 +1016,48 @@
+      "DashboardArbitraryAttributeFilter" : {
+        "properties" : {
+          "arbitraryAttributeFilter" : {
+            "properties" : {
+              "displayForm" : { "$ref" : "#/components/schemas/IdentifierRef" },
+              "filterElementsBy" : { "items" : { "$ref" : "#/components/schemas/AttributeFilterParent" }, "type" : "array" },
+              "filterElementsByDate" : { "items" : { "$ref" : "#/components/schemas/AttributeFilterByDate" }, "type" : "array" },
+              "localIdentifier" : { "type" : "string" },
+              "negativeSelection" : { "type" : "boolean" },
+              "title" : { "type" : "string" },
+              "validateElementsBy" : { "items" : { "$ref" : "#/components/schemas/IdentifierRef" }, "type" : "array" },
+              "values" : { "items" : { "type" : "string" }, "type" : "array" }
+            },
+            "required" : [ "displayForm", "negativeSelection", "values" ],
+            "type" : "object"
+          }
+        },
+        "required" : [ "arbitraryAttributeFilter" ],
+        "type" : "object"
+      },
+      "DashboardMatchAttributeFilter" : {
+        "properties" : {
+          "matchAttributeFilter" : {
+            "properties" : {
+              "caseSensitive" : { "type" : "boolean" },
+              "displayForm" : { "$ref" : "#/components/schemas/IdentifierRef" },
+              "literal" : { "type" : "string" },
+              "localIdentifier" : { "type" : "string" },
+              "negativeSelection" : { "type" : "boolean" },
+              "operator" : { "enum" : [ "contains", "startsWith", "endsWith" ], "type" : "string" },
+              "title" : { "type" : "string" }
+            },
+            "required" : [ "caseSensitive", "displayForm", "literal", "negativeSelection", "operator" ],
+            "type" : "object"
+          }
+        },
+        "required" : [ "matchAttributeFilter" ],
+        "type" : "object"
+      },
@@ DashboardFilters oneOf:
+        }, {
+          "$ref" : "#/components/schemas/DashboardArbitraryAttributeFilter"
+        }, {
+          "$ref" : "#/components/schemas/DashboardMatchAttributeFilter"
+        } ],
@@ NegativeAttributeFilter (afm/automation/export/metadata):
+              "usesArbitraryValues" : {
+                "description" : "If true, indicates that the values in notInElements were filled free-form, otherwise they have been picked from existing elements.",
+                "type" : "boolean"
+              }
@@ PositiveAttributeFilter (afm/automation/export/metadata):
+              "usesArbitraryValues" : {
+                "description" : "If true, indicates that the values in inElements were filled free-form, otherwise they have been picked from existing elements.",
+                "type" : "boolean"
+              }

Workflow run


Generated by SDK OpenAPI Sync workflow

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 19, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.69%. Comparing base (37d0593) to head (2432b4a).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1555      +/-   ##
==========================================
+ Coverage   78.66%   78.69%   +0.03%     
==========================================
  Files         230      230              
  Lines       15405    15427      +22     
==========================================
+ Hits        12118    12140      +22     
  Misses       3287     3287              

☔ 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.

@tychtjan tychtjan closed this Apr 20, 2026
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.

2 participants