Skip to content

Commit 115f2a3

Browse files
Sambit Kumar Mishrasambit-mishra-NHSD
authored andcommitted
removed - in comment for lint
1 parent a394d35 commit 115f2a3

2 files changed

Lines changed: 4 additions & 11 deletions

File tree

src/rules_validation_api/validators/iteration_validator.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ def validate_rule_cohort_labels_against_iteration_cohorts(self) -> typing.Self:
102102
allowed_labels = {c.cohort_label for c in self.iteration_cohorts}
103103
line_errors: list[InitErrorDetails] = []
104104

105-
# Precompute allowed label string once
105+
# Pre compute allowed label string once
106106
allowed_str = ", ".join(sorted(allowed_labels)) if allowed_labels else None
107107

108108
for idx, rule in enumerate(self.iteration_rules):
@@ -115,8 +115,7 @@ def validate_rule_cohort_labels_against_iteration_cohorts(self) -> typing.Self:
115115

116116
# Build error message
117117
error_message = (
118-
f"Invalid cohort_label value '{label}'. "
119-
f"Allowed values: {allowed_str}."
118+
f"Invalid cohort_label value '{label}'. Allowed values: {allowed_str}."
120119
if allowed_str
121120
else (
122121
f"Invalid cohort_label value '{label}'. "
@@ -134,10 +133,7 @@ def validate_rule_cohort_labels_against_iteration_cohorts(self) -> typing.Self:
134133
)
135134

136135
if line_errors:
137-
raise ValidationError.from_exception_data(
138-
title="IterationValidation",
139-
line_errors=line_errors
140-
)
136+
raise ValidationError.from_exception_data(title="IterationValidation", line_errors=line_errors)
141137

142138
return self
143139

tests/unit/validation/test_iteration_validator.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,4 @@ def test_iteration_rules_having_invalid_cohort_labels_throws_error(
584584

585585
errors = exc_info.value.errors()
586586
# Ensure at least one error is specifically about the invalid CohortLabel in IterationRules[0]
587-
assert any(
588-
err.get("loc", [])[:3] == ("iteration_rules", 0, "cohort_label")
589-
for err in errors
590-
)
587+
assert any(err.get("loc", [])[:3] == ("iteration_rules", 0, "cohort_label") for err in errors)

0 commit comments

Comments
 (0)