tinybird 4.6.22.dev0__tar.gz → 4.6.23__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.22.dev0 → tinybird-4.6.23}/PKG-INFO +11 -1
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/pyproject.toml +50 -43
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/ch_utils/engine.py +28 -9
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/client.py +3 -20
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/datafile/common.py +8 -3
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/sql_template.py +64 -28
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/sql_template_fmt.py +2 -2
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/sql_toolset.py +1 -1
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/syncasync.py +0 -43
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/tb/__cli__.py +2 -2
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/tb/client.py +3 -20
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/tb/modules/common.py +3 -3
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/tb/modules/create.py +2 -4
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/tb/modules/datafile/pull.py +73 -3
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/tb/modules/datasource.py +1 -1
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/tb/modules/deployment_common.py +4 -6
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/tb/modules/exceptions.py +0 -21
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/tb_cli_modules/branch.py +3 -23
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/tb_cli_modules/common.py +3 -3
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/tb_cli_modules/datasource.py +1 -1
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/tornado_template.py +38 -93
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird.egg-info/PKG-INFO +11 -1
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/setup.cfg +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/__cli__.py +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/ch_utils/constants.py +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/check_pypi.py +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/config.py +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/context.py +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/datafile/exceptions.py +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/datafile/parse_connection.py +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/datafile/parse_datasource.py +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/datafile/parse_pipe.py +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/datatypes.py +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/feedback_manager.py +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/git_settings.py +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/iterating/__init__.py +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/iterating/data_branch_modes.py +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/prompts.py +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/service_datasources.py +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/sql.py +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/tb/check_pypi.py +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/tb/cli.py +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/tb/config.py +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/tb/modules/branch.py +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/tb/modules/build.py +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/tb/modules/build_common.py +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/tb/modules/cicd.py +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/tb/modules/cli.py +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/tb/modules/config.py +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/tb/modules/connection.py +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/tb/modules/connection_dynamodb.py +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/tb/modules/connection_kafka.py +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/tb/modules/connection_s3.py +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/tb/modules/copy.py +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/tb/modules/datafile/build.py +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/tb/modules/datafile/build_common.py +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/tb/modules/datafile/build_datasource.py +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/tb/modules/datafile/build_pipe.py +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/tb/modules/datafile/diff.py +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/tb/modules/datafile/fixture.py +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/tb/modules/datafile/format_common.py +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/tb/modules/datafile/format_connection.py +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/tb/modules/datafile/format_datasource.py +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/tb/modules/datafile/format_pipe.py +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/tb/modules/datafile/pipe_checker.py +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/tb/modules/datafile/playground.py +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/tb/modules/deployment.py +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/tb/modules/deprecations.py +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/tb/modules/endpoint.py +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/tb/modules/feedback_manager.py +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/tb/modules/fmt.py +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/tb/modules/info.py +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/tb/modules/infra.py +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/tb/modules/job.py +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/tb/modules/job_common.py +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/tb/modules/llm.py +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/tb/modules/llm_utils.py +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/tb/modules/local.py +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/tb/modules/local_common.py +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/tb/modules/local_logs.py +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/tb/modules/login.py +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/tb/modules/login_common.py +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/tb/modules/logout.py +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/tb/modules/logs.py +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/tb/modules/materialization.py +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/tb/modules/open.py +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/tb/modules/pipe.py +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/tb/modules/preview.py +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/tb/modules/project.py +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/tb/modules/project_commands.py +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/tb/modules/py_project.py +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/tb/modules/query_output.py +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/tb/modules/regions.py +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/tb/modules/secret.py +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/tb/modules/secret_common.py +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/tb/modules/sink.py +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/tb/modules/table.py +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/tb/modules/telemetry.py +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/tb/modules/test.py +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/tb/modules/test_common.py +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/tb/modules/tinyunit/tinyunit.py +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/tb/modules/token.py +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/tb/modules/ts_project.py +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/tb/modules/watch.py +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/tb/modules/workspace.py +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/tb/modules/workspace_members.py +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/tb_cli.py +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/tb_cli_modules/auth.py +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/tb_cli_modules/cicd.py +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/tb_cli_modules/cli.py +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/tb_cli_modules/config.py +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/tb_cli_modules/connection.py +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/tb_cli_modules/exceptions.py +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/tb_cli_modules/fmt.py +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/tb_cli_modules/job.py +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/tb_cli_modules/pipe.py +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/tb_cli_modules/regions.py +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/tb_cli_modules/tag.py +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/tb_cli_modules/telemetry.py +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/tb_cli_modules/test.py +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/tb_cli_modules/tinyunit/tinyunit.py +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/tb_cli_modules/workspace.py +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/tb_cli_modules/workspace_members.py +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/utils/__init__.py +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird/utils/bools.py +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird.egg-info/SOURCES.txt +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird.egg-info/dependency_links.txt +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird.egg-info/entry_points.txt +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/tinybird.egg-info/requires.txt +0 -0
- {tinybird-4.6.22.dev0 → tinybird-4.6.23}/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.23
|
|
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,16 @@ 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
|
+
|
|
60
|
+
4.6.21
|
|
61
|
+
********
|
|
62
|
+
|
|
63
|
+
- `Fixed` ``tb deployment discard`` now discards the deployment that is not live, instead of assuming the live deployment is listed first. Previously, if removing the old deployment failed after a promotion, the command refused to discard it.
|
|
64
|
+
|
|
55
65
|
4.6.20
|
|
56
66
|
********
|
|
57
67
|
|
|
@@ -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,34 +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
|
+
"async-lru==2.3.0",
|
|
25
26
|
"aws-msk-iam-sasl-signer-python==1.0.2",
|
|
26
|
-
"cachetools
|
|
27
|
-
"cffi
|
|
27
|
+
"cachetools~=6.0",
|
|
28
|
+
"cffi~=2.0",
|
|
28
29
|
"chardet==4.0.0",
|
|
29
30
|
"ciso8601==2.2.0",
|
|
30
|
-
"click
|
|
31
|
+
"click~=8.5",
|
|
31
32
|
"clickhouse-cityhash==1.0.2.5",
|
|
32
33
|
"clickhouse-driver==0.2.9",
|
|
33
34
|
"confluent-kafka[avro,json,schemaregistry]==2.12.2",
|
|
34
35
|
"contextvars==2.4",
|
|
35
36
|
"cramjam==2.11.0",
|
|
36
37
|
"croniter==6.2.2",
|
|
37
|
-
"cryptography
|
|
38
|
+
"cryptography~=50.0",
|
|
38
39
|
"datasketch==1.6.5",
|
|
39
40
|
"dnspython==2.8.0",
|
|
40
41
|
"docker==7.1.0",
|
|
41
42
|
"fastavro==1.12.2",
|
|
42
43
|
"fastmcp==2.12.2",
|
|
43
|
-
"google-cloud-aiplatform
|
|
44
|
+
"google-cloud-aiplatform~=1.148",
|
|
44
45
|
"google-cloud-compute==1.48.0",
|
|
45
46
|
"google-cloud-scheduler==2.20.0",
|
|
46
47
|
"google-cloud-secret-manager==2.29.0",
|
|
47
|
-
"google-cloud-storage
|
|
48
|
-
"google_api_core
|
|
48
|
+
"google-cloud-storage~=3.4",
|
|
49
|
+
"google_api_core~=2.25",
|
|
49
50
|
"googleapis_common_protos==1.66.0",
|
|
50
51
|
"grpcio_status==1.67.1",
|
|
51
52
|
"humanfriendly==10.0",
|
|
@@ -53,22 +54,22 @@ dependencies = [
|
|
|
53
54
|
"jinja2",
|
|
54
55
|
"jsondiff==2.2.1",
|
|
55
56
|
"jsonschema==4.23.0",
|
|
56
|
-
"litellm
|
|
57
|
+
"litellm~=1.97",
|
|
57
58
|
"logfire-api==4.2.0",
|
|
58
59
|
"lru-dict==1.3.0",
|
|
59
60
|
"lz4==4.4.5",
|
|
60
61
|
"memray==1.20.0",
|
|
61
62
|
"msgspec==0.21.1",
|
|
62
|
-
"multidict==6.
|
|
63
|
+
"multidict==6.9.1",
|
|
63
64
|
"networkx==3.4.2",
|
|
64
65
|
"numpy==1.26.4",
|
|
65
66
|
"objgraph==3.6.2",
|
|
66
|
-
"opentelemetry-api
|
|
67
|
-
"opentelemetry-exporter-otlp-proto-http
|
|
68
|
-
"opentelemetry-sdk
|
|
69
|
-
"orb-billing==
|
|
70
|
-
"orjson==3.11.
|
|
71
|
-
"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",
|
|
72
73
|
"passlib==1.7.1",
|
|
73
74
|
"posthog==7.28.0",
|
|
74
75
|
"pre-commit==4.6.2",
|
|
@@ -82,10 +83,10 @@ dependencies = [
|
|
|
82
83
|
"py-spy==0.4.2",
|
|
83
84
|
"pyarrow==23.0.1",
|
|
84
85
|
"pycurl==7.45.7",
|
|
85
|
-
"pydantic-ai-slim[anthropic]
|
|
86
|
-
"pydantic-ai-slim[google]
|
|
87
|
-
"pydantic-ai-slim[retries]
|
|
88
|
-
"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",
|
|
89
90
|
"pyjwt[crypto]==2.9.0",
|
|
90
91
|
"pympler==1.1",
|
|
91
92
|
"pynacl==1.5.0",
|
|
@@ -93,10 +94,10 @@ dependencies = [
|
|
|
93
94
|
"python-dateutil==2.9.0.post0",
|
|
94
95
|
"python-dotenv==1.1.0",
|
|
95
96
|
"python-ulid==2.7.0",
|
|
96
|
-
"pyyaml
|
|
97
|
+
"pyyaml~=6.0",
|
|
97
98
|
"redis[hiredis]==5.3.1",
|
|
98
|
-
"requests
|
|
99
|
-
"sentry-sdk==2.69.
|
|
99
|
+
"requests~=2.32.5",
|
|
100
|
+
"sentry-sdk==2.69.2",
|
|
100
101
|
"setproctitle==1.3.3",
|
|
101
102
|
"shandy-sqlfmt==0.11.1",
|
|
102
103
|
"shandy-sqlfmt[jinjafmt]==0.11.1",
|
|
@@ -107,11 +108,11 @@ dependencies = [
|
|
|
107
108
|
"tabulate==0.8.10",
|
|
108
109
|
"thefuzz==0.22.1",
|
|
109
110
|
"tinybird-python-sdk[ai]==0.3.7",
|
|
110
|
-
"tinybird-toolset==2.
|
|
111
|
+
"tinybird-toolset==2.7.1",
|
|
111
112
|
"toposort==1.10",
|
|
112
113
|
"tornado==6.5.5",
|
|
113
|
-
"urllib3
|
|
114
|
-
"uvicorn[standard]
|
|
114
|
+
"urllib3~=2.8",
|
|
115
|
+
"uvicorn[standard]~=0.53.0",
|
|
115
116
|
"virtualenv==20.21.1",
|
|
116
117
|
"watchdog==6.0.0",
|
|
117
118
|
"wheel==0.37.1",
|
|
@@ -124,12 +125,12 @@ deploy = [
|
|
|
124
125
|
"GitPython==3.1.44",
|
|
125
126
|
"ansible==8.5.0",
|
|
126
127
|
"ara==1.6.1",
|
|
127
|
-
"boto3
|
|
128
|
+
"boto3~=1.40",
|
|
128
129
|
"fabric==3.2.2",
|
|
129
|
-
"google-auth
|
|
130
|
+
"google-auth~=2.47",
|
|
130
131
|
"jsonnet",
|
|
131
132
|
"prettytable==3.8.0",
|
|
132
|
-
"requests
|
|
133
|
+
"requests~=2.32.5",
|
|
133
134
|
"requests[security]",
|
|
134
135
|
"xmltodict",
|
|
135
136
|
]
|
|
@@ -141,7 +142,7 @@ devtools = [
|
|
|
141
142
|
]
|
|
142
143
|
doc = [
|
|
143
144
|
"Pallets-Sphinx-Themes==2.3.0",
|
|
144
|
-
"pyOpenSSL
|
|
145
|
+
"pyOpenSSL~=26.4",
|
|
145
146
|
"sphinx-autobuild==2024.2.4",
|
|
146
147
|
"sphinx-sitemap",
|
|
147
148
|
"sphinx==7.3.7",
|
|
@@ -149,15 +150,16 @@ doc = [
|
|
|
149
150
|
"sphinxcontrib-jquery==4.1",
|
|
150
151
|
]
|
|
151
152
|
lint = [
|
|
152
|
-
"botocore-stubs
|
|
153
|
-
"
|
|
153
|
+
"botocore-stubs~=1.40",
|
|
154
|
+
"celery-types~=0.20.0",
|
|
155
|
+
"flake8~=7.4",
|
|
154
156
|
"flake8-async~=26.8",
|
|
155
157
|
"mypy==2.3.1",
|
|
156
|
-
"ruff==0.16.
|
|
158
|
+
"ruff==0.16.10",
|
|
157
159
|
"types-Markdown",
|
|
158
160
|
"types-PyYAML",
|
|
159
161
|
"types-aiofiles==24.1.0.20241221",
|
|
160
|
-
"types-boto3-lite
|
|
162
|
+
"types-boto3-lite~=1.40",
|
|
161
163
|
"types-cachetools",
|
|
162
164
|
"types-chardet",
|
|
163
165
|
"types-paramiko",
|
|
@@ -169,20 +171,21 @@ lint = [
|
|
|
169
171
|
"types_croniter",
|
|
170
172
|
]
|
|
171
173
|
test = [
|
|
172
|
-
"coverage
|
|
174
|
+
"coverage~=7.16",
|
|
173
175
|
"freezegun==1.5.5",
|
|
174
|
-
"google-auth
|
|
176
|
+
"google-auth~=2.47",
|
|
175
177
|
"gsutil==4.58",
|
|
176
|
-
"
|
|
178
|
+
"httpx2~=2.13",
|
|
179
|
+
"hypothesis==6.156.9",
|
|
177
180
|
"oauth2client==3.0.0",
|
|
178
181
|
"py==1.11.0",
|
|
179
|
-
"pytest-asyncio
|
|
180
|
-
"pytest-cov
|
|
182
|
+
"pytest-asyncio~=1.4",
|
|
183
|
+
"pytest-cov~=7.0",
|
|
181
184
|
"pytest-env==1.1.3",
|
|
182
185
|
"pytest-flakefinder==1.1.0",
|
|
183
186
|
"pytest-timeout==2.3.1",
|
|
184
187
|
"pytest-xdist==3.6.1",
|
|
185
|
-
"pytest
|
|
188
|
+
"pytest~=8.1",
|
|
186
189
|
"rangehttpserver==1.4.0",
|
|
187
190
|
"yappi==1.7.6",
|
|
188
191
|
]
|
|
@@ -203,7 +206,11 @@ colibri = "tinybird.colibri.cli:cli"
|
|
|
203
206
|
[tool.uv.workspace]
|
|
204
207
|
members = [
|
|
205
208
|
"chbackups",
|
|
209
|
+
"clickhouse",
|
|
206
210
|
"data_connector",
|
|
211
|
+
"gatherer",
|
|
212
|
+
"platform-api",
|
|
213
|
+
"tinybird_orchestrator",
|
|
207
214
|
]
|
|
208
215
|
|
|
209
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):
|
|
@@ -1385,16 +1393,16 @@ _namespace = {
|
|
|
1385
1393
|
"close": None,
|
|
1386
1394
|
"print": None,
|
|
1387
1395
|
"input": None,
|
|
1388
|
-
# Keep customer parameters named `type`/`dir` usable without restoring the unsafe builtins.
|
|
1389
|
-
"type": None,
|
|
1390
|
-
"dir": None,
|
|
1391
1396
|
}
|
|
1392
1397
|
|
|
1393
1398
|
|
|
1394
|
-
|
|
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}
|
|
1395
1403
|
for p in DEFAULT_PARAM_NAMES: # we handle these in an specific manner
|
|
1396
1404
|
reserved_vars.discard(p) # `format` is part of builtins
|
|
1397
|
-
# Allow 'id'
|
|
1405
|
+
# Allow 'id' as a template parameter name despite being a builtin - https://gitlab.com/tinybird/analytics/-/issues/19119
|
|
1398
1406
|
reserved_vars.discard("id")
|
|
1399
1407
|
error_vars = ["error", "custom_error"]
|
|
1400
1408
|
|
|
@@ -1471,8 +1479,7 @@ def generate(self, **kwargs) -> Tuple[str, TemplateExecutionResults]:
|
|
|
1471
1479
|
return Expression(f"-- disable {feature}\n")
|
|
1472
1480
|
|
|
1473
1481
|
namespace.update(_namespace)
|
|
1474
|
-
#
|
|
1475
|
-
# We need to do the override here because if we modify the _namespace, we would filter out parameters from the users
|
|
1482
|
+
# Default it here, not in _namespace, so it stays visible to variable extraction.
|
|
1476
1483
|
namespace.update({"id": None})
|
|
1477
1484
|
namespace.update(kwargs)
|
|
1478
1485
|
namespace.update(
|
|
@@ -1822,7 +1829,7 @@ def get_var_names(t: Template):
|
|
|
1822
1829
|
>>> [v['name'] for v in get_var_names(Template("{% for name in secret_names %}{{tb_secret(name)}}{% end %}"))]
|
|
1823
1830
|
['secret_names', 'name', 'tb_secret', 'name']
|
|
1824
1831
|
|
|
1825
|
-
Type casting with date function in elif chain
|
|
1832
|
+
Type casting with date function in elif chain:
|
|
1826
1833
|
>>> t = Template("{% if kind == 'int' %}{{Int32(val, 0)}}{% elif kind == 'date' %}{{DateTime(val)}}{% elif kind == 'diff' %}{{date_diff_in_days(val, now)}}{% end %}")
|
|
1827
1834
|
>>> [v['name'] for v in get_var_names(t)]
|
|
1828
1835
|
['kind', 'Int32', 'val', 'kind', 'DateTime', 'val', 'kind', 'date_diff_in_days', 'val', 'now']
|
|
@@ -2374,7 +2381,24 @@ def wrap_vars(t, escape_arrays: bool = False):
|
|
|
2374
2381
|
return var
|
|
2375
2382
|
|
|
2376
2383
|
|
|
2377
|
-
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]:
|
|
2378
2402
|
"""
|
|
2379
2403
|
>>> get_used_tables_in_template("select * from {{table('test')}}")
|
|
2380
2404
|
['test']
|
|
@@ -2388,30 +2412,42 @@ def get_used_tables_in_template(sql):
|
|
|
2388
2412
|
[]
|
|
2389
2413
|
>>> get_used_tables_in_template("select * from {{table('my.test')}}, {{table('another.one')}}")
|
|
2390
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']
|
|
2391
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, ...]:
|
|
2392
2427
|
try:
|
|
2393
2428
|
t = Template(sql)
|
|
2394
2429
|
|
|
2395
2430
|
def _n(chunks, tables):
|
|
2396
2431
|
for x in chunks:
|
|
2397
2432
|
if type(x).__name__ == "_Expression":
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
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)
|
|
2409
2445
|
elif type(x).__name__ == "_ControlBlock":
|
|
2410
2446
|
_n(x.body.chunks, tables)
|
|
2411
2447
|
|
|
2412
|
-
tables = []
|
|
2448
|
+
tables: List[str] = []
|
|
2413
2449
|
_n(t.file.body.chunks, tables)
|
|
2414
|
-
return tables
|
|
2450
|
+
return tuple(tables)
|
|
2415
2451
|
except SecurityException as e:
|
|
2416
2452
|
raise SQLTemplateException(e)
|
|
2417
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.23'
|
|
8
|
+
__revision__ = '57adbc63'
|