Skip to content

Commit

Permalink
Fixed type parameters (#106)
Browse files Browse the repository at this point in the history
This commit fixes the type of some method parameter
and a variable name typo
  • Loading branch information
LanderOtto authored Aug 13, 2024
1 parent 0741abc commit 92a7b36
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions streamflow_postgresql/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,11 @@ async def add_filter(self, name: str, type: str, config: str) -> int:
)

async def add_port(
self, name: str, workflow_id: int, type: type[Port], params: str
self,
name: str,
workflow_id: int,
type: type[Port],
params: MutableMapping[str, Any],
) -> int:
async with self.pool as pool:
async with pool.acquire() as conn:
Expand All @@ -191,7 +195,12 @@ async def add_provenance(self, inputs: MutableSequence[int], token: int):
)

async def add_step(
self, name: str, workflow_id: int, status: int, type: type[Step], params: str
self,
name: str,
workflow_id: int,
status: int,
type: type[Step],
params: MutableMapping[str, Any],
) -> int:
async with self.pool as pool:
async with pool.acquire() as conn:
Expand All @@ -211,7 +220,7 @@ async def add_target(
self,
deployment: int,
type: type[Target],
params: str,
params: MutableMapping[str, Any],
locations: int = 1,
service: str | None = None,
workdir: str | None = None,
Expand Down Expand Up @@ -247,7 +256,9 @@ async def add_token(
bytearray(value, "utf-8"),
)

async def add_workflow(self, name: str, params: str, status: int, type: str) -> int:
async def add_workflow(
self, name: str, params: MutableMapping[str, Any], status: int, type: str
) -> int:
async with self.pool as pool:
async with pool.acquire() as conn:
async with conn.transaction():
Expand Down Expand Up @@ -282,12 +293,12 @@ async def get_dependers(
)

@cachedmethod(lambda self: self.deployment_cache)
async def get_deployment(self, deplyoment_id: int) -> MutableMapping[str, Any]:
async def get_deployment(self, deployment_id: int) -> MutableMapping[str, Any]:
async with self.pool as pool:
async with pool.acquire() as conn:
return await conn.fetchrow(
"SELECT * FROM deployment WHERE id = $1",
deplyoment_id,
deployment_id,
)

async def get_execution(self, execution_id: int) -> MutableMapping[str, Any]:
Expand Down

0 comments on commit 92a7b36

Please sign in to comment.