kestra-io / plugin-serdes

https://kestra.io/plugins/plugin-serdes/
Apache License 2.0
2 stars 6 forks source link

Allows multi-sheets read/write on Excel plugin #91

Closed Ben8t closed 2 months ago

Ben8t commented 8 months ago

Feature description

Problem

User have 3 queries she wants to write into 3 sheets in an Excel file.

Possible solution

let from properties take a map to have asheet: {{ outputs }} pattern, like so

from:
  - sheets1: {{ outputs.query1.uri }}
  - sheets2: {{ outputs.query2.uri }}
  - sheets3: {{ outputs.query3.uri }}

(worth mentioning the Excel tasks already have a sheetsTitle property)

anna-geller commented 2 months ago

works now 🎉

id: excel
namespace: company.team

tasks:
  - id: dataset1
    type: io.kestra.plugin.core.http.Download
    uri: https://huggingface.co/datasets/kestra/datasets/raw/main/csv/products.csv

  - id: dataset2
    type: io.kestra.plugin.core.http.Download
    uri: https://huggingface.co/datasets/kestra/datasets/raw/main/csv/fruit.csv

  - id: convert1
    type: io.kestra.plugin.serdes.csv.CsvToIon
    from: "{{ outputs.dataset1.uri }}"

  - id: convert2
    type: io.kestra.plugin.serdes.csv.CsvToIon
    from: "{{ outputs.dataset2.uri }}"

  - id: write
    type: io.kestra.plugin.serdes.excel.IonToExcel
    from: 
      Sheet_1: "{{ outputs.convert1.uri }}"
      Sheet_2: "{{ outputs.convert2.uri }}"