Spaces:
Sleeping
Sleeping
Commit
·
a5b79af
1
Parent(s):
355c69f
fix for record validation
Browse files- validation.py +3 -3
validation.py
CHANGED
|
@@ -47,7 +47,7 @@ def validate_records(json_data):
|
|
| 47 |
record_sets = dataset.metadata.record_sets
|
| 48 |
|
| 49 |
if not record_sets:
|
| 50 |
-
return True, "No record sets found to validate."
|
| 51 |
|
| 52 |
results = []
|
| 53 |
|
|
@@ -74,11 +74,11 @@ def validate_records(json_data):
|
|
| 74 |
)
|
| 75 |
return False, error_message, "warning"
|
| 76 |
|
| 77 |
-
return True, "\n".join(results)
|
| 78 |
except Exception as e:
|
| 79 |
error_details = traceback.format_exc()
|
| 80 |
error_message = f"Unexpected error during records validation: {str(e)}\n\n{error_details}"
|
| 81 |
-
return False, error_message
|
| 82 |
|
| 83 |
def generate_validation_report(filename, json_data, results):
|
| 84 |
"""Generate a detailed validation report in markdown format."""
|
|
|
|
| 47 |
record_sets = dataset.metadata.record_sets
|
| 48 |
|
| 49 |
if not record_sets:
|
| 50 |
+
return True, "No record sets found to validate.", "pass"
|
| 51 |
|
| 52 |
results = []
|
| 53 |
|
|
|
|
| 74 |
)
|
| 75 |
return False, error_message, "warning"
|
| 76 |
|
| 77 |
+
return True, "\n".join(results), "pass"
|
| 78 |
except Exception as e:
|
| 79 |
error_details = traceback.format_exc()
|
| 80 |
error_message = f"Unexpected error during records validation: {str(e)}\n\n{error_details}"
|
| 81 |
+
return False, error_message, "error"
|
| 82 |
|
| 83 |
def generate_validation_report(filename, json_data, results):
|
| 84 |
"""Generate a detailed validation report in markdown format."""
|