Dynamic Tasks in Airflow

แชร์
ฝัง
  • เผยแพร่เมื่อ 18 ต.ค. 2022
  • In this webinar, we provide an overview of the dynamic task mapping feature that was first introduced in Airflow 2.3 and expanded further in Airflow 2.4. Previously, tasks could only be generated dynamically at the time the DAG was parsed. Now, with dynamic task mapping, you can create tasks at runtime based on external criteria, without knowing in advance how many tasks you need.
    The webinar, which reviews the basic functions of dynamic task mapping through pertinent use cases, answers questions like:
    -What is the difference between static and dynamic tasks in Airflow?
    -How do you implement dynamic task mapping?
    -What are the benefits of dynamic task mapping?
    -What is a dynamic DAG and how does it compare to a dynamic task?
    All of the sample code shown in this webinar can be found in this repo. github.com/astronomer/webinar...
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 22

  • @amirhosseinsharifinejad7752
    @amirhosseinsharifinejad7752 หลายเดือนก่อน

    Really helpful thank you😍

  • @santiagoaquinostachuk734
    @santiagoaquinostachuk734 ปีที่แล้ว

    Awesome guide, thanks!

    • @Astronomer
      @Astronomer  ปีที่แล้ว

      No problem, glad you enjoyed!

  • @pawelwiszniewski
    @pawelwiszniewski ปีที่แล้ว +1

    Great guide, very well explained, thank you!

    • @Astronomer
      @Astronomer  ปีที่แล้ว +1

      Thank you for the kind words!

  • @user-kf2mf9ct6i
    @user-kf2mf9ct6i ปีที่แล้ว +1

    Great video. Very helpful.

    • @Astronomer
      @Astronomer  ปีที่แล้ว

      Glad it was helpful!

  • @dan-takacs
    @dan-takacs 3 หลายเดือนก่อน

    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  3 หลายเดือนก่อน

      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

  • @user-co8ee1ur1k
    @user-co8ee1ur1k 10 หลายเดือนก่อน

    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  9 หลายเดือนก่อน

      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!

  • @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

  • @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!

  • @shrimp_bucket
    @shrimp_bucket 11 หลายเดือนก่อน

    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  11 หลายเดือนก่อน

      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.

  • @NK-my9cg
    @NK-my9cg ปีที่แล้ว

    Expand Operator will execute sequentially or parallel?

    • @_wildsec
      @_wildsec ปีที่แล้ว +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.

  • @goutham4678
    @goutham4678 ปีที่แล้ว

    is the presentation shared anywhere?

    • @Astronomer
      @Astronomer  ปีที่แล้ว

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