From 1c255b6055ca167b6afda348a4357ca2c9dd8d91 Mon Sep 17 00:00:00 2001 From: Steve Canny Date: Wed, 5 Jun 2019 09:44:27 -0700 Subject: [PATCH] fix: add .fill property to _StripeInsertionRow _StripeInsertionRow had no .fill property, which causes a failure on export of a chart that includes subtotals. There is no test that exercises this case in exporter. Add a test that reproduces this error in exporter integration tests and add _StripeInsertionRow.fill. --- src/cr/cube/cubepart.py | 9 +++++++++ src/cr/cube/stripe.py | 5 +++++ 2 files changed, 14 insertions(+) diff --git a/src/cr/cube/cubepart.py b/src/cr/cube/cubepart.py index d0ccc2aa6..52e4b69bd 100644 --- a/src/cr/cube/cubepart.py +++ b/src/cr/cube/cubepart.py @@ -714,6 +714,15 @@ class _Nub(object): def __init__(self, cube): self._cube = cube + @lazyproperty + def dimension_types(self): + """Sequence of `cr.cube.enum.DIMENSION_TYPE` member for each dimension. + + Length zero in this case. + """ + # TODO: remove need for this in exporter + return () + @lazyproperty def means(self): return self._scalar.means diff --git a/src/cr/cube/stripe.py b/src/cr/cube/stripe.py index 33776833d..a8937a4d3 100644 --- a/src/cr/cube/stripe.py +++ b/src/cr/cube/stripe.py @@ -297,6 +297,11 @@ def base_value(self): def count(self): return sum(row.count for row in self._addend_rows) + @lazyproperty + def fill(self): + """An insertion row can have no element-fill-color transform.""" + return None + @lazyproperty def hidden(self): """True if subtotal is pruned. Unconditionally False for stripe subtotal row."""