Variable \"result\" is referenced before assignment
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 6.5k
- Forks
- 787
- PR merge metrics
- No merged PRs in 30d
Description
In stackstorm, I'm building a workflow that includes a task that uses a prometheus query and needs to transfer the results to another task. But when I try to call the result to a variable, I get an error.
Variable "result" is referenced before assignment
Below is my workflow.
version: 1.0
tasks:
[221, 79]
task1:
action: prometheus.query
input:
log_level: DEBUG
query:
url: ""
next:
# #629e47
- when: <% succeeded() %>
do:
- TestTask
publish:
- mem: <% ctx(result).select($.value) %>
Can anyone offer advice on this?
@armab
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.
Research direction
No repository file or test is named. Start by reproducing the shown StackStorm workflow and tracing how prometheus.query publishes its result into ctx(result), then inspect the workflow context and publish documentation or implementation. Done means explaining the error and identifying how the query output can be passed to TestTask.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- prometheus
- Domain
- devops
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100