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

Don't display empty rendered attrs in Task Instance Details page #29545

Merged
merged 1 commit into from
Feb 16, 2023

Conversation

josh-fell
Copy link
Contributor

@josh-fell josh-fell commented Feb 14, 2023

Closes: #29515

The Task Instance Details page was displaying attributes which did not have a value. Mainly these were the docs attributes (i.e. doc, doc_json, doc_md, doc_rst, and doc_yaml). This clutters the page with less useful information for the task instance.

This PR changes the attributes displayed on the page only if they have non-emptyvalues generally.

Current Task Instance Details with no doc attribute provided
image

New Task Instance Details with no doc or other special rendered attributes
image

Current Task Instance Details with bash_command and only doc_md provided
There are other special-rendered like sql and hql but let's use a BashOperator as an example.
image

New Task Instance Details with bash_command and only doc_md provided
image

Closes: apache#29515

The Task Instance Details page was displaying attributes which did not have a value. Mainly these were the docs attributes (i.e. `doc`, `doc_json`, `doc_md`, `doc_rst`, and `doc_yaml`). This clutters the page with less useful information for the task instance.

This PR changes the attributes displayed on the page only if they have non-empty values generally.
@boring-cyborg boring-cyborg bot added area:UI Related to UI/UX. For Frontend Developers. area:webserver Webserver related Issues labels Feb 14, 2023
Copy link
Member

@pierrejeambrun pierrejeambrun left a comment

Choose a reason for hiding this comment

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

I believe this would hide the attribute for all falsy values. (0, "", [], etc...). Maybe we only want to skip when the value is actually None ?

@josh-fell
Copy link
Contributor Author

josh-fell commented Feb 14, 2023

I believe this would hide the attribute for all falsy values. (0, "", [], etc...). Maybe we only want to skip when the value is actually None ?

Yes, which is actually doc, doc_json, doc_rst, and doc_yaml (empty strings I guess). doc_md does display None. But I could track down why those are all not None if you feel that we should only filter out None. WDYT?

@pierrejeambrun
Copy link
Member

I think it's ok like this. Attribute are taken from get_attr_renderer and it seems that all of them are 'string'. Skipping falsy values looks good.

(I was concerned that some attributes could be of different types, like boolean or int for instance, but it doesn't seem like so)

@bbovenzi bbovenzi added this to the Airflow 2.5.2 milestone Feb 16, 2023
@bbovenzi bbovenzi merged commit f2f6099 into apache:main Feb 16, 2023
@josh-fell josh-fell deleted the docs-attrs-ui branch February 16, 2023 15:11
@pierrejeambrun pierrejeambrun added the type:bug-fix Changelog: Bug Fixes label Feb 27, 2023
pierrejeambrun pushed a commit that referenced this pull request Mar 7, 2023
)

Closes: #29515

The Task Instance Details page was displaying attributes which did not have a value. Mainly these were the docs attributes (i.e. `doc`, `doc_json`, `doc_md`, `doc_rst`, and `doc_yaml`). This clutters the page with less useful information for the task instance.

This PR changes the attributes displayed on the page only if they have non-empty values generally.

(cherry picked from commit f2f6099)
pierrejeambrun pushed a commit that referenced this pull request Mar 8, 2023
)

Closes: #29515

The Task Instance Details page was displaying attributes which did not have a value. Mainly these were the docs attributes (i.e. `doc`, `doc_json`, `doc_md`, `doc_rst`, and `doc_yaml`). This clutters the page with less useful information for the task instance.

This PR changes the attributes displayed on the page only if they have non-empty values generally.

(cherry picked from commit f2f6099)
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. area:webserver Webserver related Issues type:bug-fix Changelog: Bug Fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Hide non-used docs attributes from Task Instance Detail
3 participants