Skip to content

Commit

Permalink
Do not emit AIR301 with deprecated schedule arg
Browse files Browse the repository at this point in the history
When a deprecated schedule argument is found on a DAG, it is more
appropriate to emit an AIR302 to signify a rename, instead of telling
the user to add a 'schedule' argument (which won't work unless they also
remove the deprecated argument).
  • Loading branch information
uranusjr committed Nov 28, 2024
1 parent 1f5ec14 commit 87f000b
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,14 @@ pub(crate) fn dag_no_schedule_argument(checker: &mut Checker, expr: &Expr) {
return;
}

// If there's a `schedule` keyword argument, we are good.
if arguments.find_keyword("schedule").is_some() {
// If there's a schedule keyword argument, we are good.
// This includes the canonical 'schedule', and the deprecated 'timetable'
// and 'schedule_interval'. Usages of deprecated schedule arguments are
// covered by AIR302.
if ["schedule", "schedule_interval", "timetable"]
.iter()
.any(|a| arguments.find_keyword(a).is_some())
{
return;
}

Expand Down

0 comments on commit 87f000b

Please sign in to comment.