From 35724e14737cba9bf83aae69d41a086d21624db0 Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Thu, 27 Jul 2023 17:17:57 -0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix(code=5Fparser.py):=20handle?= =?UTF-8?q?=20"None"=20values=20in=20default=20arguments=20correctly?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/backend/langflow/interface/custom/code_parser.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/backend/langflow/interface/custom/code_parser.py b/src/backend/langflow/interface/custom/code_parser.py index 829f8d71a..d42f82635 100644 --- a/src/backend/langflow/interface/custom/code_parser.py +++ b/src/backend/langflow/interface/custom/code_parser.py @@ -131,6 +131,12 @@ class CodeParser: ast.unparse(default).strip("'") if default else None for default in node.args.defaults ] + # Now check all default values to see if there + # are any "None" values in the middle + default_values = [ + None if value == "None" else value for value in default_values + ] + defaults = missing_defaults + default_values args = [