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

Show schedule_interval/timetable description for schedule cron expression in Airflow UI #16692

Closed
pateash opened this issue Jun 28, 2021 · 7 comments · Fixed by #16931
Closed
Labels
area:UI Related to UI/UX. For Frontend Developers. kind:feature Feature Requests

Comments

@pateash
Copy link
Contributor

pateash commented Jun 28, 2021

Description

Users should be able to see a short description of the cron expression when hovering over the expression in a tooltip.

image

In the above case, the user should see description like At 09:30 PM, only on Friday

Use case / motivation
It will be really easy to get schedule information for the users who are not really great at reading CRON,
even for the experience users CRON can be really complicated at times.

We will create a tooltip component which will evaluate underlying cron and show the description.

Are you willing to submit a PR?
YES

Related Issues
NONE

@pateash pateash added the kind:feature Feature Requests label Jun 28, 2021
@uranusjr
Copy link
Member

uranusjr commented Jun 28, 2021

Sounds like a nice feature to me. How do you plan to geenrate the description? I know there are some online services but am not aware of a Python or JavaScript package for this. And it seems a bit weird to implement it directly in Airflow’s code base.

@ashb
Copy link
Member

ashb commented Jun 29, 2021

https://github.com/azza-bazoo/prettycron might do the job? We should check it supports at least everything croniter does.

Oh, LGPLv3 -- we can't use that.

Other option https://www.npmjs.com/package/cronstrue

@uranusjr
Copy link
Member

croniter actually “supports” some weird (invalid?) cron formats, for example 10 * * * * * (six sgements!) can be parsed by it. I saw a report on it just yesteday but can’t find the thread now. So we either need to do some additional validation (to reject those currently-allowed formats) or be bug-to-bug compatible with croniter.

@pateash
Copy link
Contributor Author

pateash commented Jun 29, 2021

I have used cronstrue previously in my projects.
I will prefer to use that or may be something else.

@uranusjr
Copy link
Member

Let’s try it out then! We can carry on with the details in the PR thread.

@uranusjr
Copy link
Member

uranusjr commented Jun 30, 2021

Found the discussion on croniter formats: #16107 (comment). It was not a separate issue but only mentioned in-passing, no wonder I couldn’t locate it before…

Although the six-segment format is valid (TIL), croniter’s current behaviour is not standard, so I think we should do some additional validation to exclude that explicitly.

@lucas-garcia-rubio
Copy link

Cronstrue in Python: https://github.com/Salamek/cron-descriptor

@bbovenzi bbovenzi added the area:UI Related to UI/UX. For Frontend Developers. label Jul 1, 2021
pateash added a commit to pateash/airflow that referenced this issue Jul 10, 2021
pateash added a commit to pateash/airflow that referenced this issue Jul 13, 2021
pateash added a commit to pateash/airflow that referenced this issue Jul 15, 2021
pateash added a commit to pateash/airflow that referenced this issue Sep 5, 2021
pateash added a commit to pateash/airflow that referenced this issue Oct 14, 2021
pateash added a commit to pateash/airflow that referenced this issue Oct 15, 2021
@pateash pateash changed the title Show cron schedule description for schedule cron expression in Airflow UI Show schedule_interval/timetable description for schedule cron expression in Airflow UI Oct 15, 2021
pateash added a commit to pateash/airflow that referenced this issue Oct 15, 2021
pateash added a commit to pateash/airflow that referenced this issue Oct 19, 2021
pateash added a commit to pateash/airflow that referenced this issue Oct 24, 2021
pateash added a commit to pateash/airflow that referenced this issue Dec 11, 2021
pateash added a commit to pateash/airflow that referenced this issue Dec 11, 2021
Signed-off-by: Ashish Patel <ashishpatel0720@gmail.com>
pateash added a commit to pateash/airflow that referenced this issue Dec 12, 2021
* Create ap_codeql-analysis.yml

* 16692 - deleted file

* 16692 - changes done

* 16692 - test added

* 16692 - pre-commits fixed

* 16692 - pre-commits fixed

* 16692 - pre-commits fixed

* 16692 - Runs removed from description

* Update airflow/www/templates/airflow/dags.html

Co-authored-by: Ryan Hamilton <ryan@ryanahamilton.com>

* 16692 - pre-commits fixed

* 16692 - using timetable for showing description

* 16692 - pre-commits fixed

* Update airflow/timetables/base.py

Co-authored-by: Tzu-ping Chung <uranusjr@gmail.com>

* 16692 - fixed types

* 16692 - used Base class for storing common properties

* 16692 - using cached_property for description

* 16692 - using cached_property for description

* 16692 - merge fix

* 16692 - removed dagbase

* 16692 - removed unnecessary changes

* 16692 - test name fixed

* 16692 - timetable_description column added to dag table.

* 16692 - None timetable description updated

* 16692 - tests added

* 16692 - review comments.

* 16692 - precommit fixes

* 16692 - precommit fixes

* 16692 - fixed test checks

* 16692 - ignoring description computation for 6th param in Cron expression

* 16692 - pre-commit fixed

* Update airflow/timetables/base.py

Co-authored-by: Tzu-ping Chung <uranusjr@gmail.com>

* 16692 - documentation added for timetable description

* 16692 - resolving PR comments

* 16692 - precommit fixes

* 16692 - documentation fix

* 16692 - using empty string as a default description

* 16692 - test fixed

* [apache#16692] - migration file updated

Signed-off-by: Ashish Patel <ashishpatel0720@gmail.com>

Co-authored-by: Ryan Hamilton <ryan@ryanahamilton.com>
Co-authored-by: Tzu-ping Chung <uranusjr@gmail.com>
pateash added a commit to pateash/airflow that referenced this issue Dec 12, 2021
Signed-off-by: Ashish Patel <ashishpatel0720@gmail.com>
pateash added a commit to pateash/airflow that referenced this issue Dec 12, 2021
Signed-off-by: Ashish Patel <ashishpatel0720@gmail.com>
uranusjr added a commit that referenced this issue Dec 13, 2021
Co-authored-by: Ryan Hamilton <ryan@ryanahamilton.com>
Co-authored-by: Tzu-ping Chung <uranusjr@gmail.com>
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. kind:feature Feature Requests
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants