Skip to content

Commit

Permalink
Change BoolOutput to Output
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielguarisa committed Feb 17, 2023
1 parent 33e3d50 commit 54272c4
Show file tree
Hide file tree
Showing 4 changed files with 116 additions and 116 deletions.
64 changes: 32 additions & 32 deletions examples/age-check.json
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,8 @@
}
},
"position": [
83.84765625,
-146.80078125
45.51953125,
-136.8515625
],
"name": "Check"
},
Expand Down Expand Up @@ -180,29 +180,6 @@
],
"name": "If"
},
"7": {
"id": 7,
"data": {
"message": "invalid age"
},
"inputs": {
"input_bool": {
"connections": [
{
"node": 8,
"output": "output_bool",
"data": {}
}
]
}
},
"outputs": {},
"position": [
972.3247551810931,
-8.462733235746624
],
"name": "BoolOutput"
},
"8": {
"id": 8,
"data": {
Expand All @@ -223,8 +200,8 @@
"output_bool": {
"connections": [
{
"node": 7,
"input": "input_bool",
"node": 11,
"input": "input_value",
"data": {}
}
]
Expand Down Expand Up @@ -257,7 +234,7 @@
"connections": [
{
"node": 10,
"input": "input_bool",
"input": "input_value",
"data": {}
}
]
Expand All @@ -275,7 +252,7 @@
"message": "valid age"
},
"inputs": {
"input_bool": {
"input_value": {
"connections": [
{
"node": 9,
Expand All @@ -287,10 +264,33 @@
},
"outputs": {},
"position": [
974.0269089794663,
-190.8242802623253
1015.5346416468075,
-247.2703893983769
],
"name": "Output"
},
"11": {
"id": 11,
"data": {
"message": "invalid age"
},
"inputs": {
"input_value": {
"connections": [
{
"node": 8,
"output": "output_bool",
"data": {}
}
]
}
},
"outputs": {},
"position": [
1008.826235840524,
-68.88453626006572
],
"name": "BoolOutput"
"name": "Output"
}
}
}
4 changes: 2 additions & 2 deletions retrack/nodes/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from retrack.nodes.logic import And, Not, Or
from retrack.nodes.match import If
from retrack.nodes.math import Math
from retrack.nodes.outputs import BoolOutput
from retrack.nodes.outputs import Output
from retrack.nodes.start import Start
from retrack.nodes.startswith import StartsWith
from retrack.nodes.startswithany import StartsWithAny
Expand All @@ -21,7 +21,7 @@
registry.register("Constant", Constant)
registry.register("List", List)
registry.register("Bool", Bool)
registry.register("BoolOutput", BoolOutput)
registry.register("Output", Output)
registry.register("Check", Check)
registry.register("If", If)
registry.register("And", And)
Expand Down
12 changes: 6 additions & 6 deletions retrack/nodes/outputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,24 @@ class OutputMetadataModel(pydantic.BaseModel):
################################################
# Output Inputs and Outputs
################################################
class BoolOutputInputsModel(pydantic.BaseModel):
input_bool: InputConnectionModel
class OutputInputsModel(pydantic.BaseModel):
input_value: InputConnectionModel


################################################
# Output Node
################################################


class BoolOutput(BaseNode):
inputs: typing.Optional[BoolOutputInputsModel]
class Output(BaseNode):
inputs: typing.Optional[OutputInputsModel]
data: OutputMetadataModel

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

def run(self, input_bool: pd.Series) -> typing.Dict[str, pd.Series]:
def run(self, input_value: pd.Series) -> typing.Dict[str, pd.Series]:
return {
constants.OUTPUT_REFERENCE_COLUMN: input_bool,
constants.OUTPUT_REFERENCE_COLUMN: input_value,
constants.OUTPUT_MESSAGE_REFERENCE_COLUMN: self.data.message,
}
Loading

0 comments on commit 54272c4

Please sign in to comment.