Skip to content

Commit

Permalink
test(mapping): confirm sources and targets exist for ops mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
gforsyth committed Jul 1, 2024
1 parent 07e5022 commit 6192e3f
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions ibis_substrait/tests/compiler/test_extensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -385,3 +385,20 @@ def test_extension_round_upcast(compiler, col_dtype, digits_dtype):
]

assert f"round:{_TYPE_MAPPING[col_dtype]}_i32" in scalar_func_names


def test_ops_mapping_validity():
from ibis_substrait.compiler.mapping import (
IBIS_SUBSTRAIT_OP_MAPPING,
_extension_mapping,
)

for op in IBIS_SUBSTRAIT_OP_MAPPING.keys():
assert hasattr(ops, op)

# `any` isn't a valid mapping
for target in IBIS_SUBSTRAIT_OP_MAPPING.values():
if target == "any":
# any is special-cased
continue
assert target in _extension_mapping.keys()

0 comments on commit 6192e3f

Please sign in to comment.