You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "arjunanan6 (via GitHub)" <gi...@apache.org> on 2023/05/25 17:13:59 UTC
[GitHub] [airflow] arjunanan6 opened a new pull request, #31553: Fix sorting of tags
arjunanan6 opened a new pull request, #31553:
URL: https://github.com/apache/airflow/pull/31553
Closes: #31547
Added a sort to the tags that are to be displayed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] arjunanan6 commented on a diff in pull request #31553: Fix sorting of tags
Posted by "arjunanan6 (via GitHub)" <gi...@apache.org>.
arjunanan6 commented on code in PR #31553:
URL: https://github.com/apache/airflow/pull/31553#discussion_r1206318265
##########
airflow/www/templates/airflow/dags.html:
##########
@@ -159,7 +159,7 @@ <h2>{{ page_title }}</h2>
<form id="tags_form">
<div class="form-group search-input">
<select multiple name="tags" id="tags_filter" class="select2-drop-mask">
- {% for tag in tags %}
+ {% for tag in tags.sort() %}
Review Comment:
@pierrejeambrun Would it not be worthwhile to change this in views.py?
Say addition of:
`tags = sorted(tags, key=lambda t: t['name'])`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] arjunanan6 commented on a diff in pull request #31553: Fix sorting of tags
Posted by "arjunanan6 (via GitHub)" <gi...@apache.org>.
arjunanan6 commented on code in PR #31553:
URL: https://github.com/apache/airflow/pull/31553#discussion_r1206824324
##########
airflow/www/templates/airflow/dags.html:
##########
@@ -159,7 +159,7 @@ <h2>{{ page_title }}</h2>
<form id="tags_form">
<div class="form-group search-input">
<select multiple name="tags" id="tags_filter" class="select2-drop-mask">
- {% for tag in tags %}
+ {% for tag in tags.sort() %}
Review Comment:
You are right, that is the better thing to do here. Pushing that change in.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] pierrejeambrun commented on a diff in pull request #31553: Fix sorting of tags
Posted by "pierrejeambrun (via GitHub)" <gi...@apache.org>.
pierrejeambrun commented on code in PR #31553:
URL: https://github.com/apache/airflow/pull/31553#discussion_r1206709881
##########
airflow/www/templates/airflow/dags.html:
##########
@@ -159,7 +159,7 @@ <h2>{{ page_title }}</h2>
<form id="tags_form">
<div class="form-group search-input">
<select multiple name="tags" id="tags_filter" class="select2-drop-mask">
- {% for tag in tags %}
+ {% for tag in tags.sort() %}
Review Comment:
Can you `order_by` directly in the query then ? There is no need to iterate an extra time just to order it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] pierrejeambrun merged pull request #31553: Fix sorting of tags
Posted by "pierrejeambrun (via GitHub)" <gi...@apache.org>.
pierrejeambrun merged PR #31553:
URL: https://github.com/apache/airflow/pull/31553
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] pierrejeambrun commented on a diff in pull request #31553: Fix sorting of tags
Posted by "pierrejeambrun (via GitHub)" <gi...@apache.org>.
pierrejeambrun commented on code in PR #31553:
URL: https://github.com/apache/airflow/pull/31553#discussion_r1205931887
##########
airflow/www/templates/airflow/dags.html:
##########
@@ -159,7 +159,7 @@ <h2>{{ page_title }}</h2>
<form id="tags_form">
<div class="form-group search-input">
<select multiple name="tags" id="tags_filter" class="select2-drop-mask">
- {% for tag in tags %}
+ {% for tag in tags.sort() %}
Review Comment:
This will sort but there is no key specified, will this sort on the DagTag.id ? Is it what we want, maybe the name is more relevant ?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] arjunanan6 commented on a diff in pull request #31553: Fix sorting of tags
Posted by "arjunanan6 (via GitHub)" <gi...@apache.org>.
arjunanan6 commented on code in PR #31553:
URL: https://github.com/apache/airflow/pull/31553#discussion_r1206265583
##########
airflow/www/templates/airflow/dags.html:
##########
@@ -159,7 +159,7 @@ <h2>{{ page_title }}</h2>
<form id="tags_form">
<div class="form-group search-input">
<select multiple name="tags" id="tags_filter" class="select2-drop-mask">
- {% for tag in tags %}
+ {% for tag in tags.sort() %}
Review Comment:
Ah you are absolutely right, it should indeed be sorted by name. Looking into that now.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] arjunanan6 commented on pull request #31553: Fix sorting of tags
Posted by "arjunanan6 (via GitHub)" <gi...@apache.org>.
arjunanan6 commented on PR #31553:
URL: https://github.com/apache/airflow/pull/31553#issuecomment-1563246588
@ashb @pierrejeambrun Sorry about the mess, but could you check this again?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] arjunanan6 commented on a diff in pull request #31553: Fix sorting of tags
Posted by "arjunanan6 (via GitHub)" <gi...@apache.org>.
arjunanan6 commented on code in PR #31553:
URL: https://github.com/apache/airflow/pull/31553#discussion_r1206826780
##########
airflow/www/templates/airflow/dags.html:
##########
@@ -159,7 +159,7 @@ <h2>{{ page_title }}</h2>
<form id="tags_form">
<div class="form-group search-input">
<select multiple name="tags" id="tags_filter" class="select2-drop-mask">
- {% for tag in tags %}
+ {% for tag in tags.sort() %}
Review Comment:
@pierrejeambrun Done, I've tried it out locally and it looks good there.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] malthe commented on pull request #31553: Fix sorting of tags
Posted by "malthe (via GitHub)" <gi...@apache.org>.
malthe commented on PR #31553:
URL: https://github.com/apache/airflow/pull/31553#issuecomment-1563386983
```python
> {% for tag in tags.sort() %}
E TypeError: '<' not supported between instances of 'dict' and 'dict'
```
I guess tags are sometimes a list of dicts, not strings?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] arjunanan6 commented on a diff in pull request #31553: Fix sorting of tags
Posted by "arjunanan6 (via GitHub)" <gi...@apache.org>.
arjunanan6 commented on code in PR #31553:
URL: https://github.com/apache/airflow/pull/31553#discussion_r1206265583
##########
airflow/www/templates/airflow/dags.html:
##########
@@ -159,7 +159,7 @@ <h2>{{ page_title }}</h2>
<form id="tags_form">
<div class="form-group search-input">
<select multiple name="tags" id="tags_filter" class="select2-drop-mask">
- {% for tag in tags %}
+ {% for tag in tags.sort() %}
Review Comment:
Ah you are absolutely right, it should indeed be sorted by name. Looking into that.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] arjunanan6 commented on a diff in pull request #31553: Fix sorting of tags
Posted by "arjunanan6 (via GitHub)" <gi...@apache.org>.
arjunanan6 commented on code in PR #31553:
URL: https://github.com/apache/airflow/pull/31553#discussion_r1206512882
##########
airflow/www/templates/airflow/dags.html:
##########
@@ -159,7 +159,7 @@ <h2>{{ page_title }}</h2>
<form id="tags_form">
<div class="form-group search-input">
<select multiple name="tags" id="tags_filter" class="select2-drop-mask">
- {% for tag in tags %}
+ {% for tag in tags.sort() %}
Review Comment:
Just tested this out locally and it works as expected, I think this change to views.py is all that is needed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] arjunanan6 commented on a diff in pull request #31553: Fix sorting of tags
Posted by "arjunanan6 (via GitHub)" <gi...@apache.org>.
arjunanan6 commented on code in PR #31553:
URL: https://github.com/apache/airflow/pull/31553#discussion_r1206514760
##########
airflow/www/templates/airflow/dags.html:
##########
@@ -159,7 +159,7 @@ <h2>{{ page_title }}</h2>
<form id="tags_form">
<div class="form-group search-input">
<select multiple name="tags" id="tags_filter" class="select2-drop-mask">
- {% for tag in tags %}
+ {% for tag in tags.sort() %}
Review Comment:

--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org