Skip to content

Commit

Permalink
Apply lint
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielguarisa committed Oct 18, 2024
1 parent d725568 commit 41827da
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 11 deletions.
2 changes: 1 addition & 1 deletion examples/cpf_digit.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
12 changes: 6 additions & 6 deletions retrack/nodes/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 {}
Expand Down
14 changes: 10 additions & 4 deletions tests/test_engine/test_conditional_connector_rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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]}

Expand Down Expand Up @@ -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
assert result["message"].to_list()[0] == expected_message

0 comments on commit 41827da

Please sign in to comment.