diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-03 20:08:03 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-03 20:08:03 +0000 |
commit | cf606e6b9c2bd703d35537ef8880a8b80edf52a5 (patch) | |
tree | ac3c8e940fabdaa513920df2a58284fe4e8c84ee /tests/test_schema.py | |
parent | Releasing debian version 24.0.0-1. (diff) | |
download | sqlglot-cf606e6b9c2bd703d35537ef8880a8b80edf52a5.tar.xz sqlglot-cf606e6b9c2bd703d35537ef8880a8b80edf52a5.zip |
Merging upstream version 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.py | 7 |
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")}) |