diff --git a/examples/cpf_digit.py b/examples/cpf_digit.py index e33b513..3a68653 100644 --- a/examples/cpf_digit.py +++ b/examples/cpf_digit.py @@ -1,4 +1,4 @@ -""" Example of rule to get the eighth digit of a CPF.""" +"""Example of rule to get the eighth digit of a CPF.""" import retrack import pandas as pd diff --git a/retrack/nodes/base.py b/retrack/nodes/base.py index e53ed23..5977c39 100644 --- a/retrack/nodes/base.py +++ b/retrack/nodes/base.py @@ -81,12 +81,12 @@ class InputConnectionModel(pydantic.BaseModel): class BaseNode(pydantic.BaseModel): id: CastedToStringType name: str - inputs: typing.Optional[ - typing.Dict[CastedToStringType, InputConnectionModel] - ] = None - outputs: typing.Optional[ - typing.Dict[CastedToStringType, OutputConnectionModel] - ] = None + inputs: typing.Optional[typing.Dict[CastedToStringType, InputConnectionModel]] = ( + None + ) + outputs: typing.Optional[typing.Dict[CastedToStringType, OutputConnectionModel]] = ( + None + ) def run(self, **kwargs) -> typing.Dict[str, typing.Any]: return {} diff --git a/tests/test_engine/test_conditional_connector_rule.py b/tests/test_engine/test_conditional_connector_rule.py index 7981854..a68daaf 100644 --- a/tests/test_engine/test_conditional_connector_rule.py +++ b/tests/test_engine/test_conditional_connector_rule.py @@ -6,7 +6,11 @@ import pandas as pd import pytest -VALUES = {"qtd_sinistros_rcf": 1, "qtd_sinistros_indefinido": 10, "is_defendant_and_court_type": False} +VALUES = { + "qtd_sinistros_rcf": 1, + "qtd_sinistros_indefinido": 10, + "is_defendant_and_court_type": False, +} def bureau_connector_factory( @@ -24,11 +28,13 @@ def run( raise ValueError( f"Missing input {in_node_key} in BureauConnector node" ) - + if node_inputs[in_node_key].empty: return {"output_value": None} - parsed_inputs[self.data.headers[i]] = node_inputs[in_node_key].to_list()[0] + parsed_inputs[self.data.headers[i]] = node_inputs[ + in_node_key + ].to_list()[0] return {"output_value": VALUES[self.data.resource]} @@ -68,4 +74,4 @@ def test_bureau_connector_factory( result = rule_executor.execute(df, raise_raw_exception=True) assert result["output"].to_list()[0] == expected_result - assert result["message"].to_list()[0] == expected_message \ No newline at end of file + assert result["message"].to_list()[0] == expected_message