Skip to content

function condition_if will compare int and string #361

@wenfengwang

Description

@wenfengwang

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

  1. create a subscription
vsctl subscription create \
    --eventbus test \
    --sink "http://sink-display:8080" \
    --transformer '{
        "pipeline": [
            {"command":["condition_if","$.data.color", "$.data.test", ">", "bug", "a", "b"]}
        ]
  1. send an event
vsctl event put test --source test --type test \
  --data '{
  "test": 120
}'

2. What did you expect to see? (Required)

no warn log

3. What did you see instead (Required)

...
time="2022-12-24T11:33:24Z" level=warning msg="action execute error" command=CONDITION_IF error="cannot cast from String to Float: strconv.ParseFloat: parsing \"bug\": invalid syntax"

4. What is your Vanus version? (Required)

v0.5.3

Metadata

Metadata

Labels

bugSomething isn't workingdiscussionit's needed to discussionenhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions