From 41f83294a236b4e7aae0d829d17a74ce96079ecd Mon Sep 17 00:00:00 2001 From: Edwin Jose Date: Thu, 19 Dec 2024 10:38:59 -0500 Subject: [PATCH] fix: code flash pr issues in Calculator and JSONCleaner Components (#5352) * Update calculator.py * Update json_cleaner.py * [autofix.ci] apply automated fixes * updated init * updated format format --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> --- .../base/langflow/components/processing/json_cleaner.py | 4 ++-- src/backend/base/langflow/components/tools/calculator.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/backend/base/langflow/components/processing/json_cleaner.py b/src/backend/base/langflow/components/processing/json_cleaner.py index 87b11aa79..93c193ae6 100644 --- a/src/backend/base/langflow/components/processing/json_cleaner.py +++ b/src/backend/base/langflow/components/processing/json_cleaner.py @@ -97,7 +97,7 @@ class JSONCleaner(Component): raise ValueError(msg) from e return s - def __init__(self): + def __init__(self, *args, **kwargs): # Create a translation table that maps control characters to None - super().__init__() + super().__init__(*args, **kwargs) self.translation_table = str.maketrans("", "", "".join(chr(i) for i in range(32)) + chr(127)) diff --git a/src/backend/base/langflow/components/tools/calculator.py b/src/backend/base/langflow/components/tools/calculator.py index 26fd9077a..8bd38d756 100644 --- a/src/backend/base/langflow/components/tools/calculator.py +++ b/src/backend/base/langflow/components/tools/calculator.py @@ -91,8 +91,8 @@ class CalculatorToolComponent(LCToolComponent): self.status = error_message return [Data(data={"error": error_message, "input": expression})] - def __init__(self): - super().__init__() + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) self.operators = { ast.Add: operator.add, ast.Sub: operator.sub,