Skip to content

Commit f81dc67

Browse files
Rename restrictions -> conditions.
1 parent ce3e1d9 commit f81dc67

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

datajoint/condition.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,8 @@ def prep_value(k, v):
152152
return f'{k}="{v}"'
153153
return f"{k}={v}"
154154

155-
def combine_conditions(negate, restrictions):
156-
return f"{'NOT ' if negate else ''} ({')AND('.join(restrictions)})"
155+
def combine_conditions(negate, conditions):
156+
return f"{'NOT ' if negate else ''} ({')AND('.join(conditions)})"
157157

158158
negate = False
159159
while isinstance(condition, Not):
@@ -164,7 +164,7 @@ def combine_conditions(negate, restrictions):
164164
if isinstance(condition, str):
165165
columns.update(extract_column_names(condition))
166166
return combine_conditions(
167-
negate, restrictions=[condition.strip().replace("%", "%%")]
167+
negate, conditions=[condition.strip().replace("%", "%%")]
168168
) # escape %, see issue #376
169169

170170
# restrict by AndList
@@ -181,7 +181,7 @@ def combine_conditions(negate, restrictions):
181181
return negate # if any item is False, the whole thing is False
182182
if not items:
183183
return not negate # and empty AndList is True
184-
return combine_conditions(negate, restrictions=items)
184+
return combine_conditions(negate, conditions=items)
185185

186186
# restriction by dj.U evaluates to True
187187
if isinstance(condition, U):
@@ -201,7 +201,7 @@ def combine_conditions(negate, restrictions):
201201
columns.update(common_attributes)
202202
return combine_conditions(
203203
negate,
204-
restrictions=[
204+
conditions=[
205205
prep_value(k, v)
206206
for k, v in condition.items()
207207
if k.split(".", 1)[0] in common_attributes
@@ -218,7 +218,7 @@ def combine_conditions(negate, restrictions):
218218
columns.update(common_attributes)
219219
return combine_conditions(
220220
negate,
221-
restrictions=[prep_value(k, condition[k]) for k in common_attributes],
221+
conditions=[prep_value(k, condition[k]) for k in common_attributes],
222222
)
223223

224224
# restrict by a QueryExpression subclass -- trigger instantiation and move on

0 commit comments

Comments
 (0)