Skip to content

Commit

Permalink
[AIRFLOW-407] Add different colors for some sensors
Browse files Browse the repository at this point in the history
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 apache#1718 from zodiac/xuanji/add_colours_to_sensors
  • Loading branch information
ldct authored and aoen committed Aug 11, 2016
1 parent 477944c commit 9aa7da5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions airflow/contrib/operators/fs_operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class FileSensor(BaseSensorOperator):
:type fs_conn_id: string
"""
template_fields = ('filepath',)
ui_color = '#91818a'

@apply_defaults
def __init__(
Expand Down
1 change: 1 addition & 0 deletions airflow/contrib/sensors/emr_base_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__(
Expand Down
6 changes: 6 additions & 0 deletions airflow/operators/sensors.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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__(
Expand Down Expand Up @@ -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__(
Expand Down Expand Up @@ -257,6 +260,7 @@ class NamedHivePartitionSensor(BaseSensorOperator):
"""

template_fields = ('partition_names', )
ui_color = '#8d99ae'

@apply_defaults
def __init__(
Expand Down Expand Up @@ -330,6 +334,7 @@ class HivePartitionSensor(BaseSensorOperator):
:type metastore_conn_id: str
"""
template_fields = ('schema', 'table', 'partition',)
ui_color = '#2b2d42'

@apply_defaults
def __init__(
Expand Down Expand Up @@ -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__(
Expand Down

0 comments on commit 9aa7da5

Please sign in to comment.