summaryrefslogtreecommitdiffstats
path: root/sqlglot/schema.py
diff options
context:
space:
mode:
Diffstat (limited to 'sqlglot/schema.py')
-rw-r--r--sqlglot/schema.py7
1 files changed, 2 insertions, 5 deletions
diff --git a/sqlglot/schema.py b/sqlglot/schema.py
index a0d69a7..f6f3883 100644
--- a/sqlglot/schema.py
+++ b/sqlglot/schema.py
@@ -109,10 +109,7 @@ class AbstractMappingSchema(t.Generic[T]):
value, trie = in_trie(self.mapping_trie if trie is None else trie, parts)
if value == 0:
- if raise_on_missing:
- raise SchemaError(f"Cannot find mapping for {table}.")
- else:
- return None
+ return None
elif value == 1:
possibilities = flatten_schema(trie, depth=dict_depth(trie) - 1)
if len(possibilities) == 1:
@@ -262,7 +259,7 @@ class MappingSchema(AbstractMappingSchema[t.Dict[str, str]], Schema):
schema = self.find(table_)
if schema is None:
- raise SchemaError(f"Could not find table schema {table}")
+ return []
if not only_visible or not self.visible:
return list(schema)