feat: Add CompoundMeasureValueFilter#1304
Merged
jeskepetr merged 1 commit intogooddata:masterfrom Feb 10, 2026
Merged
Conversation
Adding CompoundMeasureValueFilter definition, which can be used to define several numerical conditions in a single filter. JIRA: LX-2073 risk: low
eadaa4b to
642305a
Compare
chrisbonilla95
approved these changes
Feb 10, 2026
hkad98
reviewed
Feb 10, 2026
| return afm_models.MeasureValueCondition(range=range_body, _check_type=False) | ||
|
|
||
| def description(self) -> str: | ||
| not_between = "not" if self.operator == "NOT_BETWEEN" else "" |
Contributor
There was a problem hiding this comment.
Based on usage in the example below, maybe "not " (missing space)?
hkad98
reviewed
Feb 10, 2026
|
|
||
| @attrs.define(frozen=True, slots=True) | ||
| class MetricValueComparisonCondition: | ||
| operator: str |
Contributor
There was a problem hiding this comment.
Consider using StrEnum or Literal. I suspect that the values will not change.
hkad98
reviewed
Feb 10, 2026
Comment on lines
+122
to
+123
| if "compoundMeasureValueFilter" in filter_dict: | ||
| f = filter_dict["compoundMeasureValueFilter"] |
Contributor
There was a problem hiding this comment.
Simplification:
Suggested change
| if "compoundMeasureValueFilter" in filter_dict: | |
| f = filter_dict["compoundMeasureValueFilter"] | |
| f = filter_dict.get("compoundMeasureValueFilter" , {}) |
Contributor
Author
There was a problem hiding this comment.
Not sure if I get this one, this would change the behaviour or not?
For non-compound filters, f becomes {} and the code would then hit f["measure"] (or similar) and fail with a KeyError, instead of cleanly falling through to the other filter types.
It also hides bugs: defaulting to {} makes “missing key” look like “present but empty”.
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.
Adding CompoundMeasureValueFilter definition, which can be used to define several numerical conditions in a single filter.
JIRA: LX-2073
risk: low