kestra-io / kestra

:zap: Workflow Automation Platform. Orchestrate & Schedule code in any language, run anywhere, 500+ plugins. Alternative to Zapier, Rundeck, Camunda, Airflow...
https://kestra.io
Apache License 2.0
10.82k stars 938 forks source link

Expand the first output of the first task by default #5523

Open anna-geller opened 1 week ago

anna-geller commented 1 week ago

Feature description

Video Explanation: https://share.descript.com/view/XZfNQXgUj5A

When you run the workflow below and navigate to Outputs, you currently see only tasks and you need to expand to see any task outputs:

image

We had a customer request to expand the first output of the first task by default — this will also make the Outputs functionality more visible and will highlight the important Debug Outputs button:

image

image

Reproducer workflow:

id: data_engineering_pipeline
namespace: tutorial
description: Data Engineering Pipelines

inputs:
  - id: columns_to_keep
    type: ARRAY
    itemType: STRING
    defaults: 
      - brand
      - price

tasks:
  - id: extract
    type: io.kestra.plugin.core.http.Download
    uri: https://dummyjson.com/products

  - id: transform
    type: io.kestra.plugin.scripts.python.Script
    containerImage: python:3.11-alpine
    inputFiles:
      data.json: "{{ outputs.extract.uri }}"
    outputFiles:
      - "*.json"
    env:
      COLUMNS_TO_KEEP: "{{ inputs.columns_to_keep }}"
    script: |
      import json
      import os

      columns_to_keep_str = os.getenv("COLUMNS_TO_KEEP")
      columns_to_keep = json.loads(columns_to_keep_str)

      with open("data.json", "r") as file:
          data = json.load(file)

      filtered_data = [
          {column: product.get(column, "N/A") for column in columns_to_keep}
          for product in data["products"]
      ]

      with open("products.json", "w") as file:
          json.dump(filtered_data, file, indent=4)

  - id: query
    type: io.kestra.plugin.jdbc.duckdb.Query
    inputFiles:
      products.json: "{{ outputs.transform.outputFiles['products.json'] }}"
    sql: |
      INSTALL json;
      LOAD json;
      SELECT brand, round(avg(price), 2) as avg_price
      FROM read_json_auto('{{ workingDir }}/products.json')
      GROUP BY brand
      ORDER BY avg_price DESC;
    store: true
LakshmiSowmya04 commented 1 week ago

@anna-geller thank you for the detailed explanation !! We want the output field also to be expanded by default likewise the tasks right?

Skraye commented 1 week ago

Hello @LakshmiSowmya04 , the need here is by default the first task has its first output expand, so the right menu with the debug button appear directly to the user when arriving on the Output tabs

Do you want me to assign you to this issue ?

LakshmiSowmya04 commented 1 week ago

Hello @LakshmiSowmya04 , the need here is by default the first task has its first output expand, so the right menu with the debug button appear directly to the user when arriving on the Output tabs

Do you want me to assign you to this issue ?

Yeah....so we have to add functionality which will automatically expand output tab right?

Thank you again.....