-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from shrutimantri/python-outputs
feat: add blueprint to generate outputs using Python
- Loading branch information
Showing
1 changed file
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |