Skip to content

Commit

Permalink
Merge pull request #7 from shrutimantri/python-outputs
Browse files Browse the repository at this point in the history
feat: add blueprint to generate outputs using Python
  • Loading branch information
wrussell1999 authored Nov 6, 2024
2 parents 11376ea + b893ae1 commit 9042df5
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions python-generate-outputs-simple.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
id: python-generate-outputs-simple
namespace: company.team

tasks:
- id: generate_output
type: io.kestra.plugin.scripts.python.Script
beforeCommands:
- pip install kestra
script: |
from kestra import Kestra
marks = [79, 91, 85, 64, 82]
Kestra.outputs({"total_marks": sum(marks),"average_marks": sum(marks)/len(marks)})
- id: log_result
type: io.kestra.plugin.core.log.Log
message:
- "Total Marks: {{ outputs.generate_output.vars.total_marks }}"
- "Average Marks: {{ outputs.generate_output.vars.average_marks }}"
extend:
title: Run a simple Python script to generate outputs and log them
description: >-
This flow generates outputs in a simple Python script, and then logs them.
The flow has two tasks:
1. Generate outputs using Python script
2. Log the outputs generated in the prior task
tags:
- Python
- Outputs
ee: false
demo: true
meta_description: This flow generates outputs using Python script and logs the outputs

0 comments on commit 9042df5

Please sign in to comment.