summaryrefslogtreecommitdiffstats
path: root/sqlglot/schema.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-04-03 07:31:50 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-04-03 07:31:50 +0000
commit1fb60a37d31eacbac62ddafde51b829522925694 (patch)
tree5c04a33630f7a2cd4cff248e965053f97ec3e4ac /sqlglot/schema.py
parentAdding upstream version 11.4.1. (diff)
downloadsqlglot-upstream/11.4.5.tar.xz
sqlglot-upstream/11.4.5.zip
Adding upstream version 11.4.5.upstream/11.4.5
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'sqlglot/schema.py')
-rw-r--r--sqlglot/schema.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/sqlglot/schema.py b/sqlglot/schema.py
index f5d9f2b..8e39c7f 100644
--- a/sqlglot/schema.py
+++ b/sqlglot/schema.py
@@ -306,11 +306,11 @@ class MappingSchema(AbstractMappingSchema[t.Dict[str, str]], Schema):
return self._type_mapping_cache[schema_type]
-def ensure_schema(schema: t.Any) -> Schema:
+def ensure_schema(schema: t.Any, dialect: DialectType = None) -> Schema:
if isinstance(schema, Schema):
return schema
- return MappingSchema(schema)
+ return MappingSchema(schema, dialect=dialect)
def ensure_column_mapping(mapping: t.Optional[ColumnMapping]):