Skip to content

Kestra task output method - Python boolean not rendered properly #191

@pdondin

Description

@pdondin

Describe the issue

Came from this #help message : https://kestra-io.slack.com/archives/C03FQKXRK3K/p1733159976009429

Context
I have a python script task that basically ends with :

results = {
    'domain': domain,
    'keywords': keywords,
    'description': description,
    'scraping_successful': scraped_data is not None,
    'scraped_content': scraped_data
}

logger.info(results)
# output data for the next task

Kestra.outputs(results)

And while trying to access {{outputs.scrape_website.vars.results}}, it ended up as NameError: name 'true' is not defined. Did you mean: 'True'

Discussion with @Ben8t ; it looks like it should have been the case.
PS : More code context in the slack thread if needed

I found a quick patch going through a json string instead to pass those parameters.

Kestra.outputs({"results": json.dumps(results)})

And getting the var using :

input = {{ outputs.scrape_website["vars"] }}
data = json.loads(input['results'])
logger.info(data)

Environment

  • Kestra Version: latest
  • TaskRunner : Process

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/pluginPlugin-related issue or feature requestbugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions