summaryrefslogtreecommitdiffstats
path: root/tests/test_schema.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-03 20:07:58 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-03 20:07:58 +0000
commitfc2b129d31cbb474bbebfa0baa8537238f6332ed (patch)
tree5c6055c1be787787ae2d13b144f280740e235f79 /tests/test_schema.py
parentAdding upstream version 24.0.0. (diff)
downloadsqlglot-fc2b129d31cbb474bbebfa0baa8537238f6332ed.tar.xz
sqlglot-fc2b129d31cbb474bbebfa0baa8537238f6332ed.zip
Adding upstream version 24.1.0.upstream/24.1.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/test_schema.py')
-rw-r--r--tests/test_schema.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/test_schema.py b/tests/test_schema.py
index 5b50867..21b59fd 100644
--- a/tests/test_schema.py
+++ b/tests/test_schema.py
@@ -303,3 +303,10 @@ class TestSchema(unittest.TestCase):
schema = MappingSchema({"x": {"c": "int"}})
self.assertTrue(schema.has_column("x", exp.column("c")))
self.assertFalse(schema.has_column("x", exp.column("k")))
+
+ def test_find(self):
+ schema = MappingSchema({"x": {"c": "int"}})
+ found = schema.find(exp.to_table("x"))
+ self.assertEqual(found, {"c": "int"})
+ found = schema.find(exp.to_table("x"), ensure_data_types=True)
+ self.assertEqual(found, {"c": exp.DataType.build("int")})