Skip to content

Commit

Permalink
fix(snowflake): use ibis-defined array_sort until upstream lands
Browse files Browse the repository at this point in the history
  • Loading branch information
cpcloud committed Aug 5, 2023
1 parent 76c95b2 commit 6f7e13d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions ibis/backends/snowflake/__init__.py
Expand Up @@ -91,6 +91,11 @@ class SnowflakeCompiler(AlchemyCompiler):
return Object.assign(...keys.map((key, j) => ({[key]: arrays[j][i]})));
})""",
},
"ibis_udfs.public.array_sort": {
"inputs": {"array": ARRAY},
"returns": ARRAY,
"source": """return array.sort();""",
},
}


Expand Down
2 changes: 1 addition & 1 deletion ibis/backends/snowflake/registry.py
Expand Up @@ -461,7 +461,7 @@ def _map_get(t, op):
ops.Median: reduction(sa.func.median),
ops.TableColumn: _table_column,
ops.Levenshtein: fixed_arity(sa.func.editdistance, 2),
ops.ArraySort: fixed_arity(sa.func.array_sort, 1),
ops.ArraySort: unary(sa.func.ibis_udfs.public.array_sort),
}
)

Expand Down

0 comments on commit 6f7e13d

Please sign in to comment.