directed-acyclic-graphs

Airflow trigger DAG anytime after a google sheet is being updated

六月ゝ 毕业季﹏ 提交于 2021-01-29 14:30:58
问题 Is there any way I can schedule a DAG to be triggered right after a google sheet is being updated? Not sure if I get any answer from this doc : https://airflow.readthedocs.io/en/latest/_api/airflow/providers/google/suite/hooks/sheets/index.html 回答1: @Alejandro's direction is right but just expanding on to his answer. You can use HttpSensor operator to do a get request to sheet file by google drive api HttpSensor( task_id='http_sensor_check', http_conn_id='http_default', endpoint='https://www

How do we trigger multiple airflow dags using TriggerDagRunOperator?

感情迁移 提交于 2020-12-03 05:32:13
问题 I have a scenario wherein a particular dag upon completion needs to trigger multiple dags,have used TriggerDagRunOperator to trigger single dag,is it possible to pass multiple dags to the TriggerDagRunOperator to trigger multiple dags? And is it possible to trigger only upon successful completion of the current dag. 回答1: I have faced the same problem. And there is no solution out of the box, but we can write a custom operator for it. So here the code of a custom operator, that get python

How do we trigger multiple airflow dags using TriggerDagRunOperator?

南笙酒味 提交于 2020-12-03 05:28:12
问题 I have a scenario wherein a particular dag upon completion needs to trigger multiple dags,have used TriggerDagRunOperator to trigger single dag,is it possible to pass multiple dags to the TriggerDagRunOperator to trigger multiple dags? And is it possible to trigger only upon successful completion of the current dag. 回答1: I have faced the same problem. And there is no solution out of the box, but we can write a custom operator for it. So here the code of a custom operator, that get python

Spark DAG differs with 'withColumn' vs 'select'

你。 提交于 2020-11-27 20:59:04
问题 Context In a recent SO-post, I discovered that using withColumn may improve the DAG when dealing with stacked/chain column expressions in conjunction with distinct windows specifications. However, in this example, withColumn actually makes the DAG worse and differs to the outcome of using select instead. Reproducible example First, some test data (PySpark 2.4.4 standalone): import pandas as pd import numpy as np from pyspark.sql import SparkSession, Window from pyspark.sql import functions as