Get UI color of operators from airflow.cfg #21692
Replies: 8 comments
-
Thanks for opening your first issue here! Be sure to follow the issue template! |
Beta Was this translation helpful? Give feedback.
-
Hi @JavierLTPromofarma I like the idea in general. However, I think that it may make config a little bit messy. I am also wondering if it would make sense to somehow unify / standardize approach to operators UI colors, WDYT? |
Beta Was this translation helpful? Give feedback.
-
Thanks for answering Tomek. The idea is not to have all the operators with a color in the config, but only the operators you want to modify it. So if you like all the default colors, your [colors] section will be empty, or even won't be there. Otherwise, if you want (as the most likely case) a few modifications, it would be just a few lines, that could be at the end of everything or even in the webserver config file. I am not sure if it would make sense the standardization, since every project/company uses a different combination of Operators, and I think it would still require some customization. For instance, we could set the color of Azure Storage, Google Cloud Storage and S3 operators under the premise that usually they are not used together, and use the same color for all of them, but probably there would be out there at least one person who would need to use more than one service in the same DAG and hence customize the color. Furthermore, I see other cases where a customization would be needed: color blindness (there are different types and would be impossible to satisfy all of them), strong personal preferences for other colors than the default ones, very bad screens that don't show correctly certain colors... |
Beta Was this translation helpful? Give feedback.
-
This sounds like a user preference and probably should be configured on a per user basis. Thus, I'm not sure if config (which is one for all Airflow deployment users) is the best place for such customization. |
Beta Was this translation helpful? Give feedback.
-
I'm not sure either, but I think this customization has to be addressed somehow in order to avoid the necessity of modifying the core code of Airflow. Do you (or anyone) come up with something? |
Beta Was this translation helpful? Give feedback.
-
@JavierLTPromofarma Have you tried to set a cluster policy? I think it should work. |
Beta Was this translation helpful? Give feedback.
-
Hi @mik-laj and @turbaszek Do you think this could be achieved with DAG cluster policy or should I use task cluster policy? Also, is there a task.color property or something like that? Hopefully I can make it work with cluster policy and close this issue as well adding some docs |
Beta Was this translation helpful? Give feedback.
-
You can use Cluster Policy for DAG as well as Cluster Policy for tasks. The difference is very small. In this case, using the cluster policy for tasks will be easier. airflow/airflow/models/dagbag.py Lines 430 to 434 in e6c61ca There are two attributes to configure tasks colors. airflow/airflow/models/baseoperator.py Lines 407 to 408 in e6c61ca |
Beta Was this translation helpful? Give feedback.
-
Description
Being able to get different ui colors than the default ones for operators from airflow.cfg file
Use case / motivation
I want to have more vivid colors for the operators, for being able to notice at a glance which operators are present. Nowadays the operators have different colors, but sometimes they are very similar and it's not that easy to differentiate them.
Currently, this change has to be done modifying the operator file in the installation folder of Airflow, which is inconvenient.
It would be nice to have something like this in airflow.cfg:
[colors]
S3ToRedshiftOperator = #blabla
DummyOperator #nicecolor
Beta Was this translation helpful? Give feedback.
All reactions