Skip to content

Jython Eval flow example not working as expected #102

Closed as not planned
Closed as not planned
@shrutimantri

Description

@shrutimantri

Expected Behavior

On executing the flow, I am expecting the "outputs.out" to have a file containing 2 rows:

555
666

Actual Behaviour

Getting an empty file in outputs.out.

Steps To Reproduce

  1. Run the flow example as mentioned on this page
  2. Check the outputs.out in the Outputs tab. The file will be empty.

Environment Information

  • Kestra Version: 0.13.8
  • Plugin version: 0.13.8
  • Operating System (OS / Docker / Kubernetes): Docker
  • Java Version (If not docker):

Example flow

id: "eval"
type: "io.kestra.plugin.scripts.jython.Eval"
outputs:
  - out
  - map
script: |
  from io.kestra.core.models.executions.metrics import Counter
  import tempfile
  from java.io import File
  
  logger.info('executionId: {}', runContext.render('{{ execution.id }}'))
  runContext.metric(Counter.of('total', 666, 'name', 'bla'))
  
  map = {'test': 'here'}
  tempFile = tempfile.NamedTemporaryFile()
  tempFile.write('555\n666\n')
  
  out = runContext.putTempFile(File(tempFile.name))

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/docsIssues related to documentation, plugin examples, blueprints, and guidesarea/pluginPlugin-related issue or feature requestbugSomething isn't working

    Type

    No type

    Projects

    Status

    Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions