(core) Make CONTAINS a function for consistency with mkpydocs etc.

Summary: Having CONTAINS be a class is a pain, undoing that mistake now

Test Plan: none needed

Reviewers: dsagal

Reviewed By: dsagal

Differential Revision: https://phab.getgrist.com/D2929
This commit is contained in:
Alex Hall
2021-07-20 22:57:35 +02:00
parent 1f6e693b6e
commit f5981606e1
5 changed files with 21 additions and 12 deletions

View File

@@ -9,7 +9,7 @@ import records
import relation
import twowaymap
import usertypes
from functions.lookup import CONTAINS
from functions.lookup import _Contains
import logger
log = logger.Logger(__name__, logger.INFO)
@@ -187,7 +187,7 @@ class ContainsLookupMapColumn(BaseLookupMapColumn):
# that the columns used to index by are brought up-to-date (in case they are formula columns).
group = rec._get_col(extract_column_id(col_id))
if isinstance(col_id, CONTAINS):
if isinstance(col_id, _Contains):
# Check that the cell targeted by CONTAINS() has an appropriate type.
# Don't iterate over characters of a string.
# group = [] essentially means there are no new keys in this call
@@ -300,7 +300,7 @@ class _LookupRelation(relation.Relation):
def extract_column_id(c):
if isinstance(c, CONTAINS):
if isinstance(c, _Contains):
return c.value
else:
return c