这是indexloc提供的服务,不要输入任何密码
Skip to content
This repository was archived by the owner on Feb 13, 2025. It is now read-only.

Conversation

@muffix
Copy link
Member

@muffix muffix commented Nov 9, 2020


Description

Fixes the documentation which described the behaviour of dropbool
incorrectly.
dropbool() currently drops the values where the value in the second
series set IS zero instead of, as described, dropping those where the
value IS NOT zero. To avoid a breaking change which would give the
function the more intuitive behaviour from its name, this only updates
the documentation.

We should consider fixing this with a breaking change in a future
release.

Fixes #2496

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How has this been tested?

  • Query dropbool(series("foo=bar", 0, 1, 1, 1, 2, 1, 3, 1), series("", 0, 1, 1, 2, 2, 3, 3, 2) != 2) returns {"0": 1, "2": 1}
  • Query dropbool(series("foo=bar", 0, 1, 1, 1, 2, 1, 3, 1), series("", 0, 1, 1, 2, 2, 3, 3, 2)) returns {"1": 1, "2": 1, "3": 1}

The behaviour is the inverse of the previously described behaviour. The description is fixed with this PR.

Checklist:

  • This contribution follows the project's code of conduct
  • This contribution follows the project's contributing guidelines
  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

Fixes the documentation which described the behaviour of `dropbool`
incorrectly.
`dropbool()` currently drops the values where the value in the second
series set IS zero instead of, as described, dropping those where the
value IS NOT zero. To avoid a breaking change which would give the
function the more intuitive behaviour from its name, this only updates
the documentation.

We should consider fixing this with a breaking change in a future
release.

Fixes bosun-monitor#2496
Copy link
Contributor

@neilfordyce neilfordyce left a comment

Choose a reason for hiding this comment

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

Well spotted. dropbool keeps things where it's non-zero and drops where it is zero.

@muffix muffix merged commit e25bc3e into bosun-monitor:master May 13, 2021
@muffix muffix deleted the fix-2496 branch May 13, 2021 09:44
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: dropbool() documentation inconsistent with behaviour

2 participants