Git Product home page Git Product logo

Comments (4)

anna-geller avatar anna-geller commented on July 24, 2024

mainly needed for setting default dates

Risks:

  1. not easy to create run context at the stage of evaluating inputs and creating an execution
  2. It might be complex for users to understand what is possible to use and what not within dynamically rendered inputs

Possible to use only variables not related to the execution context:

  1. Flow variables
  2. Namespace variables
  3. KV Store (soon)
  4. Global env variables globals.myvar

@japerry911 as a workaround, you can use a subflow to use execution context from another flow for dynamic rendering

from kestra.

japerry911 avatar japerry911 commented on July 24, 2024

sounds good/will do, thank you @anna-geller !

from kestra.

anna-geller avatar anna-geller commented on July 24, 2024

sorry Jack, was sharing just raw notes in the meeting. we'll investigate

from kestra.

anna-geller avatar anna-geller commented on July 24, 2024

Hi @japerry911 , discussed with the team and the best solution for now is to use the approach with a string that you used but without a validator (becuase a validator would validate the expression string rather than a rendered date):

id: end_date_demo
namespace: company.team

inputs:
  - id: end_date
    type: STRING
    defaults: "{{ now() | date('yyyy-MM-dd') }}"
    description: The end date to fetch data from Google Ads in the format yyyy-MM-dd e.g. 2024-12-24

tasks:
  - id: print_date
    type: io.kestra.plugin.core.log.Log
    message: hello on {{ render(inputs.end_date) }}

I believe once we fix the issue with null #4065, the use case shared here will become much easier as you will be able to do e.g.:

id: end_date_demo_2
namespace: company.team

inputs:
  - id: end_date
    type: DATE
    defaults: null
    required: false
    description: The end date to fetch data from Google Ads in the format yyyy-MM-dd e.g. 2024-12-24

tasks:
  - id: print_date
    type: io.kestra.plugin.core.log.Log
    message: hello on {{ inputs.end_date ?? now() | date('yyyy-MM-dd') }}

for now, the above flow will not create any execution due to the error:

At end_date: Invalid input for `end_date`, java.lang.Exception: Expected `DATE` 
but received `Invalid date` with errors: 
``` Text 'Invalid date' could not be parsed at index 0 ```, 
but received `Invalid date`

big thanks for flagging this, it's a poor UX atm, we'll tackle this as a high-priority item

from kestra.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.