RangePr class defaults groupBy to invalid value
Here is what I think is the offending code along with a patch to fix it.
class RangePr(Serialisable):
...
groupBy = Set(values=(['range', 'seconds', 'minutes', 'hours', 'days',
'months', 'quarters', 'years']))
...
def __init__(self,
autoStart=True,
autoEnd=True,
groupBy=range, # <- this should be a string
startNum=None,
endNum=None,
startDate=None,
endDate=None,
groupInterval=1,
):
...
self.groupBy = groupBy # <- the range function isn't in the Set defined above but the string "range" is
...
# HG changeset patch
# User George Adams <oss@geowa4.software>
# Date 1597088398 14400
# Mon Aug 10 15:39:58 2020 -0400
# Branch 3.0
# Node ID 476fb8f1019c8787436bd163900bc7a43af98cf1
# Parent a5f7d4dcfc5393c796f240887196ca29a2f6d318
Change groupBy to string so it conforms to groupBy Set restrictions
diff -r a5f7d4dcfc53 -r 476fb8f1019c openpyxl/pivot/cache.py
--- a/openpyxl/pivot/cache.py Fri Jul 24 14:31:21 2020 +0200
+++ b/openpyxl/pivot/cache.py Mon Aug 10 15:39:58 2020 -0400
@@ -671,7 +671,7 @@
def __init__(self,
autoStart=True,
autoEnd=True,
- groupBy=range,
+ groupBy='range',
startNum=None,
endNum=None,
startDate=None,