Skip to content

Commit

Permalink
review ammends - remove unnecessary code and add error code
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Dawson committed Sep 12, 2023
1 parent 8972078 commit 1080223
Showing 1 changed file with 3 additions and 29 deletions.
32 changes: 3 additions & 29 deletions cylc/uiserver/resolvers.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
Tuple,
Union,
)
from functools import partial

from graphql.language.base import print_ast
import psutil
Expand Down Expand Up @@ -539,33 +538,6 @@ async def mutator(
'graphql', w_ids, graphql_args, req_meta=req_meta
)

async def get_service(self, command, kwargs, workflows):
method = getattr(Services, command)
if command == 'clean':
mutation_response = partial(
method,
workflows,
kwargs,
self.workflows_mgr,
log=self.log,
executor=self.executor
)
elif command == 'play':
mutation_response = partial(
method,
workflows,
kwargs,
self.workflows_mgr,
log=self.log
)
elif command == 'scan':
mutation_response = partial(
method,
kwargs,
self.workflows_mgr
)
return await mutation_response()

async def service(
self,
info: 'ResolveInfo',
Expand All @@ -574,7 +546,7 @@ async def service(
kwargs: Dict[str, Any],
) -> List[Union[bool, str]]:

if command == 'clean': # noqa: <err code>
if command == 'clean': # noqa: <SIM116 Use a dictionary lookup instead of 3+ if/elif-statements>
return await Services.clean(
workflows,
kwargs,
Expand All @@ -595,6 +567,8 @@ async def service(
self.workflows_mgr
)

raise NotImplementedError()

async def subscription_service(
self,
info: 'ResolveInfo',
Expand Down

0 comments on commit 1080223

Please sign in to comment.