summaryrefslogtreecommitdiffstats
path: root/sqlglot/executor/table.py
diff options
context:
space:
mode:
Diffstat (limited to 'sqlglot/executor/table.py')
-rw-r--r--sqlglot/executor/table.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/sqlglot/executor/table.py b/sqlglot/executor/table.py
index f1b5b54..27e3e5e 100644
--- a/sqlglot/executor/table.py
+++ b/sqlglot/executor/table.py
@@ -1,5 +1,7 @@
from __future__ import annotations
+import typing as t
+
from sqlglot.helper import dict_depth
from sqlglot.schema import AbstractMappingSchema
@@ -106,11 +108,11 @@ class Tables(AbstractMappingSchema[Table]):
pass
-def ensure_tables(d: dict | None) -> Tables:
+def ensure_tables(d: t.Optional[t.Dict]) -> Tables:
return Tables(_ensure_tables(d))
-def _ensure_tables(d: dict | None) -> dict:
+def _ensure_tables(d: t.Optional[t.Dict]) -> t.Dict:
if not d:
return {}
@@ -127,4 +129,5 @@ def _ensure_tables(d: dict | None) -> dict:
columns = tuple(table[0]) if table else ()
rows = [tuple(row[c] for c in columns) for row in table]
result[name] = Table(columns=columns, rows=rows)
+
return result