From 8cee72444f5f0cb8e57061c550ae5ea84b6fc52c Mon Sep 17 00:00:00 2001 From: Edbo849 Date: Mon, 23 Sep 2024 16:23:57 +0100 Subject: [PATCH] Updated Dict typing --- esgf-consumer/esgf_consumer/items.py | 2 +- esgf-generator/esgf_generator/cli.py | 2 +- esgf-transaction-api/esgf_transaction_api/main.py | 8 ++++++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/esgf-consumer/esgf_consumer/items.py b/esgf-consumer/esgf_consumer/items.py index 1249c57..7ba0aac 100644 --- a/esgf-consumer/esgf_consumer/items.py +++ b/esgf-consumer/esgf_consumer/items.py @@ -67,7 +67,7 @@ async def hard_delete_item( async def partial_update_item( collection_id: str, - item: dict, + item: Dict[str, Any], item_id: str, settings: Settings, client: httpx.AsyncClient, diff --git a/esgf-generator/esgf_generator/cli.py b/esgf-generator/esgf_generator/cli.py index d66efb6..8dc1d8e 100644 --- a/esgf-generator/esgf_generator/cli.py +++ b/esgf-generator/esgf_generator/cli.py @@ -1,7 +1,7 @@ import json import random import time -from typing import Literal +from typing import Dict, Literal import click import httpx diff --git a/esgf-transaction-api/esgf_transaction_api/main.py b/esgf-transaction-api/esgf_transaction_api/main.py index 1bc2c59..8c28c7f 100644 --- a/esgf-transaction-api/esgf_transaction_api/main.py +++ b/esgf-transaction-api/esgf_transaction_api/main.py @@ -127,7 +127,9 @@ async def revoke_item_hard(collection_id: str, item_id: str) -> None: await alternate_message(event) -async def partial_update_item(collection_id: str, item_id: str, item: dict) -> None: +async def partial_update_item( + collection_id: str, item_id: str, item: Dict[str, Any] +) -> None: payload = PartialUpdatePayload( method="PATCH", collection_id=collection_id, item=item, item_id=item_id ) @@ -205,7 +207,9 @@ async def delete_item_hard(item_id: str, collection_id: str) -> None: @app.patch("/{collection_id}/items/{item_id}") -async def partial_update(item_id: str, collection_id: str, item: dict) -> None: +async def partial_update( + item_id: str, collection_id: str, item: Dict[str, Any] +) -> None: """Add Update message to kafka event stream. Args: