Skip to content

Commit 9051785

Browse files
committed
CodeRabbit nitpicks.
1 parent 71d1bee commit 9051785

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

src/event_gate_lambda.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,12 @@ def get_api() -> Dict[str, Any]:
9191
return {"statusCode": 200, "body": API}
9292

9393

94-
def lambda_handler(event: Dict[str, Any], context: Any = None) -> Dict[str, Any]:
94+
def lambda_handler(event: Dict[str, Any], _context: Any = None) -> Dict[str, Any]:
9595
"""
9696
AWS Lambda entry point. Dispatches based on API Gateway proxy 'resource' and 'httpMethod'.
9797
Args:
9898
event: The event data from API Gateway.
99-
context: The mandatory context argument for AWS Lambda invocation.
99+
_context: The mandatory context argument for AWS Lambda invocation (unused).
100100
Returns:
101101
A dictionary compatible with API Gateway Lambda Proxy integration.
102102
Raises:
@@ -124,5 +124,5 @@ def lambda_handler(event: Dict[str, Any], context: Any = None) -> Dict[str, Any]
124124
sys.exit("TERMINATING")
125125
return build_error_response(404, "route", "Resource not found")
126126
except (KeyError, json.JSONDecodeError, ValueError, AttributeError, TypeError, RuntimeError) as request_exc:
127-
logger.error("Request processing error: %s", request_exc)
127+
logger.exception("Request processing error: %s", request_exc)
128128
return build_error_response(500, "internal", "Unexpected server error")

tests/handlers/test_handler_topic.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ def test_load_topic_schemas_success():
3434
"topic_test.json": {"type": "object", "properties": {"event_id": {"type": "string"}}},
3535
}
3636

37-
def mock_open_side_effect(file_path, *args, **kwargs):
37+
def mock_open_side_effect(file_path, *_args, **_kwargs):
3838
for filename, schema in mock_schemas.items():
3939
if filename in file_path:
4040
return mock_open(read_data=json.dumps(schema)).return_value
41-
raise FileNotFoundError(f"File not found: {file_path}")
41+
raise FileNotFoundError(file_path)
4242

4343
with patch("builtins.open", side_effect=mock_open_side_effect):
4444
result = handler.load_topic_schemas()

0 commit comments

Comments
 (0)