How to run airflow script after previous airflow script is complete?











up vote
0
down vote

favorite












I know that for example if we have several sql files in the data folder we can set priorities like script1 >> script2 in the end.
However, can we set priorities of other airflow scripts which are actually in the dag folder?










share|improve this question


























    up vote
    0
    down vote

    favorite












    I know that for example if we have several sql files in the data folder we can set priorities like script1 >> script2 in the end.
    However, can we set priorities of other airflow scripts which are actually in the dag folder?










    share|improve this question
























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I know that for example if we have several sql files in the data folder we can set priorities like script1 >> script2 in the end.
      However, can we set priorities of other airflow scripts which are actually in the dag folder?










      share|improve this question













      I know that for example if we have several sql files in the data folder we can set priorities like script1 >> script2 in the end.
      However, can we set priorities of other airflow scripts which are actually in the dag folder?







      python google-cloud-platform airflow airflow-scheduler






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 8 at 11:29









      pepperjohn

      236




      236
























          1 Answer
          1






          active

          oldest

          votes

















          up vote
          2
          down vote













          Those are not priorities, those are execution order. If you want a particular DAG to execute first then just set it at an earlier execution time than other DAGs.



          script1 >> script2 means that script1 executes first and only then script2 executes.



          You can try to artificially enforce priority by assigning a specific DAG to a named queue where it is the only DAG that executes in that named queue. Other than that there is no explicit way to have priority for entire DAGs.



          For an Operator inside a DAG however you can use the priority_weight parameter in the BaseOperator.






          share|improve this answer





















          • Thanks Medhdeep that makes sense!
            – pepperjohn
            Nov 9 at 17:02











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














           

          draft saved


          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53206852%2fhow-to-run-airflow-script-after-previous-airflow-script-is-complete%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          2
          down vote













          Those are not priorities, those are execution order. If you want a particular DAG to execute first then just set it at an earlier execution time than other DAGs.



          script1 >> script2 means that script1 executes first and only then script2 executes.



          You can try to artificially enforce priority by assigning a specific DAG to a named queue where it is the only DAG that executes in that named queue. Other than that there is no explicit way to have priority for entire DAGs.



          For an Operator inside a DAG however you can use the priority_weight parameter in the BaseOperator.






          share|improve this answer





















          • Thanks Medhdeep that makes sense!
            – pepperjohn
            Nov 9 at 17:02















          up vote
          2
          down vote













          Those are not priorities, those are execution order. If you want a particular DAG to execute first then just set it at an earlier execution time than other DAGs.



          script1 >> script2 means that script1 executes first and only then script2 executes.



          You can try to artificially enforce priority by assigning a specific DAG to a named queue where it is the only DAG that executes in that named queue. Other than that there is no explicit way to have priority for entire DAGs.



          For an Operator inside a DAG however you can use the priority_weight parameter in the BaseOperator.






          share|improve this answer





















          • Thanks Medhdeep that makes sense!
            – pepperjohn
            Nov 9 at 17:02













          up vote
          2
          down vote










          up vote
          2
          down vote









          Those are not priorities, those are execution order. If you want a particular DAG to execute first then just set it at an earlier execution time than other DAGs.



          script1 >> script2 means that script1 executes first and only then script2 executes.



          You can try to artificially enforce priority by assigning a specific DAG to a named queue where it is the only DAG that executes in that named queue. Other than that there is no explicit way to have priority for entire DAGs.



          For an Operator inside a DAG however you can use the priority_weight parameter in the BaseOperator.






          share|improve this answer












          Those are not priorities, those are execution order. If you want a particular DAG to execute first then just set it at an earlier execution time than other DAGs.



          script1 >> script2 means that script1 executes first and only then script2 executes.



          You can try to artificially enforce priority by assigning a specific DAG to a named queue where it is the only DAG that executes in that named queue. Other than that there is no explicit way to have priority for entire DAGs.



          For an Operator inside a DAG however you can use the priority_weight parameter in the BaseOperator.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 9 at 4:27









          Meghdeep Ray

          2,44821737




          2,44821737












          • Thanks Medhdeep that makes sense!
            – pepperjohn
            Nov 9 at 17:02


















          • Thanks Medhdeep that makes sense!
            – pepperjohn
            Nov 9 at 17:02
















          Thanks Medhdeep that makes sense!
          – pepperjohn
          Nov 9 at 17:02




          Thanks Medhdeep that makes sense!
          – pepperjohn
          Nov 9 at 17:02


















           

          draft saved


          draft discarded



















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53206852%2fhow-to-run-airflow-script-after-previous-airflow-script-is-complete%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Schultheiß

          Verwaltungsgliederung Dänemarks

          Liste der Kulturdenkmale in Wilsdruff