Repository navigation
fix(gooddata-sdk): keep isHiddenFromKda on declarative metrics - #1891
Merged
Merged
Conversation
CatalogDeclarativeMetric did not declare is_hidden_from_kda. The generated DeclarativeMetric gained the field when the API client was regenerated, but the SDK attrs class was not updated, and cattrs drops keys a class does not declare. So loading a metric layout from disk or the server lost the flag silently, and every SDK put sent the metric without it: a git deploy could never set it, and a load-then-put wiped a flag set in the UI. Declare the field on the metric class only; the other analytics classes share CatalogAnalyticsBase but their generated models have no such field. An unset field stays None and is not sent, so existing layouts and cassettes are unchanged. A round-trip test covers true, false and an absent key through disk and to_api(). jira: GDAI-2630 risk: low
tychtjan
force-pushed
the
jtyc/gdai-2630
branch
from
October 21, 2026 12:22
f79f0ef to
ac60411
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1891 +/- ##
=======================================
Coverage 85.09% 85.09%
=======================================
Files 337 337
Lines 24331 24332 +1
=======================================
+ Hits 20704 20705 +1
Misses 3627 3627 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
janmatzek
approved these changes
Oct 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CatalogDeclarativeMetricdidn't declareis_hidden_from_kda. The generatedDeclarativeMetricalready has it, but cattrs drops any key the attrs class doesn't declare. So the SDK silently lost the flag on every load and store of the analytics model:isHiddenFromKda: truereached the server without itThis adds the field to the metric class only (
CatalogAnalyticsBaseis shared by dashboards, plugins and others whose models don't have it). An unset field staysNoneand isn't sent, so existing layouts and cassettes don't change.FI needs this to hide the Benchmark (
bmk_*) metrics from KDA "Explain" via a git deploy (MC-5594). The AAC (gdc deploy) format has no KDA key yet; that's a separate gdc-ui change and isn't part of this PR.Test plan
test_declarative_analytics_metrics.py: true / false / absent throughstore_to_disk→load_from_disk→to_api(). Master: 3 failed. Branch: 3 passed.make -C packages/gooddata-sdk format lint type-check: cleanTEST_ENVS=py314 make -C packages/gooddata-sdk test: 576 passed, 2 skipped, 3 xfailed (no cassette re-recorded)TEST_ENVS=py314 make -C packages/gooddata-pipelines test: 195 passedtruetruetrue, then SDK get + puttrueRisk
low: one optional field on one class, default
Noneand never serialized when unset.jira: GDAI-2630
Summary by CodeRabbit