Skip to content

Conversation

@jeskepetr
Copy link
Contributor

Adding CompoundMeasureValueFilter definition, which can be used to define several numerical conditions in a single filter.

JIRA: LX-2073
risk: low

Adding CompoundMeasureValueFilter definition, which can be used to define several numerical conditions in a single filter.

JIRA: LX-2073
risk: low
@jeskepetr jeskepetr merged commit d07d353 into gooddata:master Feb 10, 2026
9 checks passed
return afm_models.MeasureValueCondition(range=range_body, _check_type=False)

def description(self) -> str:
not_between = "not" if self.operator == "NOT_BETWEEN" else ""
Copy link
Contributor

@hkad98 hkad98 Feb 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on usage in the example below, maybe "not " (missing space)?


@attrs.define(frozen=True, slots=True)
class MetricValueComparisonCondition:
operator: str
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider using StrEnum or Literal. I suspect that the values will not change.

Comment on lines +122 to +123
if "compoundMeasureValueFilter" in filter_dict:
f = filter_dict["compoundMeasureValueFilter"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Simplification:

Suggested change
if "compoundMeasureValueFilter" in filter_dict:
f = filter_dict["compoundMeasureValueFilter"]
f = filter_dict.get("compoundMeasureValueFilter" , {})

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

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.

3 participants