From 2027a9c2bd8ca79d64ba048872439cd0ea6665e8 Mon Sep 17 00:00:00 2001 From: "claude[bot]" <209825114+claude[bot]@users.noreply.github.com> Date: Fri, 5 Sep 2025 06:28:08 +0000 Subject: [PATCH] fix(parser): detect assets in Python named args (#6518) --- .../windmill-parser-py/src/asset_parser.rs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/backend/parsers/windmill-parser-py/src/asset_parser.rs b/backend/parsers/windmill-parser-py/src/asset_parser.rs index a96057af1e..c218182a2a 100644 --- a/backend/parsers/windmill-parser-py/src/asset_parser.rs +++ b/backend/parsers/windmill-parser-py/src/asset_parser.rs @@ -39,7 +39,21 @@ impl Visitor for AssetsFinder { fn visit_expr_call(&mut self, node: rustpython_ast::ExprCall) { match self.visit_expr_call_inner(&node) { Ok(_) => {} - Err(_) => self.generic_visit_expr_call(node), + Err(_) => { + // Check keyword arguments for assets before falling back to generic visit + for keyword in &node.keywords { + if let Expr::Constant(ExprConstant { value: Constant::Str(s), .. }) = &keyword.value { + if let Some((kind, path)) = parse_asset_syntax(s) { + self.assets.push(ParseAssetsResult { + kind, + path: path.to_string(), + access_type: None, + }); + } + } + } + self.generic_visit_expr_call(node); + } } } }