Skip to content

Commit

Permalink
Resolve against the function, not the call
Browse files Browse the repository at this point in the history
  • Loading branch information
uranusjr committed Nov 19, 2024
1 parent 8a72a7e commit fcd7936
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,18 @@ impl Violation for AirflowDagNoScheduleArgument {
/// AIR301
pub(crate) fn dag_no_schedule_argument(checker: &mut Checker, expr: &Expr) {
// Don't check non-call expressions.
let Expr::Call(ast::ExprCall { arguments, .. }) = expr else {
let Expr::Call(ast::ExprCall {
func, arguments, ..
}) = expr
else {
return;
};

// We don't do anything unless this is a `DAG` (class) or `dag` (decorator
// function) from Airflow.
if !checker
.semantic()
.resolve_qualified_name(expr)
.resolve_qualified_name(func)
.is_some_and(|qualname| matches!(qualname.segments(), ["airflow", .., "DAG" | "dag"]))
{
return;
Expand Down

0 comments on commit fcd7936

Please sign in to comment.