tinybird-toolset 2.7.3__tar.gz → 2.7.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {tinybird_toolset-2.7.3/src/tinybird_toolset.egg-info → tinybird_toolset-2.7.4}/PKG-INFO +1 -1
- {tinybird_toolset-2.7.3 → tinybird_toolset-2.7.4}/conf.py +0 -3
- {tinybird_toolset-2.7.3 → tinybird_toolset-2.7.4}/setup.py +1 -1
- {tinybird_toolset-2.7.3 → tinybird_toolset-2.7.4/src/tinybird_toolset.egg-info}/PKG-INFO +1 -1
- {tinybird_toolset-2.7.3 → tinybird_toolset-2.7.4}/tests/test_replace_tables.py +7 -13
- {tinybird_toolset-2.7.3 → tinybird_toolset-2.7.4}/tests/test_rewrite_aggregation_states.py +7 -1
- {tinybird_toolset-2.7.3 → tinybird_toolset-2.7.4}/tests/test_tables.py +2 -13
- {tinybird_toolset-2.7.3 → tinybird_toolset-2.7.4}/LICENSE +0 -0
- {tinybird_toolset-2.7.3 → tinybird_toolset-2.7.4}/MANIFEST.in +0 -0
- {tinybird_toolset-2.7.3 → tinybird_toolset-2.7.4}/README.md +0 -0
- {tinybird_toolset-2.7.3 → tinybird_toolset-2.7.4}/setup.cfg +0 -0
- {tinybird_toolset-2.7.3 → tinybird_toolset-2.7.4}/src/chtoolset/__init__.py +0 -0
- {tinybird_toolset-2.7.3 → tinybird_toolset-2.7.4}/src/chtoolset/query.py +0 -0
- {tinybird_toolset-2.7.3 → tinybird_toolset-2.7.4}/src/tinybird_toolset.egg-info/SOURCES.txt +0 -0
- {tinybird_toolset-2.7.3 → tinybird_toolset-2.7.4}/src/tinybird_toolset.egg-info/dependency_links.txt +0 -0
- {tinybird_toolset-2.7.3 → tinybird_toolset-2.7.4}/src/tinybird_toolset.egg-info/requires.txt +0 -0
- {tinybird_toolset-2.7.3 → tinybird_toolset-2.7.4}/src/tinybird_toolset.egg-info/top_level.txt +0 -0
- {tinybird_toolset-2.7.3 → tinybird_toolset-2.7.4}/tests/test_check_compatible_types.py +0 -0
- {tinybird_toolset-2.7.3 → tinybird_toolset-2.7.4}/tests/test_check_ttl_partition_compatibility.py +0 -0
- {tinybird_toolset-2.7.3 → tinybird_toolset-2.7.4}/tests/test_check_write_query.py +0 -0
- {tinybird_toolset-2.7.3 → tinybird_toolset-2.7.4}/tests/test_chquery.py +0 -0
- {tinybird_toolset-2.7.3 → tinybird_toolset-2.7.4}/tests/test_convert_to_row_binary.py +0 -0
- {tinybird_toolset-2.7.3 → tinybird_toolset-2.7.4}/tests/test_explain_ast.py +0 -0
- {tinybird_toolset-2.7.3 → tinybird_toolset-2.7.4}/tests/test_get_columns_from_create_query.py +0 -0
- {tinybird_toolset-2.7.3 → tinybird_toolset-2.7.4}/tests/test_get_left_table.py +0 -0
- {tinybird_toolset-2.7.3 → tinybird_toolset-2.7.4}/tests/test_internal_cache.py +0 -0
- {tinybird_toolset-2.7.3 → tinybird_toolset-2.7.4}/tests/test_normalize_query_keep_names.py +0 -0
- {tinybird_toolset-2.7.3 → tinybird_toolset-2.7.4}/tests/test_normalize_table_column.py +0 -0
- {tinybird_toolset-2.7.3 → tinybird_toolset-2.7.4}/tests/test_parse_create_materialized_view_target_table.py +0 -0
- {tinybird_toolset-2.7.3 → tinybird_toolset-2.7.4}/tests/test_replace_tables_backward_compat.py +0 -0
- {tinybird_toolset-2.7.3 → tinybird_toolset-2.7.4}/tests/test_validate_partition_key.py +0 -0
- {tinybird_toolset-2.7.3 → tinybird_toolset-2.7.4}/tests/test_validate_ttl.py +0 -0
|
@@ -95,9 +95,6 @@ def apply_patches():
|
|
|
95
95
|
# Unwind with external code leads to crashes
|
|
96
96
|
apply_patch("patches/unwind.patch")
|
|
97
97
|
|
|
98
|
-
# Sets timezone to UTC manually and avoids reading system files
|
|
99
|
-
apply_patch("patches/timezone.patch")
|
|
100
|
-
|
|
101
98
|
# This patch is used to make it possible to use valgrind with the module
|
|
102
99
|
# see https://jira.mongodb.org/browse/SERVER-25771
|
|
103
100
|
apply_patch("patches/boost_flags.patch")
|
|
@@ -698,6 +698,11 @@ class TestReplaceTables(unittest.TestCase):
|
|
|
698
698
|
replacements = {("default", "table"): ("d_012345", "t_wadus")}
|
|
699
699
|
for sql in [
|
|
700
700
|
"EXPLAIN PLAN actions=1 SELECT table.col FROM table",
|
|
701
|
+
"EXPLAIN PIPELINE header=1 SELECT table.col FROM table",
|
|
702
|
+
"EXPLAIN QUERY TREE passes=1 SELECT table.col FROM table",
|
|
703
|
+
"EXPLAIN SYNTAX oneline=1 SELECT table.col FROM table",
|
|
704
|
+
"EXPLAIN AST SELECT table.col FROM table",
|
|
705
|
+
"EXPLAIN ESTIMATE SELECT table.col FROM table",
|
|
701
706
|
]:
|
|
702
707
|
expected_query = sql.replace("FROM table", "FROM d_012345.t_wadus as table").replace("table.col", "t_wadus.col")
|
|
703
708
|
replaced = chquery.replace_tables(sql, replacements, default_database="default")
|
|
@@ -709,7 +714,7 @@ class TestReplaceTables(unittest.TestCase):
|
|
|
709
714
|
"SELECT * FROM file('/etc/passwd', 'CSV', 'a String')",
|
|
710
715
|
"SELECT * FROM view(SELECT 1)",
|
|
711
716
|
]
|
|
712
|
-
for explain in ["EXPLAIN", "EXPLAIN PLAN actions=1"]:
|
|
717
|
+
for explain in ["EXPLAIN", "EXPLAIN PLAN actions=1", "EXPLAIN PIPELINE header=1", "EXPLAIN QUERY TREE passes=1", "EXPLAIN SYNTAX oneline=1", "EXPLAIN AST", "EXPLAIN ESTIMATE"]:
|
|
713
718
|
for query in explained:
|
|
714
719
|
with self.assertRaisesRegex(ValueError, "is restricted"):
|
|
715
720
|
chquery.replace_tables(f"{explain} {query}", {("default", "t"): ("d_1", "t_1")})
|
|
@@ -723,29 +728,18 @@ class TestReplaceTables(unittest.TestCase):
|
|
|
723
728
|
self.assertIn("db_b.events_b", replaced_b)
|
|
724
729
|
self.assertNotIn("db_a", replaced_b)
|
|
725
730
|
|
|
726
|
-
def test_explain_query_throws_with_unsupported_kinds(self):
|
|
727
|
-
for kind in ["AST", "SYNTAX", "QUERY TREE", "PIPELINE", "ESTIMATE"]:
|
|
728
|
-
with self.assertRaisesRegex(ValueError, 'Only plain EXPLAIN is supported'):
|
|
729
|
-
chquery.replace_tables(f"EXPLAIN {kind} SELECT col FROM table", {("default", "table"): ("d_012345", "t_wadus")})
|
|
730
|
-
|
|
731
731
|
def test_explain_query_throws_with_unsupported_explained_query(self):
|
|
732
732
|
queries = [
|
|
733
733
|
"EXPLAIN INSERT INTO test.table VALUES (1,2,3)",
|
|
734
734
|
"EXPLAIN INSERT INTO test.table SELECT * FROM other",
|
|
735
735
|
"EXPLAIN CREATE TABLE table_test (`index` String) ENGINE = MergeTree ORDER BY index",
|
|
736
|
-
]
|
|
737
|
-
for q in queries:
|
|
738
|
-
with self.assertRaisesRegex(ValueError, 'EXPLAIN is only supported for SELECT queries'):
|
|
739
|
-
chquery.replace_tables(q, {("default", "table"): ("d_012345", "t_wadus")})
|
|
740
|
-
|
|
741
|
-
queries = [
|
|
742
736
|
"EXPLAIN TABLE OVERRIDE mysql('127.0.0.1:3306', 'db', 't', 'u', 'p') PARTITION BY toYYYYMM(d)",
|
|
743
737
|
"EXPLAIN CURRENT TRANSACTION",
|
|
744
738
|
"EXPLAIN AST DROP TABLE test",
|
|
745
739
|
"EXPLAIN AST INSERT INTO test.table VALUES (1,2,3)",
|
|
746
740
|
]
|
|
747
741
|
for q in queries:
|
|
748
|
-
with self.assertRaisesRegex(ValueError, '
|
|
742
|
+
with self.assertRaisesRegex(ValueError, 'EXPLAIN is only supported for SELECT queries'):
|
|
749
743
|
chquery.replace_tables(q, {("default", "table"): ("d_012345", "t_wadus")})
|
|
750
744
|
|
|
751
745
|
def test_replace_of_table_function_throws(self):
|
|
@@ -150,6 +150,12 @@ class TestGetLeftTable(unittest.TestCase):
|
|
|
150
150
|
self.assertEqual(chquery.format(chquery.rewrite_aggregation_states(sql)), chquery.format(expected))
|
|
151
151
|
|
|
152
152
|
def test_throws_with_explain_and_describe(self):
|
|
153
|
-
for sql in [
|
|
153
|
+
for sql in [
|
|
154
|
+
"EXPLAIN SELECT avg(value) FROM table",
|
|
155
|
+
"EXPLAIN AST SELECT avg(value) FROM table",
|
|
156
|
+
"EXPLAIN PIPELINE SELECT avg(value) FROM table",
|
|
157
|
+
"EXPLAIN ESTIMATE SELECT avg(value) FROM table",
|
|
158
|
+
"DESCRIBE TABLE table",
|
|
159
|
+
]:
|
|
154
160
|
with self.assertRaisesRegex(ValueError, "Only SELECT queries are supported"):
|
|
155
161
|
chquery.rewrite_aggregation_states(sql)
|
|
@@ -255,16 +255,11 @@ SELECT *
|
|
|
255
255
|
self.assertEqual(chquery.tables(sql), [('', 'table', '')])
|
|
256
256
|
|
|
257
257
|
def test_explain_query(self):
|
|
258
|
-
for kind in ["", "PLAN", "PLAN indexes=1", "actions=1"]:
|
|
258
|
+
for kind in ["", "PLAN", "PLAN indexes=1", "actions=1", "AST", "SYNTAX", "QUERY TREE", "PIPELINE", "ESTIMATE"]:
|
|
259
259
|
sql = f"EXPLAIN {kind} SELECT table.col FROM db.table JOIN other ON table.id = other.id"
|
|
260
260
|
self.assertEqual(sorted(chquery.tables(sql)),
|
|
261
261
|
[('', 'other', ''), ('db', 'table', '')], sql)
|
|
262
262
|
|
|
263
|
-
def test_explain_query_throws_with_unsupported_kinds(self):
|
|
264
|
-
for kind in ["AST", "SYNTAX", "QUERY TREE", "PIPELINE", "ESTIMATE"]:
|
|
265
|
-
with self.assertRaisesRegex(ValueError, 'Only plain EXPLAIN is supported'):
|
|
266
|
-
chquery.tables(f"EXPLAIN {kind} SELECT col FROM db.table")
|
|
267
|
-
|
|
268
263
|
def test_explain_query_throws_with_invalid_inner_function(self):
|
|
269
264
|
with self.assertRaisesRegex(ValueError, 'DB::Exception: Unknown function doesNotExist'):
|
|
270
265
|
chquery.tables("EXPLAIN SELECT doesNotExist(number) FROM numbers(100)")
|
|
@@ -274,19 +269,13 @@ SELECT *
|
|
|
274
269
|
"EXPLAIN INSERT INTO test.table VALUES (1,2,3)",
|
|
275
270
|
"EXPLAIN INSERT INTO test.table SELECT * FROM other",
|
|
276
271
|
"EXPLAIN CREATE TABLE table_test (`index` String) ENGINE = MergeTree ORDER BY index",
|
|
277
|
-
]
|
|
278
|
-
for q in queries:
|
|
279
|
-
with self.assertRaisesRegex(ValueError, 'EXPLAIN is only supported for SELECT queries'):
|
|
280
|
-
chquery.tables(q)
|
|
281
|
-
|
|
282
|
-
queries = [
|
|
283
272
|
"EXPLAIN TABLE OVERRIDE mysql('127.0.0.1:3306', 'db', 't', 'u', 'p') PARTITION BY toYYYYMM(d)",
|
|
284
273
|
"EXPLAIN CURRENT TRANSACTION",
|
|
285
274
|
"EXPLAIN AST DROP TABLE test",
|
|
286
275
|
"EXPLAIN AST INSERT INTO test.table VALUES (1,2,3)",
|
|
287
276
|
]
|
|
288
277
|
for q in queries:
|
|
289
|
-
with self.assertRaisesRegex(ValueError, '
|
|
278
|
+
with self.assertRaisesRegex(ValueError, 'EXPLAIN is only supported for SELECT queries'):
|
|
290
279
|
chquery.tables(q)
|
|
291
280
|
|
|
292
281
|
def test_throws_with_invalid_query_types(self):
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{tinybird_toolset-2.7.3 → tinybird_toolset-2.7.4}/src/tinybird_toolset.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
{tinybird_toolset-2.7.3 → tinybird_toolset-2.7.4}/src/tinybird_toolset.egg-info/requires.txt
RENAMED
|
File without changes
|
{tinybird_toolset-2.7.3 → tinybird_toolset-2.7.4}/src/tinybird_toolset.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|
{tinybird_toolset-2.7.3 → tinybird_toolset-2.7.4}/tests/test_check_ttl_partition_compatibility.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{tinybird_toolset-2.7.3 → tinybird_toolset-2.7.4}/tests/test_get_columns_from_create_query.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{tinybird_toolset-2.7.3 → tinybird_toolset-2.7.4}/tests/test_replace_tables_backward_compat.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|