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>
This commit is contained in:
Edwin Jose 2024-12-19 10:38:59 -05:00 committed by GitHub
commit 41f83294a2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

View file

@ -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))

View file

@ -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,