-
Notifications
You must be signed in to change notification settings - Fork 14.3k
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
#16692 show schedule_interval/timetable description in UI #16931
#16692 show schedule_interval/timetable description in UI #16931
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I know others have some opinions on which description is good so If you want to chime in - feel free before I merge it.
The PR most likely needs to run full matrix of tests because it modifies parts of the core of Airflow. However, committers might decide to merge it quickly and take the risk. If they don't merge it quickly - please rebase it to the latest main at your convenience, or amend the last commit of the PR, and push it with --force-with-lease. |
Since some of these can be lengthy, I'm wondering if the |
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd be in favor of at least removing the "Runs: ". Additionally, the adjacent column heading is "Runs", so using the same term in two different columns with slightly different meanings is probably best to avoid.
Sure, make sense. |
The problem is, we are planning to make class MyCustomTimetable(Timetable):
...
dag = DAG(
...,
timetable=MyCustomTimetable(),
) and this can be any rich Python object. So while the This is actually not difficult at all. All the DAG objects are in 'dag_timetable': current_app.dag_bag.get_dag(dag.dag_id).timetable But it is pretty cumbersome to add this for all views that render |
@ashb @potiuk @kaxil @uranusjr @ryanahamilton As far as I know we use DagModel object to render dag information in UI, class MyCustomTimetable(Timetable):
...
dag = DAG(
...,
timetable=MyCustomTimetable(),
) So, while rendering in UI, we will need that information in DagModel and we can't use DAG.timetable. I think, whenever we do a change in DAG Api for allowing timetable as an argument, we can modify our model to accommodate that change and show the description according to the requirements needed at that point in time. |
The problem is we can’t store the timetable object in db (at least not easily; it’s technically doable but should be avoided). Maybe we can pre-render the description and store that (it’d be just a string) on |
Honestly, I am not sure what you are trying to suggest here. currently, timetable.description has same logic for DAG and DagModel which might change in future as you pointed out. We can modify that behaviour later whenever we do that change. |
I think we need to delay this a bit until we find a way to properly serialise |
I agree @uranusjr, |
That works for me. My main concern is only to not show the wrong explaination. |
the reason I have added Icon, as we will not be able to provide the description in all the cases, |
Agree, but I think we should not provide any description if not available ( as we are doing in other cases like datetimedeltaTimeTable and other types) |
Again, I have no strong opinions here (as long as we don't provide incorrect description), so feel free to do what you think is best. |
Sure, I am pretty much done with the changes from my end. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should also add something to the documentation for this in docs/apache-airflow/howto/timetable.rst
Generally looks good to me now! One thing I'm wondering is how |
That's a really good point from future perspective, |
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 5 days if no further activity occurs. Thank you for your contributions. |
f7c4fbc
to
bce3dbf
Compare
* 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 <[email protected]> * 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 <[email protected]> * 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 <[email protected]> * 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 <[email protected]> Co-authored-by: Ryan Hamilton <[email protected]> Co-authored-by: Tzu-ping Chung <[email protected]>
Signed-off-by: Ashish Patel <[email protected]>
Signed-off-by: Ashish Patel <[email protected]>
76a9e14
to
f3e907c
Compare
@uranusjr there were some CI failures due to kerberos authentication. |
Yeah those were just timing out, probably temporary networking error. This has nothing to do with them, and all other CI jobs pass without issues, so the possibility there is a genuine breakage is extremely low. |
Closes #16692 ,
As the schedule_interval could be of type datetime.timedelta or
dateutil.relativedelta.relativedelta or str, only showing description whenever the type is string ( cron or predefined presets ).
User can also choose to use Timetable API and this works as well.
Description implemented for Once and Null Timetable and we can easily extend it to support others going forward.
Predefined Presets are also evaluated