From 26bff8ff72be8e762647098a6f539f612b768ca4 Mon Sep 17 00:00:00 2001 From: Karthikeyan Singaravelan Date: Thu, 17 Jul 2025 20:05:18 +0530 Subject: [PATCH] Revert "docs: remove DAG owner links how-to since no feature parity (#49262)" This reverts commit b1033fc8437b9628293b0677e428747a874acfc8. --- airflow-core/docs/howto/add-owner-links.rst | 50 +++++++++++++++++++++ airflow-core/docs/howto/index.rst | 1 + 2 files changed, 51 insertions(+) create mode 100644 airflow-core/docs/howto/add-owner-links.rst diff --git a/airflow-core/docs/howto/add-owner-links.rst b/airflow-core/docs/howto/add-owner-links.rst new file mode 100644 index 0000000000000..fbc8445209df1 --- /dev/null +++ b/airflow-core/docs/howto/add-owner-links.rst @@ -0,0 +1,50 @@ + .. Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + .. http://www.apache.org/licenses/LICENSE-2.0 + + .. Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. + + + + +Add Owner Links to DAG +======================= + +.. versionadded:: 2.4.0 + +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. + +Two options are supported: + +* An HTTP link (e.g. ``https://www.example.com``) which opens the webpage in your default internet client +* A `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 + + with DAG( + dag_id="example_dag_owners", + start_date=datetime(2022, 8, 5), + schedule="0 0 * * *", + owner_links={"airflow": "https://airflow.apache.org"}, + ): + BashOperator(task_id="task_using_linked_owner", bash_command="echo 1", owner="airflow") + +**Screenshot**: + +.. image:: ../img/howto-owner-links.gif diff --git a/airflow-core/docs/howto/index.rst b/airflow-core/docs/howto/index.rst index a4bd791200839..cf33ae5911d5e 100644 --- a/airflow-core/docs/howto/index.rst +++ b/airflow-core/docs/howto/index.rst @@ -32,6 +32,7 @@ configuring an Airflow environment. Using the CLI Using the REST API <../security/api> add-dag-tags + add-owner-links notifications set-config set-up-database