YAQL function "str" doesn't work properly for lists
Bug #1815710 reported by
Renat Akhmerov
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mistral |
Won't Fix
|
Medium
|
Renat Akhmerov |
Bug Description
If we run the workflow:
test_yaql:
input:
- my_list
tasks:
task1:
action: std.noop
publish:
val: <% str($.my_list) %>
against the input:
{
"my_list": [
{
"k1": "v1",
"k2": "v2"
}
]
}
Then we'll get a result of publish that doesn't include square brackets:
{'val': "({'k1': 'v1', 'k2': 'v2'},)"}
It is claimed that in Queens version the result would contain square brackets:
{'val': "[{'k1': 'v1', 'k2': 'v2'}]"}
So, in fact, we have a list of dictionaries here that is not properly represented with the "str" YAQL function.
Changed in mistral: | |
milestone: | none → stein-3 |
description: | updated |
Changed in mistral: | |
importance: | Undecided → Medium |
status: | New → Confirmed |
description: | updated |
description: | updated |
summary: |
- YAQL function "str" doesn't work properly for lists + YAQL function "str" doesn't work properly for lists of dictionaries |
description: | updated |
Changed in mistral: | |
assignee: | nobody → Renat Akhmerov (rakhmerov) |
Changed in mistral: | |
status: | Confirmed → In Progress |
summary: |
- YAQL function "str" doesn't work properly for lists of dictionaries + YAQL function "str" doesn't work properly for lists |
To post a comment you must log in.
It happens because of the line:
new_ctx['$'] = yaql_utils. convert_ input_data( data_context)
in the module mistral/ utils/expressio n_utils. py
(Currently can be seen at https:/ /github. com/openstack/ mistral/ blob/master/ mistral/ utils/expressio n_utils. py#L51)
The patch where this issue was introduced: https:/ /review. openstack. org/#/c/ 477816/