You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by da...@apache.org on 2016/08/11 04:00:46 UTC

incubator-airflow git commit: [AIRFLOW-407] Add different colors for some sensors

Repository: incubator-airflow
Updated Branches:
  refs/heads/master 477944c96 -> 9aa7da501


[AIRFLOW-407] Add different colors for some sensors

These colors were added (leftmost is the default sensor color):

https://cloud.githubusercontent.com/assets/130362/17538403/e57502e4-5e59-11e6-9a65-80134d1e77af.png

- Create a DAG with all these operators and take a screenshot

Closes #1718 from zodiac/xuanji/add_colours_to_sensors


Project: http://git-wip-us.apache.org/repos/asf/incubator-airflow/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-airflow/commit/9aa7da50
Tree: http://git-wip-us.apache.org/repos/asf/incubator-airflow/tree/9aa7da50
Diff: http://git-wip-us.apache.org/repos/asf/incubator-airflow/diff/9aa7da50

Branch: refs/heads/master
Commit: 9aa7da501373ecaba2485f21ed644036669596a0
Parents: 477944c
Author: Li Xuanji <xu...@gmail.com>
Authored: Wed Aug 10 20:59:45 2016 -0700
Committer: Dan Davydov <da...@airbnb.com>
Committed: Wed Aug 10 20:59:49 2016 -0700

----------------------------------------------------------------------
 airflow/contrib/operators/fs_operator.py   | 1 +
 airflow/contrib/sensors/emr_base_sensor.py | 1 +
 airflow/operators/sensors.py               | 6 ++++++
 3 files changed, 8 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/9aa7da50/airflow/contrib/operators/fs_operator.py
----------------------------------------------------------------------
diff --git a/airflow/contrib/operators/fs_operator.py b/airflow/contrib/operators/fs_operator.py
index f89564c..2596487 100644
--- a/airflow/contrib/operators/fs_operator.py
+++ b/airflow/contrib/operators/fs_operator.py
@@ -33,6 +33,7 @@ class FileSensor(BaseSensorOperator):
     :type fs_conn_id: string
     """
     template_fields = ('filepath',)
+    ui_color = '#91818a'
 
     @apply_defaults
     def __init__(

http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/9aa7da50/airflow/contrib/sensors/emr_base_sensor.py
----------------------------------------------------------------------
diff --git a/airflow/contrib/sensors/emr_base_sensor.py b/airflow/contrib/sensors/emr_base_sensor.py
index c5dd1ca..5526604 100644
--- a/airflow/contrib/sensors/emr_base_sensor.py
+++ b/airflow/contrib/sensors/emr_base_sensor.py
@@ -25,6 +25,7 @@ class EmrBaseSensor(BaseSensorOperator):
     Subclasses should implement get_emr_response() and state_from_response() methods.
     Subclasses should also implment NON_TERMINAL_STATES and FAILED_STATE constants.
     """
+    ui_color = '#66c3ff'
 
     @apply_defaults
     def __init__(

http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/9aa7da50/airflow/operators/sensors.py
----------------------------------------------------------------------
diff --git a/airflow/operators/sensors.py b/airflow/operators/sensors.py
index 467c468..570b682 100644
--- a/airflow/operators/sensors.py
+++ b/airflow/operators/sensors.py
@@ -92,6 +92,7 @@ class SqlSensor(BaseSensorOperator):
     """
     template_fields = ('sql',)
     template_ext = ('.hql', '.sql',)
+    ui_color = '#7c7287'
 
     @apply_defaults
     def __init__(self, conn_id, sql, *args, **kwargs):
@@ -135,6 +136,7 @@ class MetastorePartitionSensor(SqlSensor):
     :type mysql_conn_id: str
     """
     template_fields = ('partition_name', 'table', 'schema')
+    ui_color = '#8da7be'
 
     @apply_defaults
     def __init__(
@@ -190,6 +192,7 @@ class ExternalTaskSensor(BaseSensorOperator):
         or execution_date_fn can be passed to ExternalTaskSensor, but not both.
     :type execution_date_fn: callable
     """
+    ui_color = '#19647e'
 
     @apply_defaults
     def __init__(
@@ -257,6 +260,7 @@ class NamedHivePartitionSensor(BaseSensorOperator):
     """
 
     template_fields = ('partition_names', )
+    ui_color = '#8d99ae'
 
     @apply_defaults
     def __init__(
@@ -330,6 +334,7 @@ class HivePartitionSensor(BaseSensorOperator):
     :type metastore_conn_id: str
     """
     template_fields = ('schema', 'table', 'partition',)
+    ui_color = '#2b2d42'
 
     @apply_defaults
     def __init__(
@@ -366,6 +371,7 @@ class HdfsSensor(BaseSensorOperator):
     Waits for a file or folder to land in HDFS
     """
     template_fields = ('filepath',)
+    ui_color = '#4d9de0'
 
     @apply_defaults
     def __init__(