Skip to content

Commit 48d8978

Browse files
committed
style: fix eslint no-explicit-any and ruff version mismatch
1 parent 7e21a89 commit 48d8978

2 files changed

Lines changed: 11 additions & 9 deletions

File tree

modules/sagemaker/sagemaker-model-cicd/test/model-build-support-stack.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,11 @@ test('ModelBuildSupportStack without s3AccessLogsBucketArn has no LoggingConfigu
5858

5959
// The LogsBucket should NOT have a LoggingConfiguration (only ArtifactsBucket logs to LogsBucket)
6060
const buckets = template.findResources('AWS::S3::Bucket');
61+
/* eslint-disable @typescript-eslint/no-explicit-any */
6162
const logsBucket = Object.values(buckets).find(
6263
(b: any) => !b.Properties.BucketName,
6364
);
65+
/* eslint-enable @typescript-eslint/no-explicit-any */
6466
expect(
6567
logsBucket?.Properties.LoggingConfiguration?.DestinationBucketName,
6668
).toBeUndefined();

modules/sagemaker/sagemaker-templates/tests/test_stack.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -252,9 +252,9 @@ def test_s3_access_logging_configured(stack_with_logging: cdk.Stack, project_tem
252252
assert "xgboost-1" in prefix, f"Bucket {logical_id} log prefix missing project name: {prefix}"
253253
buckets_with_logging.append(logical_id)
254254

255-
assert len(buckets_with_logging) == expected_count, (
256-
f"Expected {expected_count} buckets with logging, found {len(buckets_with_logging)}: {buckets_with_logging}"
257-
)
255+
assert (
256+
len(buckets_with_logging) == expected_count
257+
), f"Expected {expected_count} buckets with logging, found {len(buckets_with_logging)}: {buckets_with_logging}"
258258

259259

260260
@pytest.mark.parametrize(
@@ -375,9 +375,9 @@ def check_statement_for_duplicates(statement: dict, logical_id: str, statement_s
375375
aws_principals = principal.get("AWS", [])
376376
if isinstance(aws_principals, list):
377377
principal_strs = [stringify_principal(p) for p in aws_principals]
378-
assert len(principal_strs) == len(set(principal_strs)), (
379-
f"Duplicate principals in {logical_id} statement '{statement_sid}': {aws_principals}"
380-
)
378+
assert len(principal_strs) == len(
379+
set(principal_strs)
380+
), f"Duplicate principals in {logical_id} statement '{statement_sid}': {aws_principals}"
381381

382382
template = Template.from_stack(stack_single_account)
383383
model_package_groups = template.find_resources("AWS::SageMaker::ModelPackageGroup")
@@ -430,9 +430,9 @@ def check_statement_for_duplicates(statement: dict, logical_id: str, statement_s
430430
aws_principals = principal.get("AWS", [])
431431
if isinstance(aws_principals, list):
432432
principal_strs = [stringify_principal(p) for p in aws_principals]
433-
assert len(principal_strs) == len(set(principal_strs)), (
434-
f"Duplicate principals in KMS key {logical_id} statement '{statement_sid}': {aws_principals}"
435-
)
433+
assert len(principal_strs) == len(
434+
set(principal_strs)
435+
), f"Duplicate principals in KMS key {logical_id} statement '{statement_sid}': {aws_principals}"
436436

437437
template = Template.from_stack(stack_single_account)
438438
kms_keys = template.find_resources("AWS::KMS::Key")

0 commit comments

Comments
 (0)