You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
Airflow should outline (in documentation) what cron expressions are supported, and perform appropriate additional validation on user-supplied cron expressions.
Use case / motivation #16692 proposed displaying a short description about the cron expression in the web UI. This bring out the issue that currently the cron expression formats supported by Airflow are essentially defined by croniter implementation, which is non-standard (POSIX only allows five-segment formats) and sometimes buggy (see #16107 (comment)). Since croniter itself does not offer expression description, we need to do this with another tool, meaning that non-standard expressions can be incorrectly described and cause user confusion.
It would be beneficial for Airflow to explicitly specify what cron expression formats are supported (only POSIX, or POSIX plus extensions like the optional year segment, or something else), and perform additional validation to ensure croniter does not receive formats not supported by Airflow, even if it can handle them. Personally I’m inclined to only do POSIX and reject the sixth segment entirely, at least until croniter fixes its handling to correctly interpret it (see taichino/croniter#76).
I think we should build a simple validator to check for the whole string before passing it into croniter (and hopefully croniter will always work if the string passes our test).
The standard POSIX syntax is fairly easy to parse, plus support for SUN-SAT. Is JAN-DEC a GNU extension? That can be added as well if it works in croniter.
Description
Airflow should outline (in documentation) what cron expressions are supported, and perform appropriate additional validation on user-supplied cron expressions.
Use case / motivation
#16692 proposed displaying a short description about the cron expression in the web UI. This bring out the issue that currently the cron expression formats supported by Airflow are essentially defined by croniter implementation, which is non-standard (POSIX only allows five-segment formats) and sometimes buggy (see #16107 (comment)). Since croniter itself does not offer expression description, we need to do this with another tool, meaning that non-standard expressions can be incorrectly described and cause user confusion.
It would be beneficial for Airflow to explicitly specify what cron expression formats are supported (only POSIX, or POSIX plus extensions like the optional year segment, or something else), and perform additional validation to ensure croniter does not receive formats not supported by Airflow, even if it can handle them. Personally I’m inclined to only do POSIX and reject the sixth segment entirely, at least until croniter fixes its handling to correctly interpret it (see taichino/croniter#76).
Are you willing to submit a PR?
Yeah
Related Issues
#16107 (comment)
#16692
taichino/croniter#76
The text was updated successfully, but these errors were encountered: