Skip to content

Commit 2d3dfbb

Browse files
committed
make fast-fail optional again
1 parent d36c903 commit 2d3dfbb

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

lightbeam/validate.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ class Validator:
1414
MAX_VALIDATION_ERRORS_TO_DISPLAY = 10
1515
MAX_VALIDATE_TASK_QUEUE_SIZE = 100
1616
DEFAULT_VALIDATION_METHODS = ["schema", "descriptors", "uniqueness"]
17-
DEFAULT_FAIL_FAST_THRESHOLD = 10
1817

1918
EDFI_GENERICS_TO_RESOURCES_MAPPING = {
2019
"educationOrganizations": ["localEducationAgencies", "stateEducationAgencies", "schools"],
@@ -35,7 +34,7 @@ def __init__(self, lightbeam=None):
3534
def validate(self):
3635

3736
# The below should go in __init__(), but rely on lightbeam.config which is not yet available there.
38-
self.fail_fast_threshold = self.lightbeam.config.get("validate",{}).get("references",{}).get("max_failures", self.DEFAULT_FAIL_FAST_THRESHOLD)
37+
self.fail_fast_threshold = self.lightbeam.config.get("validate",{}).get("references",{}).get("max_failures", None)
3938
self.validation_methods = self.lightbeam.config.get("validate",{}).get("methods",self.DEFAULT_VALIDATION_METHODS)
4039
if type(self.validation_methods)==str and (self.validation_methods=="*" or self.validation_methods.lower()=='all'):
4140
self.validation_methods = self.DEFAULT_VALIDATION_METHODS
@@ -219,7 +218,7 @@ async def validate_endpoint(self, endpoint):
219218
self.lightbeam.metadata["resources"][endpoint]["records_failed"] = self.lightbeam.num_errors
220219

221220
# implement "fail fast" feature:
222-
if self.lightbeam.num_errors >= self.fail_fast_threshold:
221+
if self.fail_fast_threshold is not None and self.lightbeam.num_errors >= self.fail_fast_threshold:
223222
self.lightbeam.shutdown("validate")
224223
self.logger.critical(f"... STOPPING; found {self.lightbeam.num_errors} >= validate.references.max_failures={self.fail_fast_threshold} VALIDATION ERRORS.")
225224
break

0 commit comments

Comments
 (0)