Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jython Eval flow example not working as expected #102

Open
shrutimantri opened this issue Jan 27, 2024 · 1 comment
Open

Jython Eval flow example not working as expected #102

shrutimantri opened this issue Jan 27, 2024 · 1 comment
Labels
bug Something isn't working
Milestone

Comments

@shrutimantri
Copy link
Contributor

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))
@shrutimantri shrutimantri added the bug Something isn't working label Jan 27, 2024
@anna-geller anna-geller added this to the v0.16.0 milestone Jan 28, 2024
@anna-geller anna-geller modified the milestones: v0.16.0, v0.17.0 Feb 5, 2024
@anna-geller anna-geller modified the milestones: v0.17.0, v0.20.0 Apr 17, 2024
@github-project-automation github-project-automation bot moved this to Backlog in Issues Jun 10, 2024
@Ben8t
Copy link
Member

Ben8t commented Oct 2, 2024

AttributeError: 'io.kestra.core.runners.DefaultRunContext' object has no attribute 'putTempFile' in <script> at line number 12

@shrutimantri can you update the reproducer please, it doesn't work on my side 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Backlog
Development

No branches or pull requests

3 participants