This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from datetime import datetime, timedelta | |
import time | |
import logging | |
from airflow.operators.sensors import BaseSensorOperator | |
from airflow.plugins_manager import AirflowPlugin | |
from airflow.utils.decorators import apply_defaults | |
log = logging.getLogger(__name__) | |
class HelloworldSensor(BaseSensorOperator): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import unittest | |
from datetime import datetime | |
from airflow import DAG | |
from airflow.models import TaskInstance | |
from airflow.operators import MultiplyBy5Operator | |
class TestMultiplyBy5Operator(unittest.TestCase): | |
def test_execute(self): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import logging | |
from airflow.models import BaseOperator | |
from airflow.plugins_manager import AirflowPlugin | |
from airflow.utils.decorators import apply_defaults | |
log = logging.getLogger(__name__) | |
class MultiplyBy5Operator(BaseOperator): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import unittest | |
from airflow.models import DagBag | |
class TestHelloWorldDAG(unittest.TestCase): | |
"""Check HelloWorldDAG expectation""" | |
def setUp(self): | |
self.dagbag = DagBag() | |
def test_task_count(self): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import unittest | |
from airflow.models import DagBag | |
class TestDagIntegrity(unittest.TestCase): | |
LOAD_SECOND_THRESHOLD = 2 | |
def setUp(self): | |
self.dagbag = DagBag() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from datetime import datetime | |
from airflow import DAG | |
from airflow.operators.dummy_operator import DummyOperator | |
from airflow.operators.python_operator import PythonOperator | |
from airflow.operators import MultiplyBy5Operator | |
def print_hello(): | |
return 'Hello Wolrd' | |
dag = DAG('hello_world', description='Hello world example', schedule_interval='0 12 * * *', start_date=datetime(2017, 3, 20), catchup=False) |
NewerOlder