Repository navigation
[bot] Merge master/63ae5592 into rel/dev - #1935
Merged
Merged
Conversation
…1934) * fix(gooddata-api-client): accept primitive-only oneOf union values A declarative read failed with `ApiTypeError: Invalid type for variable 'gap'` once any Publisher document, document template or page template in the workspace carried a style value such as `gap: 20` or `padding: "{theme.spacing.padding.normal}"`. The write paths (from_dict, load from disk, to_api, put) failed the same way. The spec types these fields as a oneOf of two primitives. python-prior v6.6.0 renders such a schema as an empty model class that accepts no value, so all seven of them were broken: the publisher style gap, padding and border radius, a visualization's auto-visibility, the publisher date filter bounds, the dashboard tabular export date filter bounds and the conditional-formatting literal. The fix is in the custom templates, so it survives regeneration: - an override of the normal-model partial marks a primitive-only oneOf model with its member types (a non-empty oneOf list is the only thing telling it apart from a genuinely empty object model); - model_utils validates such a property against the member types, also admits an int on a union that contains float, and skips the int-to-float upconversion for these unions only, so 20 stays 20 through a read, the constructor and the wire. A wrong type, such as a dict, a list or a bool on a number union, is still rejected. Empty object models and plain number properties behave as before. The client is regenerated from the specs already in schemas/, so the generated diff is the seven union models and model_utils alone. The override is a full copy of the upstream partial and must be reconciled on a generator upgrade; a move to generator v7's python generator, which emits real unions, would retire it. jira: LX-3540 risk: low Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * test(gooddata-sdk): carry style values through document round trips The document unit tests carried no style, so nothing in the SDK suite exercised the number-or-string unions a real Publisher document uses. Their literal now has a page `gap: 20`, a container padding theme token, a `borderRadius: 4.5` and a visualization's `display.dataLabels.visible: "auto"`, in the document as well as in the document and page templates. The round-trip assertions compare types as well as values, because `==` treats 20 and 20.0 as equal and would not notice an int turned into a float. A new test deserializes a layout body the way an API response is deserialized and builds the SDK layer from it, which is the path the reported read failure took. The hand-built document in the period test now takes its content in the form a read holds it, with the client's python names for the keys the client models, as for any document's content in memory. jira: LX-3540 risk: nonprod Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * test(gooddata-sdk): seed style values in the recorded document round trip The recorded document store-load-put test seeded a document without any style, so the real-backend round trip never carried the number-or-string values a Publisher document has. The seed layout now has a page `gap: 20`, a container padding theme token, a `borderRadius: 4.5` and a visualization's `display.dataLabels.visible: "auto"`. The test asserts that the read-back page keeps `gap` as the int 20 and the padding as the token string. The test fails on replay until its cassette is re-recorded against the backend with the new seed. jira: LX-3540 risk: nonprod Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * chore(gooddata-sdk): re-record the document round-trip cassette The recorded document store-load-put test now seeds a page gap, a container padding token, a border radius and a visualization data label setting, so its cassette is recorded again on the SDK's staging environment, as is and unedited. The read responses carry the page `gap` as the JSON int 20 and the padding as the token string. The recording was made with the metric and visualization permission flags off, like the other document cassettes. No other cassette changes. jira: LX-3540 risk: nonprod Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## rel/dev #1935 +/- ##
========================================
Coverage 86.18% 86.18%
========================================
Files 345 345
Lines 25954 25954
========================================
Hits 22368 22368
Misses 3586 3586 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
🚀 Automated PR to perform merge from master into rel/dev with changes up to 63ae559 (created by https://github.com/gooddata/gooddata-python-sdk/actions/runs/42825095795).