diff --git a/aws/authentication/generate_aws_resource.py b/aws/authentication/generate_aws_resource.py index df8b091..2eb21e8 100755 --- a/aws/authentication/generate_aws_resource.py +++ b/aws/authentication/generate_aws_resource.py @@ -8,7 +8,10 @@ from enums.enums import Stage -def get_session_for_stage(stage: Stage | str) -> Session: +from typing import Union + +def get_session_for_stage(stage: Union[Stage, str]) -> Session: + if isinstance(stage, Stage): stage_profile = stage.value.lower() else: diff --git a/aws/database/dynamodb/scripts/person_table/last_person_ref.log b/aws/database/dynamodb/scripts/person_table/last_person_ref.log index dc50868..5653fd5 100644 --- a/aws/database/dynamodb/scripts/person_table/last_person_ref.log +++ b/aws/database/dynamodb/scripts/person_table/last_person_ref.log @@ -1 +1 @@ -70121271 \ No newline at end of file +70121276 \ No newline at end of file diff --git a/aws/database/dynamodb/scripts/person_table/set_personref_field.py b/aws/database/dynamodb/scripts/person_table/set_personref_field.py index 1e7c4f8..3a1175a 100644 --- a/aws/database/dynamodb/scripts/person_table/set_personref_field.py +++ b/aws/database/dynamodb/scripts/person_table/set_personref_field.py @@ -1,8 +1,9 @@ from aws.database.dynamodb.utils.get_dynamodb_table import get_dynamodb_table from enums.enums import Stage +from mypy_boto3_dynamodb.service_resource import Table -def process_scan(table, scan, next_person_ref): +def process_scan(table: Table, scan, next_person_ref: int): for item in scan.get('Items', []): table.update_item( Key={'id': item['id']}, @@ -16,7 +17,7 @@ def process_scan(table, scan, next_person_ref): def main(): - table = get_dynamodb_table( + table: Table = get_dynamodb_table( table_name="Persons", stage=Stage.HOUSING_DEVELOPMENT )