Skip to content

Commit

Permalink
track more TODOs
Browse files Browse the repository at this point in the history
  • Loading branch information
amol- committed Apr 17, 2024
1 parent 9986d09 commit df44c9b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/substrait/sql/extended_expression.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,13 @@ def _parse_function_invokation(self, function_name, left_type, left, right_type,
try:
function_anchor = self._functions_catalog.function_anchor(signature)
except KeyError:
# not function found with the exact types, try any1_any1 version
# No function found with the exact types, try any1_any1 version
# TODO: What about cases like i32_any1? What about any instead of any1?
signature = f"{function_name}:any1_any1"
function_anchor = self._functions_catalog.function_anchor(signature)
return (
signature,
left_type,
left_type, # TODO: Get the actually returned type from the functions catalog.
proto.Expression(
scalar_function=proto.Expression.ScalarFunction(
function_reference=function_anchor,
Expand Down
3 changes: 2 additions & 1 deletion src/substrait/sql/functions_catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,10 @@ def _register_extensions(self, extension_uri, loaded_functions):
function_extension = extensions_by_anchor[
function.extension_uri_reference
].uri
# TODO: Support overloading of functions from different extensionUris.
continue
raise ValueError(
f"Duplicate function definition: {function} from {extension_uri}, already loaded from {function_extension}"
f"Duplicate function definition: {function.name} from {extension_uri}, already loaded from {function_extension}"
)
extension_anchor = self._registered_extensions[
extension_uri
Expand Down

0 comments on commit df44c9b

Please sign in to comment.