1
0
Fork 0

Adding upstream version 17.12.0.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-13 20:54:58 +01:00
parent 276276930e
commit 9de781a59b
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
64 changed files with 12465 additions and 11885 deletions

View file

@ -723,3 +723,24 @@ class TestExecutor(unittest.TestCase):
result = execute(sql, tables=tables)
self.assertEqual(result.columns, columns)
self.assertEqual(result.rows, expected)
def test_dict_values(self):
tables = {
"foo": [{"raw": {"name": "Hello, World"}}],
}
result = execute("SELECT raw:name AS name FROM foo", read="snowflake", tables=tables)
self.assertEqual(result.columns, ("NAME",))
self.assertEqual(result.rows, [("Hello, World",)])
tables = {
'"ITEM"': [
{"id": 1, "attributes": {"flavor": "cherry", "taste": "sweet"}},
{"id": 2, "attributes": {"flavor": "lime", "taste": "sour"}},
{"id": 3, "attributes": {"flavor": "apple", "taste": None}},
]
}
result = execute("SELECT i.attributes.flavor FROM `ITEM` i", read="bigquery", tables=tables)
self.assertEqual(result.columns, ("flavor",))
self.assertEqual(result.rows, [("cherry",), ("lime",), ("apple",)])