Skip to content

Commit

Permalink
Merge pull request #28 from pier-digital/f/rewrite-connector-logic
Browse files Browse the repository at this point in the history
Remove custom connectors logic
  • Loading branch information
gabrielguarisa authored Apr 2, 2024
2 parents 38bae96 + 3696ee5 commit 71ffae6
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 98 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "retrack"
version = "2.4.0"
version = "2.5.0"
description = "A business rules engine"
authors = ["Gabriel Guarisa <[email protected]>", "Nathalia Trotte <[email protected]>"]
license = "MIT"
Expand Down
5 changes: 3 additions & 2 deletions retrack/engine/executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ def __init__(
self._metadata = metadata

input_nodes = self._components_registry.get_by_kind(NodeKind.INPUT)
input_nodes.extend(self._components_registry.get_by_kind(NodeKind.CONNECTOR))

self._input_columns = {
f"{node.id}@{constants.INPUT_OUTPUT_VALUE_CONNECTOR_NAME}": node.data.name
for node in input_nodes
Expand Down Expand Up @@ -132,8 +134,7 @@ def __run_node(self, node_id: str, execution: Execution):
node.model_dump(by_alias=True),
current_node_filter,
execution=execution,
include_payload=node.kind() == NodeKind.CONNECTOR
or node.kind() == NodeKind.FLOW,
include_payload=node.kind() == NodeKind.FLOW,
)
output = node.run(**input_params)

Expand Down
5 changes: 4 additions & 1 deletion retrack/engine/request_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ def inputs(self, inputs: typing.List[BaseNode]):
f"inputs[{i}] must be an InputModel, not {type(inputs[i])}"
)

if inputs[i].kind() != NodeKind.INPUT:
if (
inputs[i].kind() != NodeKind.INPUT
and inputs[i].kind() != NodeKind.CONNECTOR
):
raise TypeError(
f"inputs[{i}] must be an InputModel, not {type(inputs[i])}"
)
Expand Down
5 changes: 0 additions & 5 deletions retrack/nodes/connectors.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import typing

from retrack.nodes.base import NodeKind
from retrack.nodes.inputs import Input, InputMetadataModel

Expand All @@ -14,6 +12,3 @@ class BaseConnector(Input):

def kind(self) -> NodeKind:
return NodeKind.CONNECTOR

def generate_input_nodes(self) -> typing.List[Input]:
return [Input(**self.model_dump(by_alias=True))]
89 changes: 0 additions & 89 deletions tests/test_engine/test_custom_connectors.py

This file was deleted.

0 comments on commit 71ffae6

Please sign in to comment.