Skip to content

feat(gooddata-sdk): [AUTO] add MetricDefinitionOverride wrapper for GDAI-1389#1442

Closed
yenkins-admin wants to merge 1 commit intomasterfrom
feature/auto-P013-measure-definition-overrides
Closed

feat(gooddata-sdk): [AUTO] add MetricDefinitionOverride wrapper for GDAI-1389#1442
yenkins-admin wants to merge 1 commit intomasterfrom
feature/auto-P013-measure-definition-overrides

Conversation

@yenkins-admin
Copy link
Copy Markdown
Contributor

Adds MetricDefinitionOverride wrapper class and measure_definition_overrides support to ExecutionDefinition in the gooddata-sdk compute model.
Problem ID: P013 | Workflow: https://github.com/gooddata/gdc-nas/actions/runs/23194184862

What changed in gdc-nas

  • PR #20609 — commit 8defaf9: Added measureDefinitionOverrides field (array of MetricDefinitionOverride) to the AFM model across afm-exec-api, automation, export-controller, and metadata-api OpenAPI specs. New MetricDefinitionOverride schema with required definition (InlineMeasureDefinition) and item (AfmObjectIdentifierCore) fields, enabling per-request override of catalog metric MAQL definitions without modifying stored definitions.
  • PR #20685 — commit 4265a8a: Adds what-if scenario analysis skill to gen-ai service with new WhatIfScenarioConfig, WhatIfScenarioItem, and WhatIfMeasureAdjustmentConfig schemas in the afm-exec-api OpenAPI spec. Also removes several LLM provider config schemas from that spec.

What was implemented in SDK

  • Added MetricDefinitionOverride wrapper class using @define (attrs) with item: ObjId and maql: str fields, plus as_api_model() serialization method
  • Updated ExecutionDefinition.__init__() with optional measure_definition_overrides: list[MetricDefinitionOverride] | None = None parameter
  • Updated compute_model_to_api_model() to conditionally forward measure_definition_overrides to models.AFM
  • Exported MetricDefinitionOverride from gooddata_sdk.__init__.py as part of the public API
  • Added unit tests in test_compute_model.py verifying serialization correctness and absence of the field when not provided

Files modified

  • packages/gooddata-sdk/src/gooddata_sdk/compute/model/execution.py
  • packages/gooddata-sdk/src/gooddata_sdk/__init__.py
  • packages/gooddata-sdk/tests/compute_model/test_compute_model.py

JIRA: PENDING (Jira ticket will be created after review)
Risk: Low

…DAI-1389

Adds MetricDefinitionOverride wrapper class to expose the measureDefinitionOverrides
field added to the AFM model in PR #20609. Includes ExecutionDefinition parameter,
compute_model_to_api_model() forwarding, public export, and unit tests.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.27%. Comparing base (4dc3f87) to head (6a09635).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1442      +/-   ##
==========================================
+ Coverage   77.24%   77.27%   +0.02%     
==========================================
  Files         227      227              
  Lines       14672    14689      +17     
==========================================
+ Hits        11334    11351      +17     
  Misses       3338     3338              

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

@hkad98 hkad98 closed this Mar 18, 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