You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by je...@apache.org on 2022/09/26 15:09:12 UTC
[airflow] 03/13: Clarify owner links document (#26515)
This is an automated email from the ASF dual-hosted git repository.
jedcunningham pushed a commit to branch v2-4-test
in repository https://gitbox.apache.org/repos/asf/airflow.git
commit 2598efca1da1f2b6b7839f11589043f3d0499fe2
Author: Bas Harenslak <Ba...@users.noreply.github.com>
AuthorDate: Tue Sep 20 17:44:46 2022 +0200
Clarify owner links document (#26515)
This PR fixes several code errors in the owner links doc, rewords some sentences for clarification, and adds examples for all options.
(cherry picked from commit 14c071cac1fa2dbe0cc8d99f8bfedabaa8af2cc3)
---
docs/apache-airflow/howto/add-owner-links.rst | 29 ++++++++++++++-------------
1 file changed, 15 insertions(+), 14 deletions(-)
diff --git a/docs/apache-airflow/howto/add-owner-links.rst b/docs/apache-airflow/howto/add-owner-links.rst
index 4f6525ff66..8c18ca5fd2 100644
--- a/docs/apache-airflow/howto/add-owner-links.rst
+++ b/docs/apache-airflow/howto/add-owner-links.rst
@@ -23,26 +23,27 @@ Add Owner Links to DAG
.. versionadded:: 2.4.0
-You can pass the ``owner_link`` parameter for your DAG object, which will make the owner to become a clickable link
-in the main DAGs view page.
-You can use it to set a custom HTTP link (for example, the owner's Slack channel), or use a
-`maitlo <https://en.wikipedia.org/wiki/Mailto>`_ link to have an automated email message (up to 500 characters).
+You can set the ``owner_links`` argument on your DAG object, which will make the owner a clickable link in the
+main DAGs view page instead of a search filter.
-Example:
-In your DAG file, add a ``owners_link`` parameter to the DAG object that will hold a dictionary of an owner and it's link.
-After that, define a task that will use this owner, and the link in the DAGs view will become clickable
+Two options are supported:
+
+* An HTTP link (e.g. ``https://www.example.com``) which opens the webpage in your default internet client
+* A `mailto <https://en.wikipedia.org/wiki/Mailto>`_ link (e.g. ``mailto:example@airflow.com``) which opens your default email client to send an email to the specified address
+
+In your DAG, set the ``owner_links`` argument specifying a dictionary of an owner (key) and its link (value).
+Next define a task using this owner, and the owner in the DAGs view will link to the specified address.
.. code-block:: python
+ :emphasize-lines: 5
- dag = DAG(
+ with DAG(
dag_id="example_dag_owners",
- schedule="0 0 * * *",
start_date=datetime(2022, 8, 5),
- owner_links={"airflow": "https://airflow.apache.org/"},
- )
-
- with dag:
- bash_task = BashOperator(task_id='task_using_linked_owner', bash_command='echo 1', owner='airflow')
+ schedule="0 0 * * *",
+ owner_links={"airflow": "https://airflow.apache.org"},
+ ):
+ BashOperator(task_id="task_using_linked_owner", bash_command="echo 1", owner="airflow")
**Screenshot**: