Skip to content

Commit 94ff4e1

Browse files
committed
using ruff to re-format documents
1 parent 47d01ed commit 94ff4e1

24 files changed

+713
-612
lines changed

lambdas/shared/src/common/aws_dynamodb.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
from common.clients import dynamodb_resource, logger
1+
from common.clients import dynamodb_resource
2+
from common.clients import logger
23

34

45
def get_dynamodb_table(table_name):

lambdas/shared/src/common/aws_lambda_event.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from enum import Enum
2-
from typing import Any, Dict
2+
from typing import Any
33

44

55
class AwsEventType(Enum):
@@ -10,7 +10,7 @@ class AwsEventType(Enum):
1010

1111

1212
class AwsLambdaEvent:
13-
def __init__(self, event: Dict[str, Any]):
13+
def __init__(self, event: dict[str, Any]):
1414
self.event_source = None
1515
self.event_type = AwsEventType.UNKNOWN
1616
self.event_source = event.get("eventSource")

lambdas/shared/src/common/cache.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import json
2-
from typing import Optional
32

43

54
class Cache:
@@ -19,7 +18,7 @@ def put(self, key: str, value: dict):
1918
self.cache[key] = value
2019
self._overwrite()
2120

22-
def get(self, key: str) -> Optional[dict]:
21+
def get(self, key: str) -> dict | None:
2322
return self.cache.get(key, None)
2423

2524
def delete(self, key: str):

lambdas/shared/src/common/log_decorator.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
from datetime import datetime
1010
from functools import wraps
1111

12-
from common.clients import firehose_client, logger
12+
from common.clients import firehose_client
13+
from common.clients import logger
1314

1415

1516
def send_log_to_firehose(stream_name, log_data: dict) -> None:

lambdas/shared/src/common/s3_reader.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
from common.clients import logger, s3_client
1+
from common.clients import logger
2+
from common.clients import s3_client
23

34

45
class S3Reader:
Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1-
2-
31
# all error Levels
42
CRITICAL_ERROR = 0
53
WARNING = 1
64
NOTIFICATION = 2
75

86

97
MESSAGES = {
10-
CRITICAL_ERROR: 'Critical Validation Error [%s]: %s',
11-
WARNING: 'Non-Critical Validation Error [%s]: %s',
12-
NOTIFICATION: 'Quality Issue Found [%s]: %s',
8+
CRITICAL_ERROR: "Critical Validation Error [%s]: %s",
9+
WARNING: "Non-Critical Validation Error [%s]: %s",
10+
NOTIFICATION: "Quality Issue Found [%s]: %s",
1311
}
Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
2-
31
# all exceptions and messgaes
42
UNEXPECTED_EXCEPTION = 0
53
VALUE_CHECK_FAILED = 1
@@ -16,17 +14,17 @@
1614
KEY_CHECK_FAILED = 12
1715

1816
MESSAGES = {
19-
UNEXPECTED_EXCEPTION: 'Unexpected exception [%s]: %s',
20-
VALUE_CHECK_FAILED: 'Value check failed.',
21-
HEADER_CHECK_FAILED: 'Header check failed.',
22-
RECORD_LENGTH_CHECK_FAILED: 'Record length check failed.',
23-
RECORD_CHECK_FAILED: 'Record check failed.',
24-
VALUE_PREDICATE_FALSE: 'Value predicate returned false.',
25-
RECORD_PREDICATE_FALSE: 'Record predicate returned false.',
26-
UNIQUE_CHECK_FAILED: 'Unique check failed.',
27-
ASSERT_CHECK_FAILED: 'Assertion check failed.',
28-
FINALLY_ASSERT_CHECK_FAILED: 'Final assertion check failed.',
29-
PARSING_ERROR: 'Failed to parse data correctly.',
30-
PARENT_FAILED: 'The parent expression failed to validate',
31-
KEY_CHECK_FAILED: 'Value could not be found in the Key list'
17+
UNEXPECTED_EXCEPTION: "Unexpected exception [%s]: %s",
18+
VALUE_CHECK_FAILED: "Value check failed.",
19+
HEADER_CHECK_FAILED: "Header check failed.",
20+
RECORD_LENGTH_CHECK_FAILED: "Record length check failed.",
21+
RECORD_CHECK_FAILED: "Record check failed.",
22+
VALUE_PREDICATE_FALSE: "Value predicate returned false.",
23+
RECORD_PREDICATE_FALSE: "Record predicate returned false.",
24+
UNIQUE_CHECK_FAILED: "Unique check failed.",
25+
ASSERT_CHECK_FAILED: "Assertion check failed.",
26+
FINALLY_ASSERT_CHECK_FAILED: "Final assertion check failed.",
27+
PARSING_ERROR: "Failed to parse data correctly.",
28+
PARENT_FAILED: "The parent expression failed to validate",
29+
KEY_CHECK_FAILED: "Value could not be found in the Key list",
3230
}

0 commit comments

Comments
 (0)