Skip to content

Commit 6c5660b

Browse files
committed
updating pr comments
1 parent 3e743d2 commit 6c5660b

File tree

3 files changed

+5
-11
lines changed

3 files changed

+5
-11
lines changed

src/aibs_informatics_aws_utils/core.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -145,15 +145,11 @@ def get_region(region: Optional[str] = None) -> str:
145145

146146
def get_account_id() -> str:
147147
"""Will get the account id from the current credentials/identity"""
148-
account = get_caller_identity().get("Account")
149-
assert account is not None # mollify mypy
150-
return account
148+
return get_caller_identity()["Account"]
151149

152150

153151
def get_user_id() -> UserId:
154-
user_id = UserId(get_caller_identity()["UserId"])
155-
assert user_id is not None # mollify mypy
156-
return user_id
152+
return UserId(get_caller_identity()["UserId"])
157153

158154

159155
def get_iam_arn() -> IAMArn:

src/aibs_informatics_aws_utils/ecr/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,7 @@ def get_resource_tags(self) -> List[ResourceTag]:
589589
return [
590590
ResourceTag(Key=tag["Key"], Value=tag["Value"])
591591
for tag in self.client.list_tags_for_resource(resourceArn=self.arn)["tags"]
592-
if tag.get("Key") and tag.get("Value")
592+
if "Key" in tag and "Value" in tag
593593
]
594594

595595
def update_resource_tags(

src/aibs_informatics_aws_utils/efs/core.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -169,10 +169,8 @@ def list_efs_access_points(
169169
for fs_id in file_system_ids:
170170
response = efs.describe_access_points(FileSystemId=fs_id)
171171
access_points.extend(response["AccessPoints"])
172-
while response.get("NextToken"):
173-
response = efs.describe_access_points(
174-
FileSystemId=fs_id, NextToken=response["NextToken"]
175-
)
172+
while next_token := response.get("NextToken"):
173+
response = efs.describe_access_points(FileSystemId=fs_id, NextToken=next_token)
176174
access_points.extend(response["AccessPoints"])
177175

178176
filtered_access_points: List[AccessPointDescriptionTypeDef] = []

0 commit comments

Comments
 (0)