Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tag filter doesn't sort tags alphabetically #31547

Closed
2 tasks done
arjunanan6 opened this issue May 25, 2023 · 3 comments · Fixed by #31553
Closed
2 tasks done

Tag filter doesn't sort tags alphabetically #31547

arjunanan6 opened this issue May 25, 2023 · 3 comments · Fixed by #31553
Assignees
Labels
area:UI Related to UI/UX. For Frontend Developers. good first issue kind:feature Feature Requests

Comments

@arjunanan6
Copy link
Contributor

Apache Airflow version

Other Airflow 2 version (please specify below)

What happened

Airflow v: 2.6.0

This has been an issue since 2.4.0 for us at least. We recently did a refactor of many of our 160+ DAGs and part of that process was to remove some tags that we didn't want anymore. Unfortunately, the old tags were still left behind when we deployed our new image with the updated DAGs (been a consistent thing across several Airflow versions for us). There is also the issue that the tag filter doesn't sort our tags alphabetically.

I tried to truncate the dag_tag table, and that did help to get rid of the old tags. However, the sorting issue remains. Example:
image

On one of our dev environments, we have just about 10 DAGs with a similar sorting problem, and the dag_tag table had 18 rows. I took a backup of it and truncated the dag_tag table, which was almost instantly refilled (I guess logs are DEBUG level on that, so I saw nothing). This did not initially fix the sorting problem, but after a couple of truncates, things got weird, and all the tags were sorted as expected, and the row count in the dag_tag table was now just 15, so 3 rows were removed in all. We also added a new DAG in there with a tag "arjun", which also got listed first - so all sorted on that environment.

Summary:

  1. Truncating of the dag_tag table got rid of the old tags that we no longer have in our DAGs.
  2. The tags are still sorted incorrectly in the filter (see image).

It seems that the logic here is contained in www/static/js/dags.js. I am willing to submit a PR if I can get some guidance :)

What you think should happen instead

No response

How to reproduce

N/A

Operating System

debian

Versions of Apache Airflow Providers

No response

Deployment

Official Apache Airflow Helm Chart

Deployment details

No response

Anything else

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

@arjunanan6 arjunanan6 added area:core kind:bug This is a clearly a bug needs-triage label for new issues that we didn't triage yet labels May 25, 2023
@arjunanan6
Copy link
Contributor Author

@ephraimbuddy I think I found the problem. I will make a PR!

@hussein-awala hussein-awala added kind:feature Feature Requests good first issue area:UI Related to UI/UX. For Frontend Developers. and removed kind:bug This is a clearly a bug area:core needs-triage label for new issues that we didn't triage yet labels May 25, 2023
@hussein-awala
Copy link
Member

I think you just need to sort the tags list in this loop:

{% for tag in tags %}

@arjunanan6
Copy link
Contributor Author

Yes, that's exactly what I am doing. PR coming :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:UI Related to UI/UX. For Frontend Developers. good first issue kind:feature Feature Requests
Projects
None yet
2 participants