Skip to content

Commit

Permalink
ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
emdoyle committed Jul 23, 2024
1 parent da87e68 commit c98310b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
1 change: 0 additions & 1 deletion gauge/cli/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import uuid
import zipfile
from pathlib import Path
from time import sleep
from typing import Dict, TypedDict

import requests
Expand Down
15 changes: 6 additions & 9 deletions gauge/sdk/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit c98310b

Please sign in to comment.