Skip to content

Commit

Permalink
change fullname behavior, add some stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
eacharles committed Oct 6, 2023
1 parent e5c1321 commit 3792019
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/lsst/cmservice/cli/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class DictParamType(click.ParamType):

name = "dictionary"

def convert(self, cli_value, param, ctx):
def convert(self, cli_value: Any, param: click.Parameter | None, ctx: click.Context | None) -> dict:
"""Converts CLI value to the dictionary structure.
Args:
Expand Down
4 changes: 2 additions & 2 deletions src/lsst/cmservice/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ def get_job_errors(
fullname=fullname,
)
query = "get/job/errors"
results = self._client.get(f"{query}", parans=params.dict()).json()
results = self._client.get(f"{query}", params=params.dict()).json()
try:
return parse_obj_as(list[models.ErrorInstance], results)
except ValidationError as msg:
Expand Down Expand Up @@ -269,7 +269,7 @@ def update_child_config(
kwargs["node_type"] = kwargs["node_type"].value
params = models.UpdateNodeQuery(**kwargs)
print(params.dict())
results = self._client.post(f"{query}", data=params.json()).json()
results = self._client.post(f"{query}", data=params.dict()).json()
try:
return parse_obj_as(dict, results)
except ValidationError as msg:
Expand Down
14 changes: 7 additions & 7 deletions src/lsst/cmservice/db/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ async def update_collections(
self,
session: async_scoped_session,
**kwargs: Any,
) -> dict:
) -> NodeMixin:
"""Update the collection configuration
associated to a particular row
Expand Down Expand Up @@ -358,8 +358,8 @@ async def reject(
if self.status in [StatusEnum.accepted, StatusEnum.rescued]:
raise ValueError(f"Can not reject {self} as it is in status {self.status}")

await self.update_values(status=StatusEnum.rejected)
await self.commit()
await self.update_values(session, status=StatusEnum.rejected)
await session.commit()
return self

async def accept(
Expand All @@ -381,8 +381,8 @@ async def accept(
if self.status in [StatusEnum.running, StatusEnum.reviewable, StatusEnum.rescuable]:
raise ValueError(f"Can not accept {self} as it is in status {self.status}")

await self.update_values(status=StatusEnum.accepted)
await self.commit()
await self.update_values(session, status=StatusEnum.accepted)
await session.commit()
return self

async def reset(
Expand All @@ -405,8 +405,8 @@ async def reset(
raise ValueError(f"Can not reset {self} as it is in status {self.status}")

await self._clean_up_node(session)
await self.update_values(status=StatusEnum.waiting, superseded=False)
await self.commit()
await self.update_values(session, status=StatusEnum.waiting, superseded=False)
await session.commit()
return self

async def _clean_up_node(
Expand Down

0 comments on commit 3792019

Please sign in to comment.