redpanda-data / redpanda-data/connect
Bloblang shouldn't attempt to implicitly cast expressions to bool in `if` statements
Open
@Jeffail is already working on this.
Since Feb 21, 2023.
annoying
bloblang
bughancement
- Dominant language
- Go
- Stars
- 8.8k
- Forks
- 969
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 64
Description
Try the following:
let foo = "test"
root = if $foo { "bar" } else { "" }
It looks like Bloblang does an implicit cast to bool, but I think it should raise a mapping error. For boolean comparison operators it does mandate boolean values.
LE: I guess the same should be considered for various operators, such as ==. Currently, "false" == false returns false instead of an error.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.