-
Notifications
You must be signed in to change notification settings - Fork 634
MQE: fix or
where both sides have series with the same labels
#9874
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
# Conflicts: # CHANGELOG.md
5615fa0
to
aff7b54
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, nice find
…rBinaryOperation` to make test stronger
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new branch
git switch --create backport-9874-to-r313 origin/r313
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x b873372adbf0996bff70de55934f3dd4a10c7b89
# Push it to GitHub
git push --set-upstream origin backport-9874-to-r313
git switch main
# Remove the local backport branch
git branch -D backport-9874-to-r313 Then, create a pull request where the |
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new branch
git switch --create backport-9874-to-r314 origin/r314
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x b873372adbf0996bff70de55934f3dd4a10c7b89
# Push it to GitHub
git push --set-upstream origin backport-9874-to-r314
git switch main
# Remove the local backport branch
git branch -D backport-9874-to-r314 Then, create a pull request where the |
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new branch
git switch --create backport-9874-to-r315 origin/r315
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x b873372adbf0996bff70de55934f3dd4a10c7b89
# Push it to GitHub
git push --set-upstream origin backport-9874-to-r315
git switch main
# Remove the local backport branch
git branch -D backport-9874-to-r315 Then, create a pull request where the |
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new branch
git switch --create backport-9874-to-r316 origin/r316
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x b873372adbf0996bff70de55934f3dd4a10c7b89
# Push it to GitHub
git push --set-upstream origin backport-9874-to-r316
git switch main
# Remove the local backport branch
git branch -D backport-9874-to-r316 Then, create a pull request where the |
* MQE: fix `or` where both sides have series with the same labels * Add changelog entry # Conflicts: # CHANGELOG.md * Address PR feedback: move `operators.NewDeduplicateAndMerge` to `NewOrBinaryOperation` to make test stronger (cherry picked from commit b873372) # Conflicts: # CHANGELOG.md
* MQE: fix `or` where both sides have series with the same labels * Add changelog entry # Conflicts: # CHANGELOG.md * Address PR feedback: move `operators.NewDeduplicateAndMerge` to `NewOrBinaryOperation` to make test stronger (cherry picked from commit b873372) # Conflicts: # CHANGELOG.md
* MQE: fix `or` where both sides have series with the same labels * Add changelog entry # Conflicts: # CHANGELOG.md * Address PR feedback: move `operators.NewDeduplicateAndMerge` to `NewOrBinaryOperation` to make test stronger (cherry picked from commit b873372) # Conflicts: # CHANGELOG.md
* MQE: fix `or` where both sides have series with the same labels * Add changelog entry # Conflicts: # CHANGELOG.md * Address PR feedback: move `operators.NewDeduplicateAndMerge` to `NewOrBinaryOperation` to make test stronger (cherry picked from commit b873372) # Conflicts: # CHANGELOG.md
* MQE: fix `or` where both sides have series with the same labels * Add changelog entry # Conflicts: # CHANGELOG.md * Address PR feedback: move `operators.NewDeduplicateAndMerge` to `NewOrBinaryOperation` to make test stronger (cherry picked from commit b873372) # Conflicts: # CHANGELOG.md
… (#9876) * MQE: fix `or` where both sides have series with the same labels * Add changelog entry # Conflicts: # CHANGELOG.md * Address PR feedback: move `operators.NewDeduplicateAndMerge` to `NewOrBinaryOperation` to make test stronger (cherry picked from commit b873372) # Conflicts: # CHANGELOG.md
… (#9877) * MQE: fix `or` where both sides have series with the same labels * Add changelog entry # Conflicts: # CHANGELOG.md * Address PR feedback: move `operators.NewDeduplicateAndMerge` to `NewOrBinaryOperation` to make test stronger (cherry picked from commit b873372) # Conflicts: # CHANGELOG.md
… (#9878) * MQE: fix `or` where both sides have series with the same labels * Add changelog entry # Conflicts: # CHANGELOG.md * Address PR feedback: move `operators.NewDeduplicateAndMerge` to `NewOrBinaryOperation` to make test stronger (cherry picked from commit b873372) # Conflicts: # CHANGELOG.md
… (#9875) * MQE: fix `or` where both sides have series with the same labels * Add changelog entry # Conflicts: # CHANGELOG.md * Address PR feedback: move `operators.NewDeduplicateAndMerge` to `NewOrBinaryOperation` to make test stronger (cherry picked from commit b873372) # Conflicts: # CHANGELOG.md
What this PR does
This PR fixes a bug in MQE's implementation of
or
where it could return incorrect results if both sides contained series with the same labels, and the series on the left side did not have a value for all time steps.For example, in the expression
min(series_1) or min(series_2)
, both sides have a single series with no labels. Previously,or
would have returned two series with the labels{}
, rather than correctly returning a single{}
series.I've opted to use
DeduplicateAndMerge
here, as it's the simplest solution that is already well-tested. A more sophisticated option would be to modifyOrBinaryOperation
to handle this case itself, but this would come at the cost of increased complexity, and it would largely replicate the behaviour and logic ofDeduplicateAndMerge
.The same issue does not affect
and
orunless
, as these operations always return only the left series.Which issue(s) this PR fixes or relates to
(none)
Checklist
CHANGELOG.md
updated - the order of entries should be[CHANGE]
,[FEATURE]
,[ENHANCEMENT]
,[BUGFIX]
.about-versioning.md
updated with experimental features.