gristlabs_grist-core/sandbox/grist
Alex Hall f7a9638992 (core) CONTAINS() and summarising by ChoiceList columns with flattening
Summary:
Added CONTAINS 'function' which can be used in lookups

Changed LookupMapColumn._row_key_map to use right=set so one row can have many keys when CONTAINS is used.

Use CONTAINS to implement group column in summary table, while helper column in source table can reference and create multiple rows in summary table, especially when summarising by ChoiceList columns.

Use itertools.product to generate all combinations of lookup keys and groupby values.

cleanup

Test Plan: Added python unit tests.

Reviewers: dsagal

Reviewed By: dsagal

Subscribers: paulfitz, dsagal

Differential Revision: https://phab.getgrist.com/D2900
2021-07-19 16:35:35 +02:00
..
functions (core) CONTAINS() and summarising by ChoiceList columns with flattening 2021-07-19 16:35:35 +02:00
imports (core) Simple Python 3 compatibility changes 2021-06-22 17:13:17 +02:00
acl_formula.py (core) Remaining Python 3 compatibility changes 2021-06-25 12:00:58 +02:00
acl.py (core) Remaining Python 3 compatibility changes 2021-06-25 12:00:58 +02:00
action_obj.py (core) Simple Python 3 compatibility changes 2021-06-22 17:13:17 +02:00
action_summary.py (core) Simple Python 3 compatibility changes 2021-06-22 17:13:17 +02:00
actions.py (core) Remaining Python 3 compatibility changes 2021-06-25 12:00:58 +02:00
autocomplete_context.py (core) CONTAINS() and summarising by ChoiceList columns with flattening 2021-07-19 16:35:35 +02:00
codebuilder.py (core) Remaining Python 3 compatibility changes 2021-06-25 12:00:58 +02:00
column.py (core) Refactor Table.Record[Set] classes 2021-07-19 14:53:28 +02:00
csv_patch.py (core) Simple Python 3 compatibility changes 2021-06-22 17:13:17 +02:00
depend.py (core) Implement trigger formulas (generalizing default formulas) 2021-06-25 22:53:07 -04:00
docactions.py (core) Implement trigger formulas (generalizing default formulas) 2021-06-25 22:53:07 -04:00
docmodel.py (core) Refactor Table.Record[Set] classes 2021-07-19 14:53:28 +02:00
engine.py (core) Refactor Table.Record[Set] classes 2021-07-19 14:53:28 +02:00
gencode.py (core) Add 'user' variable to trigger formulas 2021-07-15 15:18:32 -07:00
gpath.py (core) Simple Python 3 compatibility changes 2021-06-22 17:13:17 +02:00
grist.py (core) Add ChoiceList type, cell widget, and editor widget. 2021-05-12 10:38:32 -04:00
identifiers.py (core) move data engine code to core 2020-07-29 08:57:25 -04:00
import_actions.py (core) Simple Python 3 compatibility changes 2021-06-22 17:13:17 +02:00
logger.py (core) move data engine code to core 2020-07-29 08:57:25 -04:00
lookup.py (core) CONTAINS() and summarising by ChoiceList columns with flattening 2021-07-19 16:35:35 +02:00
main.py (core) Add 'user' variable to trigger formulas 2021-07-15 15:18:32 -07:00
match_counter.py (core) move data engine code to core 2020-07-29 08:57:25 -04:00
migrations.py (core) Implement trigger formulas (generalizing default formulas) 2021-06-25 22:53:07 -04:00
moment_parse.py (core) Remaining Python 3 compatibility changes 2021-06-25 12:00:58 +02:00
moment.py (core) Remaining Python 3 compatibility changes 2021-06-25 12:00:58 +02:00
objtypes.py (core) Remaining Python 3 compatibility changes 2021-06-25 12:00:58 +02:00
records.py (core) Refactor Table.Record[Set] classes 2021-07-19 14:53:28 +02:00
relabeling.py (core) Simple Python 3 compatibility changes 2021-06-22 17:13:17 +02:00
relation.py (core) Implement trigger formulas (generalizing default formulas) 2021-06-25 22:53:07 -04:00
repl.py (core) Remaining Python 3 compatibility changes 2021-06-25 12:00:58 +02:00
runtests.py (core) Simple Python 3 compatibility changes 2021-06-22 17:13:17 +02:00
sandbox.py (core) communicate with sandbox via standard pipes 2021-07-12 06:45:47 -04:00
schema.py (core) Implement trigger formulas (generalizing default formulas) 2021-06-25 22:53:07 -04:00
summary.py (core) CONTAINS() and summarising by ChoiceList columns with flattening 2021-07-19 16:35:35 +02:00
table_data_set.py (core) Simple Python 3 compatibility changes 2021-06-22 17:13:17 +02:00
table.py (core) CONTAINS() and summarising by ChoiceList columns with flattening 2021-07-19 16:35:35 +02:00
test_acl_formula.py (core) Simple Python 3 compatibility changes 2021-06-22 17:13:17 +02:00
test_acl_renames.py (core) Update ACL resources/rules when tables/columns get renamed 2021-01-04 22:03:01 -05:00
test_actions.py (core) move data engine code to core 2020-07-29 08:57:25 -04:00
test_codebuilder.py (core) Remaining Python 3 compatibility changes 2021-06-25 12:00:58 +02:00
test_column_actions.py (core) Simple Python 3 compatibility changes 2021-06-22 17:13:17 +02:00
test_completion.py (core) Refactor Table.Record[Set] classes 2021-07-19 14:53:28 +02:00
test_default_formulas.py (core) Fix lookups in default formulas 2020-09-10 18:06:06 -04:00
test_depend.py (core) Fix recursion error in invalidate_deps 2021-06-18 15:42:20 +02:00
test_derived.py (core) Store formula values in DB, and include them into .stored/.undo fields of actions. 2020-11-04 16:45:47 -05:00
test_display_cols.py (core) discount indirect changes for access control purposes 2021-05-12 11:26:21 -04:00
test_docmodel.py (core) Simple Python 3 compatibility changes 2021-06-22 17:13:17 +02:00
test_engine.py (core) Add 'user' variable to trigger formulas 2021-07-15 15:18:32 -07:00
test_find_col.py (core) move data engine code to core 2020-07-29 08:57:25 -04:00
test_formula_error.py (core) Put user code in linecache so that source lines show in tracebacks 2021-07-12 23:25:33 +02:00
test_formula_undo.py (core) discount indirect changes for access control purposes 2021-05-12 11:26:21 -04:00
test_functions.py (core) Remaining Python 3 compatibility changes 2021-06-25 12:00:58 +02:00
test_gencode.py (core) Refactor Table.Record[Set] classes 2021-07-19 14:53:28 +02:00
test_gpath.py (core) Simple Python 3 compatibility changes 2021-06-22 17:13:17 +02:00
test_import_actions.py (core) Simple Python 3 compatibility changes 2021-06-22 17:13:17 +02:00
test_import_transform.py (core) Store formula values in DB, and include them into .stored/.undo fields of actions. 2020-11-04 16:45:47 -05:00
test_logger.py (core) move data engine code to core 2020-07-29 08:57:25 -04:00
test_lookups.py (core) CONTAINS() and summarising by ChoiceList columns with flattening 2021-07-19 16:35:35 +02:00
test_match_counter.py (core) Simple Python 3 compatibility changes 2021-06-22 17:13:17 +02:00
test_migrations.py (core) Simple Python 3 compatibility changes 2021-06-22 17:13:17 +02:00
test_moment.py (core) Simple Python 3 compatibility changes 2021-06-22 17:13:17 +02:00
test_record_func.py (core) Simple Python 3 compatibility changes 2021-06-22 17:13:17 +02:00
test_recordlist.py (core) Implement trigger formulas (generalizing default formulas) 2021-06-25 22:53:07 -04:00
test_reflist_rel.py (core) Fix a bug that occurs after remaing a table containing a RefList column. 2020-11-26 22:29:37 -05:00
test_relabeling.py (core) Remaining Python 3 compatibility changes 2021-06-25 12:00:58 +02:00
test_renames2.py (core) Store formula values in DB, and include them into .stored/.undo fields of actions. 2020-11-04 16:45:47 -05:00
test_renames.py (core) Refactor Table.Record[Set] classes 2021-07-19 14:53:28 +02:00
test_replay.py (core) Add test_replay for easily replaying data sent to the sandbox purely within python 2021-06-30 16:56:09 +02:00
test_side_effects.py (core) Store formula values in DB, and include them into .stored/.undo fields of actions. 2020-11-04 16:45:47 -05:00
test_summary2.py (core) Simple Python 3 compatibility changes 2021-06-22 17:13:17 +02:00
test_summary_choicelist.py (core) CONTAINS() and summarising by ChoiceList columns with flattening 2021-07-19 16:35:35 +02:00
test_summary.py (core) Store formula values in DB, and include them into .stored/.undo fields of actions. 2020-11-04 16:45:47 -05:00
test_table_actions.py (core) move data engine code to core 2020-07-29 08:57:25 -04:00
test_table_data_set.py (core) Simple Python 3 compatibility changes 2021-06-22 17:13:17 +02:00
test_temp_rowids.py (core) Allow using negative rowIds to add records and refer to them in Reference values. 2020-12-15 16:39:56 -05:00
test_textbuilder.py (core) Simple Python 3 compatibility changes 2021-06-22 17:13:17 +02:00
test_treeview.py (core) move data engine code to core 2020-07-29 08:57:25 -04:00
test_trigger_formulas.py (core) Add 'user' variable to trigger formulas 2021-07-15 15:18:32 -07:00
test_twowaymap.py (core) move data engine code to core 2020-07-29 08:57:25 -04:00
test_types.py (core) Remaining Python 3 compatibility changes 2021-06-25 12:00:58 +02:00
test_undo.py (core) Simple Python 3 compatibility changes 2021-06-22 17:13:17 +02:00
test_urllib_patch.py (core) Remaining Python 3 compatibility changes 2021-06-25 12:00:58 +02:00
test_user.py (core) Add 'user' variable to trigger formulas 2021-07-15 15:18:32 -07:00
test_useractions.py (core) Simple Python 3 compatibility changes 2021-06-22 17:13:17 +02:00
testsamples.py (core) move data engine code to core 2020-07-29 08:57:25 -04:00
testscript.json (core) Remaining Python 3 compatibility changes 2021-06-25 12:00:58 +02:00
testutil.py (core) Implement trigger formulas (generalizing default formulas) 2021-06-25 22:53:07 -04:00
textbuilder.py (core) Remaining Python 3 compatibility changes 2021-06-25 12:00:58 +02:00
treeview.py (core) move data engine code to core 2020-07-29 08:57:25 -04:00
twowaymap.py (core) Simple Python 3 compatibility changes 2021-06-22 17:13:17 +02:00
tzdata.data (core) move data engine code to core 2020-07-29 08:57:25 -04:00
urllib_patch.py (core) Remaining Python 3 compatibility changes 2021-06-25 12:00:58 +02:00
user.py (core) Add 'user' variable to trigger formulas 2021-07-15 15:18:32 -07:00
useractions.py (core) Run python unit tests again in python 3 2021-06-30 21:46:18 +02:00
usercode.py (core) Add 'user' variable to trigger formulas 2021-07-15 15:18:32 -07:00
usertypes.py (core) Implement UI for trigger formulas. 2021-06-29 10:24:16 -04:00
xmlrunner.py (core) Run python unit tests again in python 3 2021-06-30 21:46:18 +02:00