From 459c112c218a86a342381ed1c5b54397b2e33c3e Mon Sep 17 00:00:00 2001 From: Shubham Gupta Date: Fri, 9 Feb 2024 19:36:21 +0530 Subject: [PATCH] fix node type not being parsed correctly in Node constructor --- packages/hagrid/hagrid/orchestra.py | 2 +- packages/syft/src/syft/abstract_node.py | 3 +++ packages/syft/src/syft/node/node.py | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/hagrid/hagrid/orchestra.py b/packages/hagrid/hagrid/orchestra.py index 32af7fb198b..8576b8fef7c 100644 --- a/packages/hagrid/hagrid/orchestra.py +++ b/packages/hagrid/hagrid/orchestra.py @@ -259,7 +259,7 @@ def deploy_to_python( "processes": processes, "dev_mode": dev_mode, "tail": tail, - "node_type": node_type_enum, + "node_type": str(node_type_enum), "node_side_type": node_side_type, "enable_warnings": enable_warnings, # new kwargs diff --git a/packages/syft/src/syft/abstract_node.py b/packages/syft/src/syft/abstract_node.py index 69c670ded90..7f860a24332 100644 --- a/packages/syft/src/syft/abstract_node.py +++ b/packages/syft/src/syft/abstract_node.py @@ -26,6 +26,9 @@ class NodeSideType(str, Enum): LOW_SIDE = "low" HIGH_SIDE = "high" + def __str__(self) -> str: + return self.value + class AbstractNode: id: Optional[UID] diff --git a/packages/syft/src/syft/node/node.py b/packages/syft/src/syft/node/node.py index 84f4152bb3b..45f5bbce5ad 100644 --- a/packages/syft/src/syft/node/node.py +++ b/packages/syft/src/syft/node/node.py @@ -633,6 +633,9 @@ def named( client_config=blob_client_config ) + node_type = NodeType(node_type) + node_side_type = NodeSideType(node_side_type) + return cls( name=name, id=uid,