Skip to content

Commit

Permalink
when translating from missing make sure we use the function is_missin…
Browse files Browse the repository at this point in the history
…g as initially intended and not all_missing
  • Loading branch information
mathiasbc committed Jul 15, 2019
1 parent e38e0fd commit 724e8b6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions scrunch/datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -2276,6 +2276,9 @@ def exclude(self, expr=None):
expr_obj = {}
else:
expr_obj = expr

print(expr_obj)

return self.resource.session.patch(
self.resource.fragments.exclusion,
data=json.dumps(dict(expression=expr_obj))
Expand Down
2 changes: 1 addition & 1 deletion scrunch/expressions.py
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@ def _process(obj, variables):
elif op == 'is_valid':
real_op = 'all_valid'
elif op == 'is_missing':
real_op = 'all_missing'
real_op = 'is_missing'

if op in ('is_valid', 'is_missing'):
if len(values) != 0:
Expand Down
4 changes: 2 additions & 2 deletions scrunch/tests/test_expressions.py
Original file line number Diff line number Diff line change
Expand Up @@ -2170,7 +2170,7 @@ def test_valid_and_missing_funcs_for_arrays(self):
expr = 'missing(hobbies)'
expr_obj = process_expr(parse_expr(expr), ds)
assert expr_obj == {
'function': 'all_missing',
'function': 'is_missing',
'args': [
{
'variable': var_url
Expand All @@ -2184,7 +2184,7 @@ def test_valid_and_missing_funcs_for_arrays(self):
'function': 'not',
'args': [
{
'function': 'all_missing',
'function': 'is_missing',
'args': [
{
'variable': var_url
Expand Down

0 comments on commit 724e8b6

Please sign in to comment.