You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by ka...@apache.org on 2022/07/12 10:39:10 UTC

[airflow] branch main updated: Sort operator extra links (#24992)

This is an automated email from the ASF dual-hosted git repository.

kaxilnaik pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new f5cd2c396b Sort operator extra links (#24992)
f5cd2c396b is described below

commit f5cd2c396bcc9ef2775503b4f86aa9bb7d6c8d93
Author: HTErik <89...@users.noreply.github.com>
AuthorDate: Tue Jul 12 12:38:54 2022 +0200

    Sort operator extra links (#24992)
    
    Today, every time webserver is restarted, the order of the
    operator extra links are randomized due to Python sets being
    unordered.
    
    This change will sort the links according to their name.
    No particular thought has been given to customizing this sort
    order, except to make it consistent so that extra links always
    appear at the same place for the users.
---
 airflow/api_connexion/endpoints/extra_link_endpoint.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/airflow/api_connexion/endpoints/extra_link_endpoint.py b/airflow/api_connexion/endpoints/extra_link_endpoint.py
index 94b36928bf..c464979719 100644
--- a/airflow/api_connexion/endpoints/extra_link_endpoint.py
+++ b/airflow/api_connexion/endpoints/extra_link_endpoint.py
@@ -73,6 +73,6 @@ def get_extra_links(
         (link_name, task.get_extra_links(ti, link_name)) for link_name in task.extra_links
     )
     all_extra_links = {
-        link_name: link_url if link_url else None for link_name, link_url in all_extra_link_pairs
+        link_name: link_url if link_url else None for link_name, link_url in sorted(all_extra_link_pairs)
     }
     return all_extra_links