tinybird 4.6.23.dev0__tar.gz → 4.6.25.dev0__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-4.6.23.dev0 → tinybird-4.6.25.dev0}/PKG-INFO +6 -1
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/pyproject.toml +49 -43
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/ch_utils/engine.py +28 -9
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/client.py +3 -20
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/datafile/common.py +8 -3
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/sql_template.py +65 -27
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/sql_template_fmt.py +2 -2
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/sql_toolset.py +1 -1
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/syncasync.py +0 -43
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/tb/__cli__.py +2 -2
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/tb/client.py +3 -20
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/tb/modules/common.py +3 -3
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/tb/modules/create.py +2 -4
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/tb/modules/datafile/pull.py +73 -3
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/tb/modules/datasource.py +1 -1
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/tb/modules/exceptions.py +0 -21
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/tb_cli_modules/branch.py +3 -23
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/tb_cli_modules/common.py +3 -3
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/tb_cli_modules/datasource.py +1 -1
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/tornado_template.py +38 -93
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird.egg-info/PKG-INFO +6 -1
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/setup.cfg +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/__cli__.py +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/ch_utils/constants.py +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/check_pypi.py +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/config.py +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/context.py +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/datafile/exceptions.py +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/datafile/parse_connection.py +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/datafile/parse_datasource.py +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/datafile/parse_pipe.py +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/datatypes.py +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/feedback_manager.py +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/git_settings.py +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/iterating/__init__.py +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/iterating/data_branch_modes.py +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/prompts.py +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/service_datasources.py +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/sql.py +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/tb/check_pypi.py +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/tb/cli.py +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/tb/config.py +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/tb/modules/branch.py +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/tb/modules/build.py +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/tb/modules/build_common.py +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/tb/modules/cicd.py +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/tb/modules/cli.py +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/tb/modules/config.py +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/tb/modules/connection.py +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/tb/modules/connection_dynamodb.py +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/tb/modules/connection_kafka.py +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/tb/modules/connection_s3.py +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/tb/modules/copy.py +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/tb/modules/datafile/build.py +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/tb/modules/datafile/build_common.py +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/tb/modules/datafile/build_datasource.py +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/tb/modules/datafile/build_pipe.py +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/tb/modules/datafile/diff.py +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/tb/modules/datafile/fixture.py +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/tb/modules/datafile/format_common.py +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/tb/modules/datafile/format_connection.py +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/tb/modules/datafile/format_datasource.py +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/tb/modules/datafile/format_pipe.py +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/tb/modules/datafile/pipe_checker.py +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/tb/modules/datafile/playground.py +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/tb/modules/deployment.py +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/tb/modules/deployment_common.py +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/tb/modules/deprecations.py +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/tb/modules/endpoint.py +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/tb/modules/feedback_manager.py +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/tb/modules/fmt.py +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/tb/modules/info.py +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/tb/modules/infra.py +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/tb/modules/job.py +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/tb/modules/job_common.py +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/tb/modules/llm.py +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/tb/modules/llm_utils.py +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/tb/modules/local.py +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/tb/modules/local_common.py +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/tb/modules/local_logs.py +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/tb/modules/login.py +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/tb/modules/login_common.py +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/tb/modules/logout.py +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/tb/modules/logs.py +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/tb/modules/materialization.py +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/tb/modules/open.py +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/tb/modules/pipe.py +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/tb/modules/preview.py +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/tb/modules/project.py +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/tb/modules/project_commands.py +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/tb/modules/py_project.py +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/tb/modules/query_output.py +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/tb/modules/regions.py +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/tb/modules/secret.py +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/tb/modules/secret_common.py +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/tb/modules/sink.py +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/tb/modules/table.py +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/tb/modules/telemetry.py +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/tb/modules/test.py +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/tb/modules/test_common.py +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/tb/modules/tinyunit/tinyunit.py +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/tb/modules/token.py +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/tb/modules/ts_project.py +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/tb/modules/watch.py +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/tb/modules/workspace.py +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/tb/modules/workspace_members.py +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/tb_cli.py +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/tb_cli_modules/auth.py +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/tb_cli_modules/cicd.py +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/tb_cli_modules/cli.py +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/tb_cli_modules/config.py +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/tb_cli_modules/connection.py +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/tb_cli_modules/exceptions.py +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/tb_cli_modules/fmt.py +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/tb_cli_modules/job.py +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/tb_cli_modules/pipe.py +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/tb_cli_modules/regions.py +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/tb_cli_modules/tag.py +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/tb_cli_modules/telemetry.py +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/tb_cli_modules/test.py +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/tb_cli_modules/tinyunit/tinyunit.py +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/tb_cli_modules/workspace.py +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/tb_cli_modules/workspace_members.py +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/utils/__init__.py +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird/utils/bools.py +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird.egg-info/SOURCES.txt +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird.egg-info/dependency_links.txt +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird.egg-info/entry_points.txt +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird.egg-info/requires.txt +0 -0
- {tinybird-4.6.23.dev0 → tinybird-4.6.25.dev0}/tinybird.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: tinybird
|
|
3
|
-
Version: 4.6.
|
|
3
|
+
Version: 4.6.25.dev0
|
|
4
4
|
Summary: Tinybird Command Line Tool
|
|
5
5
|
Home-page: https://www.tinybird.co/docs/forward/commands
|
|
6
6
|
Author: Tinybird
|
|
@@ -52,6 +52,11 @@ The Tinybird command-line tool allows you to use all the Tinybird functionality
|
|
|
52
52
|
Changelog
|
|
53
53
|
----------
|
|
54
54
|
|
|
55
|
+
4.6.22
|
|
56
|
+
********
|
|
57
|
+
|
|
58
|
+
- `Added` ``tb pull`` demotes sink and copy pipes that exceed the workspace's sink/copy pipe plan limit to plain pipes instead of failing, stripping their ``TYPE``/``EXPORT_*``/``TARGET_DATASOURCE``/``COPY_SCHEDULE`` settings and warning that the plan must be upgraded to restore them.
|
|
59
|
+
|
|
55
60
|
4.6.21
|
|
56
61
|
********
|
|
57
62
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
requires = [
|
|
3
3
|
"setuptools>=61.0",
|
|
4
4
|
"wheel==0.37.1",
|
|
5
|
-
"cffi
|
|
5
|
+
"cffi~=2.0",
|
|
6
6
|
]
|
|
7
7
|
build-backend = "setuptools.build_meta"
|
|
8
8
|
|
|
@@ -18,35 +18,35 @@ authors = [
|
|
|
18
18
|
dependencies = [
|
|
19
19
|
"GitPython==3.1.44",
|
|
20
20
|
"Markdown==3.5.1",
|
|
21
|
-
"aioboto3
|
|
21
|
+
"aioboto3~=15.0",
|
|
22
22
|
"aiofiles==24.1.0",
|
|
23
|
-
"aiohttp
|
|
24
|
-
"anthropic
|
|
23
|
+
"aiohttp~=3.11",
|
|
24
|
+
"anthropic~=1.9",
|
|
25
25
|
"async-lru==2.3.0",
|
|
26
26
|
"aws-msk-iam-sasl-signer-python==1.0.2",
|
|
27
|
-
"cachetools
|
|
28
|
-
"cffi
|
|
27
|
+
"cachetools~=6.0",
|
|
28
|
+
"cffi~=2.0",
|
|
29
29
|
"chardet==4.0.0",
|
|
30
30
|
"ciso8601==2.2.0",
|
|
31
|
-
"click
|
|
31
|
+
"click~=8.5",
|
|
32
32
|
"clickhouse-cityhash==1.0.2.5",
|
|
33
33
|
"clickhouse-driver==0.2.9",
|
|
34
34
|
"confluent-kafka[avro,json,schemaregistry]==2.12.2",
|
|
35
35
|
"contextvars==2.4",
|
|
36
36
|
"cramjam==2.11.0",
|
|
37
37
|
"croniter==6.2.2",
|
|
38
|
-
"cryptography
|
|
38
|
+
"cryptography~=50.0",
|
|
39
39
|
"datasketch==1.6.5",
|
|
40
40
|
"dnspython==2.8.0",
|
|
41
41
|
"docker==7.1.0",
|
|
42
42
|
"fastavro==1.12.2",
|
|
43
43
|
"fastmcp==2.12.2",
|
|
44
|
-
"google-cloud-aiplatform
|
|
44
|
+
"google-cloud-aiplatform~=1.148",
|
|
45
45
|
"google-cloud-compute==1.48.0",
|
|
46
46
|
"google-cloud-scheduler==2.20.0",
|
|
47
47
|
"google-cloud-secret-manager==2.29.0",
|
|
48
|
-
"google-cloud-storage
|
|
49
|
-
"google_api_core
|
|
48
|
+
"google-cloud-storage~=3.4",
|
|
49
|
+
"google_api_core~=2.25",
|
|
50
50
|
"googleapis_common_protos==1.66.0",
|
|
51
51
|
"grpcio_status==1.67.1",
|
|
52
52
|
"humanfriendly==10.0",
|
|
@@ -54,22 +54,22 @@ dependencies = [
|
|
|
54
54
|
"jinja2",
|
|
55
55
|
"jsondiff==2.2.1",
|
|
56
56
|
"jsonschema==4.23.0",
|
|
57
|
-
"litellm
|
|
57
|
+
"litellm~=1.97",
|
|
58
58
|
"logfire-api==4.2.0",
|
|
59
59
|
"lru-dict==1.3.0",
|
|
60
60
|
"lz4==4.4.5",
|
|
61
61
|
"memray==1.20.0",
|
|
62
62
|
"msgspec==0.21.1",
|
|
63
|
-
"multidict==6.
|
|
63
|
+
"multidict==6.9.1",
|
|
64
64
|
"networkx==3.4.2",
|
|
65
65
|
"numpy==1.26.4",
|
|
66
66
|
"objgraph==3.6.2",
|
|
67
|
-
"opentelemetry-api
|
|
68
|
-
"opentelemetry-exporter-otlp-proto-http
|
|
69
|
-
"opentelemetry-sdk
|
|
70
|
-
"orb-billing==
|
|
71
|
-
"orjson==3.11.
|
|
72
|
-
"packaging
|
|
67
|
+
"opentelemetry-api~=1.38",
|
|
68
|
+
"opentelemetry-exporter-otlp-proto-http~=1.38",
|
|
69
|
+
"opentelemetry-sdk~=1.38",
|
|
70
|
+
"orb-billing==4.80.1",
|
|
71
|
+
"orjson==3.11.9",
|
|
72
|
+
"packaging~=26.3",
|
|
73
73
|
"passlib==1.7.1",
|
|
74
74
|
"posthog==7.28.0",
|
|
75
75
|
"pre-commit==4.6.2",
|
|
@@ -83,10 +83,10 @@ dependencies = [
|
|
|
83
83
|
"py-spy==0.4.2",
|
|
84
84
|
"pyarrow==23.0.1",
|
|
85
85
|
"pycurl==7.45.7",
|
|
86
|
-
"pydantic-ai-slim[anthropic]
|
|
87
|
-
"pydantic-ai-slim[google]
|
|
88
|
-
"pydantic-ai-slim[retries]
|
|
89
|
-
"pydantic
|
|
86
|
+
"pydantic-ai-slim[anthropic]~=2.0",
|
|
87
|
+
"pydantic-ai-slim[google]~=2.0",
|
|
88
|
+
"pydantic-ai-slim[retries]~=2.0",
|
|
89
|
+
"pydantic~=2.12",
|
|
90
90
|
"pyjwt[crypto]==2.9.0",
|
|
91
91
|
"pympler==1.1",
|
|
92
92
|
"pynacl==1.5.0",
|
|
@@ -94,10 +94,10 @@ dependencies = [
|
|
|
94
94
|
"python-dateutil==2.9.0.post0",
|
|
95
95
|
"python-dotenv==1.1.0",
|
|
96
96
|
"python-ulid==2.7.0",
|
|
97
|
-
"pyyaml
|
|
97
|
+
"pyyaml~=6.0",
|
|
98
98
|
"redis[hiredis]==5.3.1",
|
|
99
|
-
"requests
|
|
100
|
-
"sentry-sdk==2.69.
|
|
99
|
+
"requests~=2.32.5",
|
|
100
|
+
"sentry-sdk==2.69.2",
|
|
101
101
|
"setproctitle==1.3.3",
|
|
102
102
|
"shandy-sqlfmt==0.11.1",
|
|
103
103
|
"shandy-sqlfmt[jinjafmt]==0.11.1",
|
|
@@ -108,11 +108,11 @@ dependencies = [
|
|
|
108
108
|
"tabulate==0.8.10",
|
|
109
109
|
"thefuzz==0.22.1",
|
|
110
110
|
"tinybird-python-sdk[ai]==0.3.7",
|
|
111
|
-
"tinybird-toolset==2.
|
|
111
|
+
"tinybird-toolset==2.7.1",
|
|
112
112
|
"toposort==1.10",
|
|
113
113
|
"tornado==6.5.5",
|
|
114
|
-
"urllib3
|
|
115
|
-
"uvicorn[standard]
|
|
114
|
+
"urllib3~=2.8",
|
|
115
|
+
"uvicorn[standard]~=0.53.0",
|
|
116
116
|
"virtualenv==20.21.1",
|
|
117
117
|
"watchdog==6.0.0",
|
|
118
118
|
"wheel==0.37.1",
|
|
@@ -125,12 +125,12 @@ deploy = [
|
|
|
125
125
|
"GitPython==3.1.44",
|
|
126
126
|
"ansible==8.5.0",
|
|
127
127
|
"ara==1.6.1",
|
|
128
|
-
"boto3
|
|
128
|
+
"boto3~=1.40",
|
|
129
129
|
"fabric==3.2.2",
|
|
130
|
-
"google-auth
|
|
130
|
+
"google-auth~=2.47",
|
|
131
131
|
"jsonnet",
|
|
132
132
|
"prettytable==3.8.0",
|
|
133
|
-
"requests
|
|
133
|
+
"requests~=2.32.5",
|
|
134
134
|
"requests[security]",
|
|
135
135
|
"xmltodict",
|
|
136
136
|
]
|
|
@@ -142,7 +142,7 @@ devtools = [
|
|
|
142
142
|
]
|
|
143
143
|
doc = [
|
|
144
144
|
"Pallets-Sphinx-Themes==2.3.0",
|
|
145
|
-
"pyOpenSSL
|
|
145
|
+
"pyOpenSSL~=26.4",
|
|
146
146
|
"sphinx-autobuild==2024.2.4",
|
|
147
147
|
"sphinx-sitemap",
|
|
148
148
|
"sphinx==7.3.7",
|
|
@@ -150,15 +150,16 @@ doc = [
|
|
|
150
150
|
"sphinxcontrib-jquery==4.1",
|
|
151
151
|
]
|
|
152
152
|
lint = [
|
|
153
|
-
"botocore-stubs
|
|
154
|
-
"
|
|
153
|
+
"botocore-stubs~=1.40",
|
|
154
|
+
"celery-types~=0.20.0",
|
|
155
|
+
"flake8~=7.4",
|
|
155
156
|
"flake8-async~=26.8",
|
|
156
157
|
"mypy==2.3.1",
|
|
157
|
-
"ruff==0.16.
|
|
158
|
+
"ruff==0.16.10",
|
|
158
159
|
"types-Markdown",
|
|
159
160
|
"types-PyYAML",
|
|
160
161
|
"types-aiofiles==24.1.0.20241221",
|
|
161
|
-
"types-boto3-lite
|
|
162
|
+
"types-boto3-lite~=1.40",
|
|
162
163
|
"types-cachetools",
|
|
163
164
|
"types-chardet",
|
|
164
165
|
"types-paramiko",
|
|
@@ -170,20 +171,21 @@ lint = [
|
|
|
170
171
|
"types_croniter",
|
|
171
172
|
]
|
|
172
173
|
test = [
|
|
173
|
-
"coverage
|
|
174
|
+
"coverage~=7.16",
|
|
174
175
|
"freezegun==1.5.5",
|
|
175
|
-
"google-auth
|
|
176
|
+
"google-auth~=2.47",
|
|
176
177
|
"gsutil==4.58",
|
|
177
|
-
"
|
|
178
|
+
"httpx2~=2.13",
|
|
179
|
+
"hypothesis==6.156.9",
|
|
178
180
|
"oauth2client==3.0.0",
|
|
179
181
|
"py==1.11.0",
|
|
180
|
-
"pytest-asyncio
|
|
181
|
-
"pytest-cov
|
|
182
|
+
"pytest-asyncio~=1.4",
|
|
183
|
+
"pytest-cov~=7.0",
|
|
182
184
|
"pytest-env==1.1.3",
|
|
183
185
|
"pytest-flakefinder==1.1.0",
|
|
184
186
|
"pytest-timeout==2.3.1",
|
|
185
187
|
"pytest-xdist==3.6.1",
|
|
186
|
-
"pytest
|
|
188
|
+
"pytest~=8.1",
|
|
187
189
|
"rangehttpserver==1.4.0",
|
|
188
190
|
"yappi==1.7.6",
|
|
189
191
|
]
|
|
@@ -204,7 +206,11 @@ colibri = "tinybird.colibri.cli:cli"
|
|
|
204
206
|
[tool.uv.workspace]
|
|
205
207
|
members = [
|
|
206
208
|
"chbackups",
|
|
209
|
+
"clickhouse",
|
|
207
210
|
"data_connector",
|
|
211
|
+
"gatherer",
|
|
212
|
+
"platform-api",
|
|
213
|
+
"tinybird_orchestrator",
|
|
208
214
|
]
|
|
209
215
|
|
|
210
216
|
[tool.setuptools]
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import functools
|
|
1
2
|
import logging
|
|
2
3
|
import re
|
|
3
4
|
from collections import defaultdict
|
|
@@ -25,6 +26,9 @@ DEFAULT_EMPTY_PARAMETERS = ["ttl", "partition_key", "sorting_key"]
|
|
|
25
26
|
# * `N` is a number
|
|
26
27
|
SIMPLE_TTL_DEFINITION = re.compile(r"""^([a-zA-Z0-9_\-\.\(\)\ \/\*]*) \+ (toInterval[a-zA-Z]*\([0-9]+\))$""")
|
|
27
28
|
|
|
29
|
+
# ClickHouse 25.8 quotes the engine name `Null`, as `null` is a keyword.
|
|
30
|
+
_BACKQUOTED_ENGINE_NAME = re.compile(r"^`(\w+)`")
|
|
31
|
+
|
|
28
32
|
|
|
29
33
|
class TableDetails:
|
|
30
34
|
"""
|
|
@@ -78,6 +82,16 @@ class TableDetails:
|
|
|
78
82
|
|
|
79
83
|
@property
|
|
80
84
|
def engine_full(self) -> Optional[str]:
|
|
85
|
+
"""
|
|
86
|
+
>>> TableDetails({"engine_full": "`Null`", "engine": "Null"}).engine_full
|
|
87
|
+
'Null'
|
|
88
|
+
>>> TableDetails({"engine_full": "`Null`()", "engine": "Null"}).engine_full
|
|
89
|
+
'Null()'
|
|
90
|
+
>>> TableDetails({"engine_full": "Null", "engine": "Null"}).to_json()
|
|
91
|
+
{'engine_full': 'Null', 'engine': 'Null'}
|
|
92
|
+
>>> TableDetails({"engine_full": "`Null`", "engine": "Null"}).to_json()
|
|
93
|
+
{'engine_full': 'Null', 'engine': 'Null'}
|
|
94
|
+
"""
|
|
81
95
|
_engine_full: Optional[str] = self.details.get("engine_full", None)
|
|
82
96
|
if not _engine_full:
|
|
83
97
|
return None
|
|
@@ -86,7 +100,7 @@ class TableDetails:
|
|
|
86
100
|
# We cannot remove index_granularity = 8192 blindly because it might be followed by other settings
|
|
87
101
|
if settings and settings.strip().lower() == "index_granularity = 8192":
|
|
88
102
|
_engine_full = _engine_full.replace(" SETTINGS index_granularity = 8192", "")
|
|
89
|
-
return engine_replicated_to_local(_engine_full)
|
|
103
|
+
return engine_replicated_to_local(_BACKQUOTED_ENGINE_NAME.sub(r"\1", _engine_full))
|
|
90
104
|
|
|
91
105
|
@property
|
|
92
106
|
def original_engine_full(self) -> Optional[str]:
|
|
@@ -776,17 +790,22 @@ def ttl_condition_from_engine_full(engine_full: Optional[str]) -> Optional[str]:
|
|
|
776
790
|
return None
|
|
777
791
|
|
|
778
792
|
|
|
793
|
+
@functools.lru_cache(maxsize=1024)
|
|
794
|
+
def _index_lines(create_table_query_expr: str) -> tuple[str, ...]:
|
|
795
|
+
from tinybird.sql_toolset import format_sql
|
|
796
|
+
|
|
797
|
+
return tuple(
|
|
798
|
+
line.strip() for line in format_sql(create_table_query_expr).splitlines() if line.strip().startswith("INDEX")
|
|
799
|
+
)
|
|
800
|
+
|
|
801
|
+
|
|
779
802
|
def _parse_indexes(create_table_query_expr: str) -> List[TableIndex]:
|
|
780
|
-
|
|
803
|
+
# format_sql is CPU-heavy and runs on the event loop. ClickHouse writes the
|
|
804
|
+
# INDEX keyword in uppercase in create_table_query.
|
|
805
|
+
if "INDEX" not in create_table_query_expr:
|
|
781
806
|
return []
|
|
782
807
|
try:
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
indexes = [
|
|
786
|
-
line.strip()
|
|
787
|
-
for line in format_sql(create_table_query_expr).splitlines()
|
|
788
|
-
if line.strip().startswith("INDEX")
|
|
789
|
-
]
|
|
808
|
+
indexes = list(_index_lines(create_table_query_expr))
|
|
790
809
|
except ModuleNotFoundError:
|
|
791
810
|
# this is not needed from CLI
|
|
792
811
|
return []
|
|
@@ -47,14 +47,6 @@ class TimeoutException(Exception):
|
|
|
47
47
|
pass
|
|
48
48
|
|
|
49
49
|
|
|
50
|
-
class ReachRetryLimit(Exception):
|
|
51
|
-
pass
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
class ConnectorNothingToLoad(Exception):
|
|
55
|
-
pass
|
|
56
|
-
|
|
57
|
-
|
|
58
50
|
class JobException(Exception):
|
|
59
51
|
pass
|
|
60
52
|
|
|
@@ -859,7 +851,6 @@ class TinyB:
|
|
|
859
851
|
assert_time_increase_percentage: Optional[float] = None,
|
|
860
852
|
assert_bytes_read_increase_percentage: Optional[float] = None,
|
|
861
853
|
assert_max_time: Optional[float] = None,
|
|
862
|
-
run_in_main: Optional[bool] = False,
|
|
863
854
|
):
|
|
864
855
|
test: Dict[str, Any] = {
|
|
865
856
|
test_type: {
|
|
@@ -889,20 +880,12 @@ class TinyB:
|
|
|
889
880
|
]
|
|
890
881
|
|
|
891
882
|
data = json.dumps(regression_commands)
|
|
892
|
-
|
|
893
|
-
url = f"/v0/environments/{branch_id}/regression/main"
|
|
894
|
-
else:
|
|
895
|
-
url = f"/v0/environments/{branch_id}/regression"
|
|
883
|
+
url = f"/v0/environments/{branch_id}/regression"
|
|
896
884
|
return await self._req(url, method="POST", data=data, headers={"Content-Type": "application/json"})
|
|
897
885
|
|
|
898
|
-
async def branch_regression_tests_file(
|
|
899
|
-
self, branch_id: str, regression_commands: List[Dict[str, Any]], run_in_main: Optional[bool] = False
|
|
900
|
-
):
|
|
886
|
+
async def branch_regression_tests_file(self, branch_id: str, regression_commands: List[Dict[str, Any]]):
|
|
901
887
|
data = json.dumps(regression_commands)
|
|
902
|
-
|
|
903
|
-
url = f"/v0/environments/{branch_id}/regression/main"
|
|
904
|
-
else:
|
|
905
|
-
url = f"/v0/environments/{branch_id}/regression"
|
|
888
|
+
url = f"/v0/environments/{branch_id}/regression"
|
|
906
889
|
return await self._req(url, method="POST", data=data, headers={"Content-Type": "application/json"})
|
|
907
890
|
|
|
908
891
|
async def delete_workspace(self, id: str, hard_delete_confirmation: Optional[str], version: str = "v0"):
|
|
@@ -2173,9 +2173,14 @@ def parse(
|
|
|
2173
2173
|
line = lines[lineno - 1]
|
|
2174
2174
|
# shlex.shlex(line) removes comments that start with #. This doesn't affect multiline commands
|
|
2175
2175
|
try:
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2176
|
+
# Without quotes, escapes, or comment characters, str.split tokenizes
|
|
2177
|
+
# the same as shlex with whitespace_split=True, at a fraction of the cost.
|
|
2178
|
+
if '"' in line or "'" in line or "\\" in line or "#" in line:
|
|
2179
|
+
sa = shlex.shlex(line)
|
|
2180
|
+
sa.whitespace_split = True
|
|
2181
|
+
lexer = list(sa)
|
|
2182
|
+
else:
|
|
2183
|
+
lexer = line.split()
|
|
2179
2184
|
except ValueError:
|
|
2180
2185
|
sa = shlex.shlex(shlex.quote(line))
|
|
2181
2186
|
sa.whitespace_split = True
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import ast
|
|
2
|
-
import builtins
|
|
3
2
|
import linecache
|
|
4
3
|
import logging
|
|
5
4
|
import re
|
|
@@ -424,22 +423,29 @@ def array_type(types):
|
|
|
424
423
|
return _f
|
|
425
424
|
|
|
426
425
|
|
|
427
|
-
def sql_unescape(x, what=""):
|
|
426
|
+
def sql_unescape(x: str, what: str = "") -> Expression:
|
|
428
427
|
"""
|
|
429
428
|
unescapes specific characters in a string. It allows to allow some
|
|
430
429
|
special characters to be used, for example in like condictionals
|
|
431
430
|
|
|
432
431
|
{{sql_unescape(String(like_filter), '%')}}
|
|
433
432
|
|
|
433
|
+
`what` must be given and must not contain quotes or backslashes: unescaping
|
|
434
|
+
those would let the caller close the string literal, so they stay escaped.
|
|
434
435
|
|
|
435
436
|
>>> sql_unescape('testing%', '%')
|
|
436
437
|
"'testing%'"
|
|
437
438
|
>>> sql_unescape('testing%', '$')
|
|
438
439
|
"'testing\\\\%'"
|
|
439
440
|
>>> sql_unescape('testing"')
|
|
440
|
-
'\\'testing"\\''
|
|
441
|
+
'\\'testing\\\\"\\''
|
|
442
|
+
>>> sql_unescape("x' OR 1=1", "'")
|
|
443
|
+
"'x\\\\' OR 1=1'"
|
|
441
444
|
"""
|
|
442
|
-
|
|
445
|
+
escaped = sqlescape_for_string_expression(x)
|
|
446
|
+
if what and not any(c in what for c in "'\"\\"):
|
|
447
|
+
escaped = escaped.replace(f"\\{what}", what)
|
|
448
|
+
return Expression("'" + escaped + "'")
|
|
443
449
|
|
|
444
450
|
|
|
445
451
|
def split_to_array(x, default="", separator: str = ","):
|
|
@@ -1336,8 +1342,10 @@ sqlescape_for_string_expression = sqlescape_generator(
|
|
|
1336
1342
|
)
|
|
1337
1343
|
|
|
1338
1344
|
|
|
1339
|
-
def escape_single_quote_str(s):
|
|
1340
|
-
|
|
1345
|
+
def escape_single_quote_str(s: str) -> str:
|
|
1346
|
+
# ClickHouse string literals treat backslash as an escape char, so it must be doubled too:
|
|
1347
|
+
# otherwise a trailing backslash escapes the closing quote and the following input becomes SQL
|
|
1348
|
+
return "'" + s.replace("\\", "\\\\").replace("'", "''") + "'"
|
|
1341
1349
|
|
|
1342
1350
|
|
|
1343
1351
|
def expression_wrapper(x, name, escape_arrays: bool = False):
|
|
@@ -1388,13 +1396,14 @@ _namespace = {
|
|
|
1388
1396
|
}
|
|
1389
1397
|
|
|
1390
1398
|
|
|
1391
|
-
|
|
1399
|
+
# Built from the builtins templates can actually resolve: names missing from SAFE_BUILTINS (`type`, `dir`,
|
|
1400
|
+
# `property`, `object`, ...) can only be template parameters, so they must be discovered as such to get a
|
|
1401
|
+
# value (None or a test-mode placeholder) instead of raising NameError.
|
|
1402
|
+
reserved_vars = {"_tt_tmp", "_tt_append", "isinstance", "str", "error", "custom_error", *SAFE_BUILTINS}
|
|
1392
1403
|
for p in DEFAULT_PARAM_NAMES: # we handle these in an specific manner
|
|
1393
1404
|
reserved_vars.discard(p) # `format` is part of builtins
|
|
1394
|
-
# Allow 'id'
|
|
1405
|
+
# Allow 'id' as a template parameter name despite being a builtin - https://gitlab.com/tinybird/analytics/-/issues/19119
|
|
1395
1406
|
reserved_vars.discard("id")
|
|
1396
|
-
reserved_vars.discard("type")
|
|
1397
|
-
reserved_vars.discard("dir")
|
|
1398
1407
|
error_vars = ["error", "custom_error"]
|
|
1399
1408
|
|
|
1400
1409
|
|
|
@@ -1470,8 +1479,8 @@ def generate(self, **kwargs) -> Tuple[str, TemplateExecutionResults]:
|
|
|
1470
1479
|
return Expression(f"-- disable {feature}\n")
|
|
1471
1480
|
|
|
1472
1481
|
namespace.update(_namespace)
|
|
1473
|
-
# Default
|
|
1474
|
-
namespace.update({"id": None
|
|
1482
|
+
# Default it here, not in _namespace, so it stays visible to variable extraction.
|
|
1483
|
+
namespace.update({"id": None})
|
|
1475
1484
|
namespace.update(kwargs)
|
|
1476
1485
|
namespace.update(
|
|
1477
1486
|
{
|
|
@@ -1820,7 +1829,7 @@ def get_var_names(t: Template):
|
|
|
1820
1829
|
>>> [v['name'] for v in get_var_names(Template("{% for name in secret_names %}{{tb_secret(name)}}{% end %}"))]
|
|
1821
1830
|
['secret_names', 'name', 'tb_secret', 'name']
|
|
1822
1831
|
|
|
1823
|
-
Type casting with date function in elif chain
|
|
1832
|
+
Type casting with date function in elif chain:
|
|
1824
1833
|
>>> t = Template("{% if kind == 'int' %}{{Int32(val, 0)}}{% elif kind == 'date' %}{{DateTime(val)}}{% elif kind == 'diff' %}{{date_diff_in_days(val, now)}}{% end %}")
|
|
1825
1834
|
>>> [v['name'] for v in get_var_names(t)]
|
|
1826
1835
|
['kind', 'Int32', 'val', 'kind', 'DateTime', 'val', 'kind', 'date_diff_in_days', 'val', 'now']
|
|
@@ -2372,7 +2381,24 @@ def wrap_vars(t, escape_arrays: bool = False):
|
|
|
2372
2381
|
return var
|
|
2373
2382
|
|
|
2374
2383
|
|
|
2375
|
-
def
|
|
2384
|
+
def _constant_table_name(node: ast.expr) -> Optional[str]:
|
|
2385
|
+
"""Value of a constant table() argument: a literal or a concatenation of string literals."""
|
|
2386
|
+
if isinstance(node, ast.Constant) and isinstance(node.value, (int, float)):
|
|
2387
|
+
return str(node.value)
|
|
2388
|
+
return _string_literal(node)
|
|
2389
|
+
|
|
2390
|
+
|
|
2391
|
+
def _string_literal(node: ast.expr) -> Optional[str]:
|
|
2392
|
+
if isinstance(node, ast.Constant) and isinstance(node.value, str):
|
|
2393
|
+
return node.value
|
|
2394
|
+
if isinstance(node, ast.BinOp) and isinstance(node.op, ast.Add):
|
|
2395
|
+
left, right = _string_literal(node.left), _string_literal(node.right)
|
|
2396
|
+
if left is not None and right is not None:
|
|
2397
|
+
return left + right
|
|
2398
|
+
return None
|
|
2399
|
+
|
|
2400
|
+
|
|
2401
|
+
def get_used_tables_in_template(sql: str) -> List[str]:
|
|
2376
2402
|
"""
|
|
2377
2403
|
>>> get_used_tables_in_template("select * from {{table('test')}}")
|
|
2378
2404
|
['test']
|
|
@@ -2386,30 +2412,42 @@ def get_used_tables_in_template(sql):
|
|
|
2386
2412
|
[]
|
|
2387
2413
|
>>> get_used_tables_in_template("select * from {{table('my.test')}}, {{table('another.one')}}")
|
|
2388
2414
|
['my.test', 'another.one']
|
|
2415
|
+
|
|
2416
|
+
Only constant table names can be known without rendering, so anything else is skipped
|
|
2417
|
+
>>> get_used_tables_in_template("select * from {{table(tbl)}}, {{TABLE('b')}}, {{table('my.' + 'c')}}")
|
|
2418
|
+
['b', 'my.c']
|
|
2389
2419
|
"""
|
|
2420
|
+
return list(_get_used_tables_in_template_cached(sql))
|
|
2421
|
+
|
|
2422
|
+
|
|
2423
|
+
# Building the Template dominates the cost and the result only depends on the SQL, which deployments and
|
|
2424
|
+
# /v0/sql pipelines scan repeatedly
|
|
2425
|
+
@lru_cache(maxsize=2**10)
|
|
2426
|
+
def _get_used_tables_in_template_cached(sql: str) -> Tuple[str, ...]:
|
|
2390
2427
|
try:
|
|
2391
2428
|
t = Template(sql)
|
|
2392
2429
|
|
|
2393
2430
|
def _n(chunks, tables):
|
|
2394
2431
|
for x in chunks:
|
|
2395
2432
|
if type(x).__name__ == "_Expression":
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2433
|
+
# Read the names from the AST instead of executing the expression: this runs outside
|
|
2434
|
+
# generate(), without the restricted builtins, on every pipe, query and deployment.
|
|
2435
|
+
for node in ast.walk(ast.parse(x.expression)):
|
|
2436
|
+
if (
|
|
2437
|
+
isinstance(node, ast.Call)
|
|
2438
|
+
and isinstance(node.func, ast.Name)
|
|
2439
|
+
and node.func.id in ("table", "TABLE")
|
|
2440
|
+
and node.args
|
|
2441
|
+
):
|
|
2442
|
+
name = _constant_table_name(node.args[0])
|
|
2443
|
+
if name is not None:
|
|
2444
|
+
tables.append(name)
|
|
2407
2445
|
elif type(x).__name__ == "_ControlBlock":
|
|
2408
2446
|
_n(x.body.chunks, tables)
|
|
2409
2447
|
|
|
2410
|
-
tables = []
|
|
2448
|
+
tables: List[str] = []
|
|
2411
2449
|
_n(t.file.body.chunks, tables)
|
|
2412
|
-
return tables
|
|
2450
|
+
return tuple(tables)
|
|
2413
2451
|
except SecurityException as e:
|
|
2414
2452
|
raise SQLTemplateException(e)
|
|
2415
2453
|
|
|
@@ -214,8 +214,8 @@ class TinybirdDialect(ClickHouse):
|
|
|
214
214
|
],
|
|
215
215
|
}
|
|
216
216
|
|
|
217
|
-
for section in override_rules:
|
|
218
|
-
for rule in
|
|
217
|
+
for section, rules in override_rules.items():
|
|
218
|
+
for rule in rules:
|
|
219
219
|
for rr in self.RULES[section]:
|
|
220
220
|
if rr.name == rule.name:
|
|
221
221
|
self.RULES[section].remove(rr)
|
|
@@ -487,7 +487,7 @@ def replacements_to_tuples(replacements: dict) -> dict:
|
|
|
487
487
|
return parsed_replacements
|
|
488
488
|
|
|
489
489
|
|
|
490
|
-
@lru_cache(maxsize=2**
|
|
490
|
+
@lru_cache(maxsize=2**13)
|
|
491
491
|
def replace_tables_chquery_cached(
|
|
492
492
|
sql: str,
|
|
493
493
|
sorted_replacements: Optional[tuple] = None,
|
|
@@ -260,49 +260,6 @@ def _iscoroutinefunction_or_partial(func: Any) -> bool:
|
|
|
260
260
|
return asyncio.iscoroutinefunction(func)
|
|
261
261
|
|
|
262
262
|
|
|
263
|
-
class ThreadSensitiveContext:
|
|
264
|
-
"""Async context manager to manage context for thread sensitive mode
|
|
265
|
-
This context manager controls which thread pool executor is used when in
|
|
266
|
-
thread sensitive mode. By default, a single thread pool executor is shared
|
|
267
|
-
within a process.
|
|
268
|
-
In Python 3.7+, the ThreadSensitiveContext() context manager may be used to
|
|
269
|
-
specify a thread pool per context.
|
|
270
|
-
In Python 3.6, usage of this context manager has no effect.
|
|
271
|
-
This context manager is re-entrant, so only the outer-most call to
|
|
272
|
-
ThreadSensitiveContext will set the context.
|
|
273
|
-
"""
|
|
274
|
-
|
|
275
|
-
def __init__(self):
|
|
276
|
-
self.token = None
|
|
277
|
-
|
|
278
|
-
if contextvars:
|
|
279
|
-
|
|
280
|
-
async def __aenter__(self):
|
|
281
|
-
try:
|
|
282
|
-
SyncToAsync.thread_sensitive_context.get()
|
|
283
|
-
except LookupError:
|
|
284
|
-
self.token = SyncToAsync.thread_sensitive_context.set(self)
|
|
285
|
-
|
|
286
|
-
return self
|
|
287
|
-
|
|
288
|
-
async def __aexit__(self, exc, value, tb):
|
|
289
|
-
if not self.token:
|
|
290
|
-
return
|
|
291
|
-
|
|
292
|
-
executor = SyncToAsync.context_to_thread_executor.pop(self, None)
|
|
293
|
-
if executor:
|
|
294
|
-
executor.shutdown()
|
|
295
|
-
SyncToAsync.thread_sensitive_context.reset(self.token)
|
|
296
|
-
|
|
297
|
-
else:
|
|
298
|
-
|
|
299
|
-
async def __aenter__(self):
|
|
300
|
-
return self
|
|
301
|
-
|
|
302
|
-
async def __aexit__(self, exc, value, tb):
|
|
303
|
-
pass
|
|
304
|
-
|
|
305
|
-
|
|
306
263
|
class AsyncToSync:
|
|
307
264
|
"""
|
|
308
265
|
Utility class which turns an awaitable that only works on the thread with
|
|
@@ -4,5 +4,5 @@ __description__ = 'Tinybird Command Line Tool'
|
|
|
4
4
|
__url__ = 'https://www.tinybird.co/docs/forward/commands'
|
|
5
5
|
__author__ = 'Tinybird'
|
|
6
6
|
__author_email__ = 'support@tinybird.co'
|
|
7
|
-
__version__ = '4.6.
|
|
8
|
-
__revision__ = '
|
|
7
|
+
__version__ = '4.6.25.dev0'
|
|
8
|
+
__revision__ = '57adbc63'
|