mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) Automatically remove empty summary table rows
Summary: When the `getSummarySourceGroup` function (used by the `$group` column) finds that the group is empty, raise a new special exception `EmptySummaryRow`. The engine catches this exception, avoids saving a value to the cell, and removes the record. Test Plan: Updated several Python tests Reviewers: georgegevoian Reviewed By: georgegevoian Subscribers: dsagal Differential Revision: https://phab.getgrist.com/D3489
This commit is contained in:
@@ -146,11 +146,11 @@ class TestSummary2(test_engine.EngineTestCase):
|
||||
self.assertPartialOutActions(out_actions, {
|
||||
"stored": [
|
||||
actions.UpdateRecord("Address", 28, {'state': 'MA'}),
|
||||
actions.BulkUpdateRecord("GristSummary_7_Address", [5,7], {'amount': [5.0 + 8.0, 0.0]}),
|
||||
actions.BulkUpdateRecord("GristSummary_7_Address", [5,7],
|
||||
{'average': [6.5, objtypes.RaisedException(ZeroDivisionError())]}),
|
||||
actions.BulkUpdateRecord("GristSummary_7_Address", [5,7], {'count': [2, 0]}),
|
||||
actions.BulkUpdateRecord("GristSummary_7_Address", [5,7], {'group': [[25, 28], []]}),
|
||||
actions.RemoveRecord("GristSummary_7_Address", 7),
|
||||
actions.UpdateRecord("GristSummary_7_Address", 5, {'amount': 5.0 + 8.0}),
|
||||
actions.UpdateRecord("GristSummary_7_Address", 5, {'average': 6.5}),
|
||||
actions.UpdateRecord("GristSummary_7_Address", 5, {'count': 2}),
|
||||
actions.UpdateRecord("GristSummary_7_Address", 5, {'group': [25, 28]}),
|
||||
actions.UpdateRecord("GristSummary_7_Address3", 5, {'state': "MA"}),
|
||||
actions.BulkUpdateRecord("GristSummary_7_Address4", [1,4],
|
||||
{'amount': [1.+2+6+7+10+11, 5.+8+9]}),
|
||||
|
||||
Reference in New Issue
Block a user