Skip to content

Enable search in note column in DagRun and TaskInstance#31455

Merged
pierrejeambrun merged 2 commits into
apache:mainfrom
Hajbo:ui-note-search
May 25, 2023
Merged

Enable search in note column in DagRun and TaskInstance#31455
pierrejeambrun merged 2 commits into
apache:mainfrom
Hajbo:ui-note-search

Conversation

@Hajbo

@Hajbo Hajbo commented May 22, 2023

Copy link
Copy Markdown
Contributor

This change re-enables search in notes for the DagRun and TaskInstance views (under the Browse dropdown menu).

Turns out desc.value_attr is the column name in the remote table. This means that this only worked if the attribute with the association proxy had the same name as the associated column, otherwise the wrong column name was used as the key (e.g. content instead of note). The only instance this caused an issue was for the notes, the names were matching in all other cases that are shown in the UI.

I took the liberty to fix the note search for the TaskInstance view as well, at the expense of disabling ordering by note. Unfortunately sorting by an association proxy isn't supported, and mixing it with the actual field reference (table_name.column_name format) didn't solve the issue either.

closes: #30042

@boring-cyborg boring-cyborg Bot added the area:webserver Webserver related Issues label May 22, 2023
@boring-cyborg

boring-cyborg Bot commented May 22, 2023

Copy link
Copy Markdown

Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contribution Guide (https://github.com/apache/airflow/blob/main/CONTRIBUTING.rst)
Here are some useful points:

  • Pay attention to the quality of your code (ruff, mypy and type annotations). Our pre-commits will help you with that.
  • In case of a new feature add useful documentation (in docstrings or in docs/ directory). Adding a new operator? Check this short guide Consider adding an example DAG that shows how users should use it.
  • Consider using Breeze environment for testing locally, it's a heavy docker but it ships with a working Airflow and a lot of integrations.
  • Be patient and persistent. It might take some time to get a review or get the final approval from Committers.
  • Please follow ASF Code of Conduct for all communication including (but not limited to) comments on Pull Requests, Mailing list and Slack.
  • Be sure to read the Airflow Coding style.
    Apache Airflow is a community-driven project and together we are making it better 🚀.
    In case of doubts contact the developers at:
    Mailing List: [email protected]
    Slack: https://s.apache.org/airflow-slack

Comment thread airflow/www/views.py Outdated
@Hajbo
Hajbo requested a review from uranusjr May 22, 2023 07:47
Comment thread airflow/www/views.py
Comment on lines 5533 to 5543
order_columns = [
item for item in list_columns if item not in ["try_number", "log_url", "external_executor_id"]
item
for item in list_columns
if item
not in [
"try_number",
"log_url",
"external_executor_id",
"note", # todo: maybe figure out how to re-enable this
]
]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of doing this dance I’d recommend simply listing the columns.

@pierrejeambrun
pierrejeambrun merged commit 5794393 into apache:main May 25, 2023
@boring-cyborg

boring-cyborg Bot commented May 25, 2023

Copy link
Copy Markdown

Awesome work, congrats on your first merged pull request! You are invited to check our Issue Tracker for additional contributions.

@eladkal eladkal added this to the Airflow 2.7.0 milestone Jun 8, 2023
@eladkal eladkal added the type:improvement Changelog: Improvements label Jun 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:webserver Webserver related Issues type:improvement Changelog: Improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Search/filter by note in List Dag Run

4 participants