Skip to content

Commit

Permalink
reverted some changes to make the funcs sync
Browse files Browse the repository at this point in the history
  • Loading branch information
kessler-frost committed Oct 12, 2023
1 parent e5db68a commit 83a06c8
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions covalent_ui/api/v1/routes/end_points/electron_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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"]

Expand All @@ -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:
Expand All @@ -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": {}}
Expand All @@ -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:
Expand Down Expand Up @@ -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))
Expand Down

0 comments on commit 83a06c8

Please sign in to comment.