Skip to content

Commit

Permalink
Simplify some docs around airflow_local_settings
Browse files Browse the repository at this point in the history
This builds on what we did in apache#37829.
  • Loading branch information
jedcunningham committed Mar 1, 2024
1 parent 6ec7386 commit 8c94268
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 28 deletions.
26 changes: 9 additions & 17 deletions docs/apache-airflow/howto/customize-ui.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,7 @@ Customizing state colours
To change the colors for TaskInstance/DagRun State in the Airflow Webserver, perform the
following steps:

1. Create ``airflow_local_settings.py`` file and put in on ``$PYTHONPATH`` or
to ``$AIRFLOW_HOME/config`` folder. (Airflow adds ``$AIRFLOW_HOME/config`` on ``PYTHONPATH`` when
Airflow is initialized)

See :ref:`Configuring local settings <set-config:configuring-local-settings>` for details on how to
configure local settings.


2. Add the following contents to ``airflow_local_settings.py`` file. Change the colors to whatever you
1. Add the following contents to ``airflow_local_settings.py`` file. Change the colors to whatever you
would like.

.. code-block:: python
Expand All @@ -56,9 +48,10 @@ configure local settings.
"upstream_failed": "orange",
}
See :ref:`Configuring local settings <set-config:configuring-local-settings>` for details on how to
configure local settings.

3. Restart Airflow Webserver.
2. Restart Airflow Webserver.

Screenshots
^^^^^^^^^^^
Expand Down Expand Up @@ -140,11 +133,7 @@ Add custom alert messages on the dashboard
Extra alert messages can be shown on the UI dashboard. This can be useful for warning about setup issues
or announcing changes to end users. The following example shows how to add a simple alert message:

1. Create ``airflow_local_settings.py`` file and put in on ``$PYTHONPATH`` or
to ``$AIRFLOW_HOME/config`` folder. (Airflow adds ``$AIRFLOW_HOME/config`` on ``PYTHONPATH`` when
Airflow is initialized)

2. Add the following contents to ``airflow_local_settings.py`` file.
1. Add the following contents to ``airflow_local_settings.py`` file.

.. code-block:: python
Expand All @@ -154,7 +143,10 @@ or announcing changes to end users. The following example shows how to add a sim
UIAlert("Welcome to Airflow"),
]
3. Restart Airflow Webserver, and you should now see:
See :ref:`Configuring local settings <set-config:configuring-local-settings>` for details on how to
configure local settings.

2. Restart Airflow Webserver, and you should now see:

.. image:: ../img/ui-alert-message.png

Expand Down
12 changes: 1 addition & 11 deletions docs/apache-airflow/howto/export-more-env-vars.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,7 @@ value are must be string.
``dag_id``, ``task_id``, ``execution_date``, ``dag_run_id``,
``dag_owner``, ``dag_email`` are reserved keys.


1. Create ``airflow_local_settings.py`` file and put in on ``$PYTHONPATH`` or
to ``$AIRFLOW_HOME/config`` folder. (Airflow adds ``$AIRFLOW_HOME/config`` on ``PYTHONPATH`` when
Airflow is initialized)

2. Define ``get_airflow_context_vars`` in ``airflow_local_settings.py`` file.


For example:

In your ``airflow_local_settings.py`` file.
For example, in your ``airflow_local_settings.py`` file:

.. code-block:: python
Expand Down

0 comments on commit 8c94268

Please sign in to comment.