From be1cb18ea28222fca384a5459a024b7e9af5cadb Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 30 Jan 2023 18:08:37 +0100 Subject: Merging upstream version 10.5.10. Signed-off-by: Daniel Baumann --- sqlglot/schema.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'sqlglot/schema.py') 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) -- cgit v1.2.3