From c2c400a43a5fa74f038252d57c60b1689c87e825 Mon Sep 17 00:00:00 2001 From: Albrecht Degering Date: Thu, 6 Aug 2026 12:42:20 +0200 Subject: [PATCH] Verify exact-run CSV publication --- docs/USER_GUIDE.md | 5 ++++- tests/test_reporting_service.py | 13 +++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/docs/USER_GUIDE.md b/docs/USER_GUIDE.md index f23e479..b93dee7 100644 --- a/docs/USER_GUIDE.md +++ b/docs/USER_GUIDE.md @@ -31,7 +31,10 @@ does not publish a result. A report configured against an exact published Dataflow run reads that run's immutable Datasource materialization. It does not rerun the flow with current inputs. The evidence identifies the Dataflow run and materialization, and access -to both is checked again when the report runs. +to both is checked again when the report runs. CSV export therefore provides an +Excel-readable publication of the exact authorized Dataflow result, with +spreadsheet formula markers escaped and the run lineage retained on the +Reporting execution. The **Effective access** explanation states when dimensions, measures, source rows, or actions were removed by Policy. A result with no hidden elements says diff --git a/tests/test_reporting_service.py b/tests/test_reporting_service.py index fb8ea06..d0e1469 100644 --- a/tests/test_reporting_service.py +++ b/tests/test_reporting_service.py @@ -384,7 +384,7 @@ class ReportingServiceTests(unittest.TestCase): ) self.assertTrue(raised.exception.execution_id) - def test_dataflow_dataset_can_pin_an_exact_published_run(self) -> None: + def test_dataflow_run_can_be_exported_as_formula_safe_csv(self) -> None: payload = dataset_payload() rows = list(payload.pop("static_rows")) payload.update( @@ -410,7 +410,7 @@ class ReportingServiceTests(unittest.TestCase): report_id="report-1", report_revision=1, parameters={}, - query=None, + query=ReportQuery(mode="detail", dimensions=["note"]), idempotency_key="published-dataflow-run", ) @@ -421,6 +421,15 @@ class ReportingServiceTests(unittest.TestCase): provider.last_request.run_ref, ) self.assertTrue(result["provenance"]["source"]["immutable_run"]) + content, content_type, filename = export_execution( + self.session, + self.principal, + execution_id=str(result["execution_id"]), + format="csv", + ) + self.assertEqual("text/csv; charset=utf-8", content_type) + self.assertTrue(filename.endswith(".csv")) + self.assertIn("'=cmd", content.decode("utf-8-sig")) def test_restricted_access_and_service_scope_guards(self) -> None: self._create_report_graph(