-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
[pkg/ottl] Add IsBool
Converter
#27897
Labels
Contribfest
enhancement
New feature or request
good first issue
Good for newcomers
help wanted
Extra attention is needed
pkg/ottl
priority:p2
Medium
Comments
TylerHelmuth
added
enhancement
New feature or request
needs triage
New item requiring triage
help wanted
Extra attention is needed
good first issue
Good for newcomers
priority:p2
Medium
Contribfest
and removed
needs triage
New item requiring triage
labels
Oct 20, 2023
TylerHelmuth
changed the title
[pkg/ottl] Add IsDouble Converter
[pkg/ottl] Add Oct 20, 2023
IsBool
Converter
TylerHelmuth
added
pkg/ottl
and removed
help wanted
Extra attention is needed
good first issue
Good for newcomers
labels
Oct 21, 2023
I'd love to have a look at this. |
All yours @els0r, thanks! |
TylerHelmuth
pushed a commit
that referenced
this issue
Nov 13, 2023
**Description:** This PR focuses on adding a new feature to the pkg/ottl package—namely, the `IsBool` converter, along with its prerequisites, `BoolGetter` and `BoolLikeGetter`. The series of commits implement the core logic, unit tests, and documentation to ensure that the `IsBool` converter is seamlessly integrated into the OTTL framework. By using this feature, users can conveniently determine whether a given value is a boolean or not. **Link to tracking Issue:** #27897 **Testing:** - A comprehensive set of unit tests were added to validate the functionality of the `IsBool` converter. The tests cover native boolean values, `pcommon.ValueTypeBool` objects, and incorrect types such as integers and slices. - Tests for `BoolGetter` and `BoolLikeGetter` were also included to verify their behavior and error handling mechanisms. Detailed test implementations can be found in [pkg/ottl/expression_test.go](https://github.com/Dennis40816/opentelemetry-collector-contrib/blob/0d1c2c0216f5647404573a6cfe66ebc0081a4167/pkg/ottl/expression_test.go#L1452). **Documentation:** - Updated README.md in the `pkg/ottl/ottlfuncs` directory to include detailed descriptions, usage guidelines, and examples for the `IsBool` converter. - The README file also reflects the addition of `BoolGetter` and `BoolLikeGetter` to the list of supported types for single-value parameters in OTTL functions.
RoryCrispin
pushed a commit
to ClickHouse/opentelemetry-collector-contrib
that referenced
this issue
Nov 24, 2023
**Description:** This PR focuses on adding a new feature to the pkg/ottl package—namely, the `IsBool` converter, along with its prerequisites, `BoolGetter` and `BoolLikeGetter`. The series of commits implement the core logic, unit tests, and documentation to ensure that the `IsBool` converter is seamlessly integrated into the OTTL framework. By using this feature, users can conveniently determine whether a given value is a boolean or not. **Link to tracking Issue:** open-telemetry#27897 **Testing:** - A comprehensive set of unit tests were added to validate the functionality of the `IsBool` converter. The tests cover native boolean values, `pcommon.ValueTypeBool` objects, and incorrect types such as integers and slices. - Tests for `BoolGetter` and `BoolLikeGetter` were also included to verify their behavior and error handling mechanisms. Detailed test implementations can be found in [pkg/ottl/expression_test.go](https://github.com/Dennis40816/opentelemetry-collector-contrib/blob/0d1c2c0216f5647404573a6cfe66ebc0081a4167/pkg/ottl/expression_test.go#L1452). **Documentation:** - Updated README.md in the `pkg/ottl/ottlfuncs` directory to include detailed descriptions, usage guidelines, and examples for the `IsBool` converter. - The README file also reflects the addition of `BoolGetter` and `BoolLikeGetter` to the list of supported types for single-value parameters in OTTL functions.
TylerHelmuth
added
help wanted
Extra attention is needed
good first issue
Good for newcomers
labels
Dec 13, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Contribfest
enhancement
New feature or request
good first issue
Good for newcomers
help wanted
Extra attention is needed
pkg/ottl
priority:p2
Medium
Component(s)
pkg/ottl
Is your feature request related to a problem? Please describe.
OTTL has no way to check if a value is an
bool
type.Describe the solution you'd like
Add a new Converter,
IsBool
that returns true if the given type is abool
(or equivalent type). It will work similarly to theIsString
function.The implementing PR should
pkg/ottl/ottlfuncs/functions.go
pkg/ottl/ottlfuncs/README.md
The text was updated successfully, but these errors were encountered: