From b90d55db02b0b499156b732676c4a2148303d23e Mon Sep 17 00:00:00 2001 From: Alessandro Molina Date: Wed, 8 May 2024 19:20:21 +0200 Subject: [PATCH] Improve conversion of typenames to types --- src/substrait/sql/functions_catalog.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/substrait/sql/functions_catalog.py b/src/substrait/sql/functions_catalog.py index d6b175d..4e026b7 100644 --- a/src/substrait/sql/functions_catalog.py +++ b/src/substrait/sql/functions_catalog.py @@ -47,6 +47,10 @@ def arguments_type(self) -> list[SubstraitType | None]: return [self._type_from_name(arg) for arg in self.arguments] def _type_from_name(self, typename: str) -> SubstraitType | None: + # TODO: improve support complext type like LIST? + typename, *_ = typename.split("<", 1) + typename = typename.lower() + nullable = False if typename.endswith("?"): nullable = True