From 83a06c8225b83b399477261f1eb124744a382a46 Mon Sep 17 00:00:00 2001 From: sankalp Date: Thu, 12 Oct 2023 14:26:00 -0400 Subject: [PATCH] reverted some changes to make the funcs sync --- .../api/v1/routes/end_points/electron_routes.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/covalent_ui/api/v1/routes/end_points/electron_routes.py b/covalent_ui/api/v1/routes/end_points/electron_routes.py index a88f5482b..a892d4ac6 100644 --- a/covalent_ui/api/v1/routes/end_points/electron_routes.py +++ b/covalent_ui/api/v1/routes/end_points/electron_routes.py @@ -95,7 +95,7 @@ def get_electron_details(dispatch_id: uuid.UUID, electron_id: int): ) -async def _get_abstract_task_inputs(dispatch_id: str, node_id: int) -> dict: +def _get_abstract_task_inputs(dispatch_id: str, node_id: int) -> dict: """Return placeholders for the required inputs for a task execution. Args: @@ -110,7 +110,7 @@ async def _get_abstract_task_inputs(dispatch_id: str, node_id: int) -> dict: abstract_task_input = {"args": [], "kwargs": {}} - in_edges = await core_graph.get_incoming_edges(dispatch_id, node_id) + in_edges = core_graph.get_incoming_edges_sync(dispatch_id, node_id) for edge in in_edges: parent = edge["source"] @@ -130,7 +130,7 @@ async def _get_abstract_task_inputs(dispatch_id: str, node_id: int) -> dict: # Domain: data -async def get_electron_inputs(dispatch_id: uuid.UUID, electron_id: int) -> str: +def get_electron_inputs(dispatch_id: uuid.UUID, electron_id: int) -> str: """ Get Electron Inputs Args: @@ -140,9 +140,7 @@ async def get_electron_inputs(dispatch_id: uuid.UUID, electron_id: int) -> str: Returns the inputs data from Result object """ - abstract_inputs = await _get_abstract_task_inputs( - dispatch_id=str(dispatch_id), node_id=electron_id - ) + abstract_inputs = _get_abstract_task_inputs(dispatch_id=str(dispatch_id), node_id=electron_id) # Resolve node ids to object strings input_assets = {"args": [], "kwargs": {}} @@ -168,7 +166,7 @@ async def get_electron_inputs(dispatch_id: uuid.UUID, electron_id: int) -> str: @routes.get("/{dispatch_id}/electron/{electron_id}/details/{name}") -async def get_electron_file(dispatch_id: uuid.UUID, electron_id: int, name: ElectronFileOutput): +def get_electron_file(dispatch_id: uuid.UUID, electron_id: int, name: ElectronFileOutput): """ Get Electron details Args: @@ -196,7 +194,7 @@ async def get_electron_file(dispatch_id: uuid.UUID, electron_id: int, name: Elec ) handler = FileHandler(result["storage_path"]) if name == "inputs": - response, python_object = await get_electron_inputs( + response, python_object = get_electron_inputs( dispatch_id=dispatch_id, electron_id=electron_id ) return ElectronFileResponse(data=str(response), python_object=str(python_object))