You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/10/05 18:08:44 UTC

[GitHub] [airflow] jedcunningham opened a new pull request #18753: Chart: Mount DAGs in triggerer

jedcunningham opened a new pull request #18753:
URL: https://github.com/apache/airflow/pull/18753


   We need to mount the DAGs in the triggerer, as triggers could come from
   the DAGs themselves.
   
   Example DAG to demonstrate this, named `custom_trigger.py`, in the root of the DAGS dir:
   ```
   from datetime import datetime
   
   from airflow import DAG
   from airflow.models import BaseOperator
   from airflow.triggers.base import BaseTrigger, TriggerEvent
   
   
   class CustomSuccessTrigger(BaseTrigger):
       def serialize(self):
           return ("custom_trigger.CustomSuccessTrigger", {})
   
       async def run(self):
           yield TriggerEvent(True)
   
   
   class CustomOperator(BaseOperator):
       def execute(self, context):
           self.defer(trigger=CustomSuccessTrigger(), method_name="next")
   
       def next(self, context, event=None):
           return None
   
   
   with DAG(
       "custom_trigger", schedule_interval=None, start_date=datetime(2021, 10, 1)
   ) as dag:
       CustomOperator(task_id="run")
   ```
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] jedcunningham merged pull request #18753: Chart: Mount DAGs in triggerer

Posted by GitBox <gi...@apache.org>.
jedcunningham merged pull request #18753:
URL: https://github.com/apache/airflow/pull/18753


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] github-actions[bot] commented on pull request #18753: Chart: Mount DAGs in triggerer

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #18753:
URL: https://github.com/apache/airflow/pull/18753#issuecomment-934651790


   The PR is likely OK to be merged with just subset of tests for default Python and Database versions without running the full matrix of tests, because it does not modify the core of Airflow. If the committers decide that the full tests matrix is needed, they will add the label 'full tests needed'. Then you should rebase to the latest main or amend the last commit of the PR, and push it with --force-with-lease.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org