Created
June 15, 2015 19:27
-
-
Save mistercrunch/91d90ab05af77c76e1f9 to your computer and use it in GitHub Desktop.
Airflow plugin example
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 airflow.hooks.base_hook import BaseHook | |
from airflow.models import BaseOperator | |
from airflow.executors.base_executor import BaseExecutor | |
from airflow import AirflowViewPlugin, AirflowMacroPlugin | |
from flask_admin import expose | |
class PluginHook(BaseHook): | |
pass | |
class PluginOperator(BaseOperator): | |
pass | |
class PluginExecutor(BaseExecutor): | |
pass | |
class TestView(AirflowViewPlugin): | |
@expose('/') | |
def query(self): | |
return self.render("anomaly/test.html", content="A VAR") | |
def return_success(): | |
return "Success!" | |
anomaly = AirflowMacroPlugin(namespace="anomaly") | |
anomaly.return_success = return_success | |
v = TestView(category="Something", name="Super") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment