Dynamic Tasks in Airflow

Поділитися
Вставка
  • Опубліковано 12 лис 2024

КОМЕНТАРІ • 22

  • @pawelwiszniewski
    @pawelwiszniewski Рік тому +1

    Great guide, very well explained, thank you!

    • @Astronomer
      @Astronomer  Рік тому +1

      Thank you for the kind words!

  • @shrimp_bucket
    @shrimp_bucket Рік тому

    Hi can I get confirmation? Around 11:35 or so you seem to say that only when the DAG is triggered and begins to run, the task mapping occurs? So I cannot retrieve rows in previous tasks and trigger a dynamic task using that information? It has to be available at runtime?
    So I should create a Orchestrator DAG that would trigger and input these rows of data into the child DAG to then have immediately available for my Dynamic Tasks?

    • @Astronomer
      @Astronomer  Рік тому

      No you can retrieve the rows from a previous task! You would just pass that previous tasks output as a mapping param to the .expand() method and it will dynamically map those at runtime! Definitely do not create an Orchestrator DAG, just set the relationship as shown in these docs: docs.astronomer.io/learn/dynamic-tasks and you should be able to accomplish it within that DAG.

  • @dan-takacs
    @dan-takacs 8 місяців тому

    great video. I'm trying to make this work with LivyOperator do you know if it can be expanded or partial arguments supplied to it?

    • @Astronomer
      @Astronomer  7 місяців тому

      It should work. Generally you can map over any type of operator, but not that some parameters can't be mapped over (e.g. BaseOperator params). More here: docs.astronomer.io/learn/dynamic-tasks

  • @VijayGopalParasuram
    @VijayGopalParasuram Рік тому

    Hello,This is very well explained. Thank you! The map index under the mapped tasks are currently numbered from 0. Would it be possible to update the map index to something meaningful ?

    • @Astronomer
      @Astronomer  Рік тому

      Hmmmm good question, since the Airflow UI can be customized, I imagine you could, but would need to add a filter on top of the task instance to read its properties and then render one of them as the index name/#, but might be more trouble than it's worth!

  • @sri5147
    @sri5147 Рік тому

    When you perform the dynamic tasks that could scale in parallel based on your input dataset, what happens to the task log after the dag is finished?

    • @Astronomer
      @Astronomer  Рік тому +1

      Each Dynamically generated task instance will have its own separate log that you can view in isolation after the dag has finished, just click on the main task and select the task instance you'd like to interact with!

  • @DanielLee-tk6uo
    @DanielLee-tk6uo Рік тому

    Thanks for very helpful video. could I get any other guide to apply dynamic tasks on other operators like athenaoperator?

    • @Astronomer
      @Astronomer  Рік тому

      Totally, the process is pretty much the same for every operator where you'll just add the .expand parameter with any fields you want to be used dynamically

  • @santiagoaquinostachuk734
    @santiagoaquinostachuk734 Рік тому

    Awesome guide, thanks!

  • @amirhosseinsharifinejad7752
    @amirhosseinsharifinejad7752 5 місяців тому

    Really helpful thank you😍

  • @goutham4678
    @goutham4678 Рік тому

    is the presentation shared anywhere?

    • @Astronomer
      @Astronomer  Рік тому

      All of our past webinars are here: www.astronomer.io/events/webinars/

  • @NK-my9cg
    @NK-my9cg 2 роки тому

    Expand Operator will execute sequentially or parallel?

    • @_wildsec
      @_wildsec 2 роки тому +1

      It depends which executor you are using. If you are testing on a local instance, the default executor is SequentialExecutor which only executes one task instance at a time as opposed to other executors which will allow parallelism.

  • @Андрей-с8н2з
    @Андрей-с8н2з 2 роки тому +1

    Great video. Very helpful.