From f8694173f62f9c9710ca6e817d92a274d04eaca0 Mon Sep 17 00:00:00 2001 From: David Galiffi Date: Wed, 12 Nov 2025 09:26:25 -0500 Subject: [PATCH] Round the sum of percentages before validating to account for floating point errors (#1824) * Round the sum of percentages before validating to account for floating point errors --------- Co-authored-by: Kian Cossettini --- .../rocpd-validation-rules/python/python-builtin-rules.json | 2 +- .../rocpd-validation-rules/python/python-source-rules.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/projects/rocprofiler-systems/tests/rocpd-validation-rules/python/python-builtin-rules.json b/projects/rocprofiler-systems/tests/rocpd-validation-rules/python/python-builtin-rules.json index 9fa8eb40c0..fbbe53fab6 100644 --- a/projects/rocprofiler-systems/tests/rocpd-validation-rules/python/python-builtin-rules.json +++ b/projects/rocprofiler-systems/tests/rocpd-validation-rules/python/python-builtin-rules.json @@ -36,7 +36,7 @@ "description": "Verify that percentages sum to 100.", "error_message": "Percentages do not sum to 100.", "expected_result": 100, - "query": "SELECT SUM(percentage) FROM top;" + "query": "SELECT ROUND(SUM(percentage), 1) FROM top;" } ] }, diff --git a/projects/rocprofiler-systems/tests/rocpd-validation-rules/python/python-source-rules.json b/projects/rocprofiler-systems/tests/rocpd-validation-rules/python/python-source-rules.json index 0abc9bc75f..f8f7c5d75d 100644 --- a/projects/rocprofiler-systems/tests/rocpd-validation-rules/python/python-source-rules.json +++ b/projects/rocprofiler-systems/tests/rocpd-validation-rules/python/python-source-rules.json @@ -50,7 +50,7 @@ "description": "Verify that percentages sum to 100.", "error_message": "Percentages do not sum to 100.", "expected_result": 100, - "query": "SELECT SUM(percentage) FROM top;" + "query": "SELECT ROUND(SUM(percentage), 1) FROM top;" } ] },