From c98310bf687a88853be8c6d94f8dd868cf91c3dd Mon Sep 17 00:00:00 2001 From: Evan Doyle Date: Mon, 22 Jul 2024 22:46:20 -0700 Subject: [PATCH] ruff --- gauge/cli/deploy.py | 1 - gauge/sdk/main.py | 15 ++++++--------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/gauge/cli/deploy.py b/gauge/cli/deploy.py index e82924e..4ca5eb3 100644 --- a/gauge/cli/deploy.py +++ b/gauge/cli/deploy.py @@ -9,7 +9,6 @@ import uuid import zipfile from pathlib import Path -from time import sleep from typing import Dict, TypedDict import requests diff --git a/gauge/sdk/main.py b/gauge/sdk/main.py index 1c94218..d424053 100644 --- a/gauge/sdk/main.py +++ b/gauge/sdk/main.py @@ -21,20 +21,17 @@ def _gauge_register() -> tuple[str, dict[str, str | list[str]]]: def as_lambda_function_url_handler() -> Callable[[Any, Any], Any]: def _lambda_handler(event: Any, context: Any) -> Any: if not isinstance(event, dict): - return {"status": 400, "detail": "Could not parse incoming data. The request body must be JSON."} - try: return { - "status": 200, - "result": function(**event) + "status": 400, + "detail": "Could not parse incoming data. The request body must be JSON.", } + try: + return {"status": 200, "result": function(**event)} except Exception as e: - return { - "status": 500, - "detail": str(e) - } + return {"status": 500, "detail": str(e)} return _lambda_handler - + function.as_lambda_function_url_handler = as_lambda_function_url_handler # pyright: ignore[reportFunctionMemberAccess] return function