Skip to content

Commit d28ea05

Browse files
committed
Add defaults for builtins
1 parent c5a6172 commit d28ea05

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

singlestoredb/fusion/handler.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
close_paren = ws ")" ws
3030
'''
3131

32-
3332
BUILTINS = {
3433
'<order-by>': r'''
3534
order_by = ORDER BY order_by_key_,...
@@ -46,6 +45,13 @@
4645
''',
4746
}
4847

48+
BUILTIN_DEFAULTS = { # type: ignore
49+
'order_by': {'by': []},
50+
'like': None,
51+
'extended': False,
52+
'limit': None,
53+
}
54+
4955

5056
def get_keywords(grammar: str) -> Tuple[str, ...]:
5157
"""Return all all-caps words from the beginning of the line."""
@@ -546,7 +552,7 @@ def generic_visit(self, node: Node, visited_children: Iterable[Any]) -> Any:
546552
if k.endswith('_cmd') or k.endswith('_'):
547553
continue
548554
if k not in final:
549-
final[k] = v['default']
555+
final[k] = BUILTIN_DEFAULTS.get(k, v['default'])
550556
return final
551557

552558
# Filter out stray empty strings

0 commit comments

Comments
 (0)