diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-01-30 17:08:33 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-01-30 17:08:33 +0000 |
commit | 75d158890b303b701c51f12b34c422fb823ba9aa (patch) | |
tree | 5f10a4a1eb612918ea94a934cfc9b9893ea19442 /sqlglot/schema.py | |
parent | Adding upstream version 10.5.6. (diff) | |
download | sqlglot-811e32ae0b388d902ed1abd5a2087f3014b09a6a.tar.xz sqlglot-811e32ae0b388d902ed1abd5a2087f3014b09a6a.zip |
Adding upstream version 10.5.10.upstream/10.5.10
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'sqlglot/schema.py')
-rw-r--r-- | sqlglot/schema.py | 7 |
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) |