Skip to content

Commit 80895f5

Browse files
rename repo methods
1 parent fb86798 commit 80895f5

File tree

2 files changed

+8
-12
lines changed

2 files changed

+8
-12
lines changed

services/web/server/src/simcore_service_webserver/projects/_projects_nodes_repository.py

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import logging
22

33
import sqlalchemy as sa
4-
54
from aiohttp import web
65
from models_library.projects import ProjectID
76
from models_library.projects_nodes import Node, PartialNode
@@ -10,8 +9,8 @@
109
from simcore_postgres_database.webserver_models import projects_nodes
1110
from sqlalchemy.ext.asyncio import AsyncConnection
1211

13-
from .exceptions import NodeNotFoundError
1412
from ..db.plugin import get_asyncpg_engine
13+
from .exceptions import NodeNotFoundError
1514

1615
_logger = logging.getLogger(__name__)
1716

@@ -36,17 +35,15 @@
3635
]
3736

3837

39-
async def get(
38+
async def get_node(
4039
app: web.Application,
4140
connection: AsyncConnection | None = None,
4241
*,
4342
project_id: ProjectID,
4443
node_id: NodeID,
4544
) -> Node:
4645
async with transaction_context(get_asyncpg_engine(app), connection) as conn:
47-
get_stmt = sa.select(
48-
*_SELECTION_PROJECTS_NODES_DB_ARGS
49-
).where(
46+
get_stmt = sa.select(*_SELECTION_PROJECTS_NODES_DB_ARGS).where(
5047
(projects_nodes.c.project_uuid == f"{project_id}")
5148
& (projects_nodes.c.node_id == f"{node_id}")
5249
)
@@ -57,14 +54,13 @@ async def get(
5754
row = await result.first()
5855
if row is None:
5956
raise NodeNotFoundError(
60-
project_uuid=f"{project_id}",
61-
node_uuid=f"{node_id}"
57+
project_uuid=f"{project_id}", node_uuid=f"{node_id}"
6258
)
6359
assert row # nosec
6460
return Node.model_validate(row, from_attributes=True)
6561

6662

67-
async def update(
63+
async def update_node(
6864
app: web.Application,
6965
connection: AsyncConnection | None = None,
7066
*,

services/web/server/src/simcore_service_webserver/projects/projects_service.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -985,7 +985,7 @@ async def update_project_node_state(
985985
new_node_data={"state": {"currentStatus": new_state}},
986986
)
987987

988-
await _projects_nodes_repository.update(
988+
await _projects_nodes_repository.update_node(
989989
app,
990990
project_id=project_id,
991991
node_id=node_id,
@@ -1057,7 +1057,7 @@ async def patch_project_node(
10571057
new_node_data=_node_patch_exclude_unset,
10581058
)
10591059

1060-
await _projects_nodes_repository.update(
1060+
await _projects_nodes_repository.update_node(
10611061
app,
10621062
project_id=project_id,
10631063
node_id=node_id,
@@ -1125,7 +1125,7 @@ async def update_project_node_outputs(
11251125
new_node_data={"outputs": new_outputs, "runHash": new_run_hash},
11261126
)
11271127

1128-
await _projects_nodes_repository.update(
1128+
await _projects_nodes_repository.update_node(
11291129
app,
11301130
project_id=project_id,
11311131
node_id=node_id,

0 commit comments

Comments
 (0)