tinybird-cli 5.22.3.dev0__py3-none-any.whl → 6.0.2.dev0__py3-none-any.whl
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/__cli__.py +2 -2
- tinybird/ch_utils/engine.py +2 -77
- tinybird/client.py +3 -141
- tinybird/config.py +0 -5
- tinybird/datafile_common.py +18 -38
- tinybird/datatypes.py +13 -0
- tinybird/feedback_manager.py +1 -41
- tinybird/sql.py +6 -5
- tinybird/sql_template.py +527 -36
- tinybird/sql_toolset.py +6 -32
- tinybird/tb_cli_modules/auth.py +1 -11
- tinybird/tb_cli_modules/cli.py +1 -83
- tinybird/tb_cli_modules/common.py +27 -153
- tinybird/tb_cli_modules/config.py +1 -3
- tinybird/tb_cli_modules/connection.py +1 -225
- tinybird/tb_cli_modules/datasource.py +11 -95
- tinybird/tornado_template.py +8 -3
- {tinybird_cli-5.22.3.dev0.dist-info → tinybird_cli-6.0.2.dev0.dist-info}/METADATA +13 -20
- tinybird_cli-6.0.2.dev0.dist-info/RECORD +44 -0
- tinybird/connectors.py +0 -422
- tinybird_cli-5.22.3.dev0.dist-info/RECORD +0 -45
- {tinybird_cli-5.22.3.dev0.dist-info → tinybird_cli-6.0.2.dev0.dist-info}/WHEEL +0 -0
- {tinybird_cli-5.22.3.dev0.dist-info → tinybird_cli-6.0.2.dev0.dist-info}/entry_points.txt +0 -0
- {tinybird_cli-5.22.3.dev0.dist-info → tinybird_cli-6.0.2.dev0.dist-info}/top_level.txt +0 -0
tinybird/sql.py
CHANGED
|
@@ -39,6 +39,7 @@ _RE_INDEX_ENTRY = re.compile(
|
|
|
39
39
|
r"(\w+)\s+([\w\s*\[\]\*\(\),\'\"-><.]+)\s+TYPE\s+(\w+)(?:\(([\w\s*.,]+)\))?(?:\s+GRANULARITY\s+(\d+))?"
|
|
40
40
|
)
|
|
41
41
|
_RE_REPLICATED_MT = re.compile(r"Replicated(.*)MergeTree\(([^\)]*)\)(.*)")
|
|
42
|
+
_RE_REPLICATED_ENGINE_SPLIT = re.compile(r"(Replicated.*MergeTree\(')([^']*)('.*)")
|
|
42
43
|
|
|
43
44
|
|
|
44
45
|
@dataclass
|
|
@@ -836,7 +837,7 @@ def engine_can_be_replicated(engine: Optional[str]) -> bool:
|
|
|
836
837
|
"""
|
|
837
838
|
>>> engine_can_be_replicated('MergeTree() order by tuple()')
|
|
838
839
|
True
|
|
839
|
-
>>> engine_can_be_replicated('
|
|
840
|
+
>>> engine_can_be_replicated('Null')
|
|
840
841
|
False
|
|
841
842
|
>>> engine_can_be_replicated('ReplicatingMergeTree() order by tuple()')
|
|
842
843
|
True
|
|
@@ -855,7 +856,7 @@ def engine_supports_delete(engine: Optional[str]) -> bool:
|
|
|
855
856
|
"""
|
|
856
857
|
>>> engine_supports_delete('MergeTree() order by tuple()')
|
|
857
858
|
True
|
|
858
|
-
>>> engine_supports_delete('
|
|
859
|
+
>>> engine_supports_delete('Null')
|
|
859
860
|
False
|
|
860
861
|
>>> engine_supports_delete('ReplicatingMergeTree() order by tuple()')
|
|
861
862
|
True
|
|
@@ -873,8 +874,8 @@ def engine_replicated_to_local(engine: str) -> str:
|
|
|
873
874
|
'MergeTree() order by (test)'
|
|
874
875
|
>>> engine_replicated_to_local("ReplicatedReplacingMergeTree('/clickhouse/tables/{layer}-{shard}/test.foo', '{replica}', timestamp) order by (test)")
|
|
875
876
|
'ReplacingMergeTree(timestamp) order by (test)'
|
|
876
|
-
>>> engine_replicated_to_local("
|
|
877
|
-
'
|
|
877
|
+
>>> engine_replicated_to_local("Null")
|
|
878
|
+
'Null'
|
|
878
879
|
>>> engine_replicated_to_local("ReplicatedVersionedCollapsingMergeTree('/clickhouse/tables/{layer}-{shard}/test.foo', '{replica}', sign,version) ORDER BY pk TTL toDate(local_timeplaced) + toIntervalDay(3) SETTINGS index_granularity = 8192")
|
|
879
880
|
'VersionedCollapsingMergeTree(sign, version) ORDER BY pk TTL toDate(local_timeplaced) + toIntervalDay(3) SETTINGS index_granularity = 8192'
|
|
880
881
|
"""
|
|
@@ -911,7 +912,7 @@ def engine_patch_replicated_engine(engine: str, engine_full: Optional[str], new_
|
|
|
911
912
|
if not engine_full:
|
|
912
913
|
return None
|
|
913
914
|
if engine.lower().startswith("Replicated".lower()):
|
|
914
|
-
parts =
|
|
915
|
+
parts = _RE_REPLICATED_ENGINE_SPLIT.split(engine_full)
|
|
915
916
|
paths = parts[2].split("/")
|
|
916
917
|
paths[-1] = new_table_name
|
|
917
918
|
zoo_path = "/".join(paths)
|