Feat/merge node#67
Conversation
…necessary print statements
…ssary print statements
…ssary print statements
|
@ellipsis review this. |
There was a problem hiding this comment.
👍 Looks good to me! Reviewed everything up to aa5593e in 1 minute and 34 seconds
More details
- Looked at
1430lines of code in9files - Skipped
0files when reviewing. - Skipped posting
6drafted comments based on config settings.
1. backend/app/execution/workflow_executor.py:102
- Draft comment:
Replace print statements with proper logging to avoid cluttering the console and to provide more control over the logging output. - Reason this comment was not posted:
Confidence changes required:50%
The code contains multiple print statements for debugging purposes. These should be replaced with proper logging to avoid cluttering the console and to provide more control over the logging output.
2. backend/app/execution/workflow_executor.py:103
- Draft comment:
Replace print statements with proper logging to avoid cluttering the console and to provide more control over the logging output. - Reason this comment was not posted:
Confidence changes required:50%
The code contains multiple print statements for debugging purposes. These should be replaced with proper logging to avoid cluttering the console and to provide more control over the logging output.
3. backend/app/execution/workflow_executor.py:139
- Draft comment:
Replace print statements with proper logging to avoid cluttering the console and to provide more control over the logging output. - Reason this comment was not posted:
Confidence changes required:50%
The code contains multiple print statements for debugging purposes. These should be replaced with proper logging to avoid cluttering the console and to provide more control over the logging output.
4. backend/app/nodes/logic/coalesce.py:47
- Draft comment:
Replace print statements with proper logging to avoid cluttering the console and to provide more control over the logging output. - Reason this comment was not posted:
Confidence changes required:50%
The code contains multiple print statements for debugging purposes. These should be replaced with proper logging to avoid cluttering the console and to provide more control over the logging output.
5. backend/app/nodes/logic/coalesce.py:63
- Draft comment:
Replace print statements with proper logging to avoid cluttering the console and to provide more control over the logging output. - Reason this comment was not posted:
Confidence changes required:50%
The code contains multiple print statements for debugging purposes. These should be replaced with proper logging to avoid cluttering the console and to provide more control over the logging output.
6. backend/app/nodes/logic/coalesce.py:79
- Draft comment:
Replace print statements with proper logging to avoid cluttering the console and to provide more control over the logging output. - Reason this comment was not posted:
Confidence changes required:50%
The code contains multiple print statements for debugging purposes. These should be replaced with proper logging to avoid cluttering the console and to provide more control over the logging output.
Workflow ID: wflow_EqK49RhTpLH3RCDj
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.
srijanpatel
left a comment
There was a problem hiding this comment.
Looks good overall. Left some minor comments. Also please drop debug print statements and console logs.
| print(f"Returning first non-null value: {key}, {value}") | ||
| return self.output_model(**first_non_null_output) # type: ignore | ||
|
|
||
| # If all values are None, return an empty output |
There was a problem hiding this comment.
In this case we should return a None output instead of an empty model. None will skip the children nodes.
There was a problem hiding this comment.
Remove this from the final commit.
| } else if (node.name === 'MergeNode') { | ||
| acc[node.name] = (props: any) => <MergeNode {...props} />; | ||
| } else if (node.name === 'CoalesceNode') { | ||
| acc[node.name] = CoalesceNode; |
There was a problem hiding this comment.
@preet-bhadra can you make sure there are no linter errors here? If there are then let's use the functional style as it was done for merge node.
|
|
||
| interface CoalesceNodeProps { | ||
| id: string; | ||
| data: CoalesceNodeData; |
There was a problem hiding this comment.
This can be FlowWorkflowNode['data']
We should use already declared types as much as possible.
No need to declare CoalesceNodeData type separately.
There was a problem hiding this comment.
Nice work moving the router and coalesce node logic to respective functions
- In WorkflowExecutor, handle input nodes differently based on their type. - In CoalesceNode, return None if all input values are None.
…euse the flowworkflownode schema
There was a problem hiding this comment.
👍 Looks good to me! Reviewed everything up to 490c2d1 in 1 minute and 27 seconds
More details
- Looked at
1280lines of code in13files - Skipped
0files when reviewing. - Skipped posting
5drafted comments based on config settings.
1. backend/app/execution/workflow_executor.py:99
- Draft comment:
Consider replacingprintstatements with a proper logging mechanism for better control over log levels and outputs. - Reason this comment was not posted:
Confidence changes required:50%
The PR introduces a newCoalesceNodeto replace theMergeNode. The backend logic and frontend components have been updated accordingly. The changes seem to be well-integrated, but there are a few areas that need attention. Specifically, the use ofprintstatements for logging inworkflow_executor.pyis not ideal for production code. Additionally, theCoalesceNodelogic incoalesce.pycould be improved for clarity and efficiency. The frontend components seem to be updated correctly, but there are some redundant console logs that should be removed. Overall, the PR is a good step forward, but these minor issues should be addressed before merging.
2. backend/app/nodes/logic/coalesce.py:50
- Draft comment:
Consider optimizing the iteration overdataby combining preference checks with the general iteration to avoid redundant loops. Also, simplify the use ofcreate_modelif possible. - Reason this comment was not posted:
Confidence changes required:50%
TheCoalesceNodelogic incoalesce.pyis mostly correct, but the handling of preferences and the iteration over data could be optimized. The current implementation checks preferences first and then iterates over all data, which is fine, but could be more efficient if combined. Additionally, the use ofcreate_modelcould be simplified.
3. frontend/src/components/canvas/FlowCanvas.tsx:192
- Draft comment:
Remove redundantconsole.logstatements to clean up the code. - Reason this comment was not posted:
Confidence changes required:50%
The PR includes changes to the frontend components to replaceMergeNodewithCoalesceNode. While the changes are mostly correct, there are some redundant console logs that should be removed to clean up the code.
4. frontend/src/components/nodes/DynamicNode.tsx:174
- Draft comment:
Remove redundantconsole.logstatements to clean up the code. - Reason this comment was not posted:
Confidence changes required:50%
The PR includes changes to the frontend components to replaceMergeNodewithCoalesceNode. While the changes are mostly correct, there are some redundant console logs that should be removed to clean up the code.
5. frontend/src/components/nodes/logic/RouterNode.tsx:282
- Draft comment:
Remove redundantconsole.logstatements to clean up the code. - Reason this comment was not posted:
Confidence changes required:50%
The PR includes changes to the frontend components to replaceMergeNodewithCoalesceNode. While the changes are mostly correct, there are some redundant console logs that should be removed to clean up the code.
Workflow ID: wflow_QnBXqUAa31uWrXaq
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.
|
LGTM! |
Now it is renamed to coalesce node, impleted the coalesce node backend and frontend
Important
Introduce
CoalesceNodeto replaceMergeNode, updating backend and frontend components to handle multiple inputs and output the first non-null value.CoalesceNodeto replaceMergeNode, outputs first non-null value from multiple inputs.coalesce.py, handles multiple inputs and outputs first non-null value.workflow_executor.pyupdated to handleCoalesceNode, skips early failure for None inputs.CoalesceNodeadded tonode_types.py.MergeNodewithCoalesceNodeinFlowCanvas.tsxandCoalesceNode.tsx.NodeSidebar.tsxto handleCoalesceNodeconfiguration.flowSlice.tsto manageCoalesceNodestate, including schema rebuilding logic..env.exampleto reflect new repository name.test-release.shfor Docker compose command.This description was created by
for 490c2d1. It will automatically update as commits are pushed.