Refactor code_parser.py to remove kwargs from

showing up as fields in the frontend
This commit is contained in:
Gabriel Luiz Freitas Almeida 2023-11-30 17:08:50 -03:00
commit d2966c37df

View file

@ -6,8 +6,8 @@ from typing import Any, Dict, List, Type, Union
from cachetools import TTLCache, cachedmethod, keys from cachetools import TTLCache, cachedmethod, keys
from fastapi import HTTPException from fastapi import HTTPException
from langflow.interface.custom.schema import (CallableCodeDetails,
from langflow.interface.custom.schema import CallableCodeDetails, ClassCodeDetails ClassCodeDetails)
class CodeSyntaxError(HTTPException): class CodeSyntaxError(HTTPException):
@ -168,7 +168,9 @@ class CodeParser:
args += self.parse_positional_args(node) args += self.parse_positional_args(node)
args += self.parse_varargs(node) args += self.parse_varargs(node)
args += self.parse_keyword_args(node) args += self.parse_keyword_args(node)
args += self.parse_kwargs(node) # Commented out because we don't want kwargs
# showing up as fields in the frontend
# args += self.parse_kwargs(node)
return args return args