tinybird 0.0.1.dev108__tar.gz → 0.0.1.dev110__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.
Potentially problematic release.
This version of tinybird might be problematic. Click here for more details.
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/PKG-INFO +1 -1
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/sql.py +44 -1
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/tb/__cli__.py +2 -2
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/tb/modules/cicd.py +3 -3
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/tb/modules/datafile/common.py +15 -0
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/tb/modules/local.py +55 -9
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/tb/modules/login.py +5 -2
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird.egg-info/PKG-INFO +1 -1
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/setup.cfg +0 -0
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/__cli__.py +0 -0
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/ch_utils/constants.py +0 -0
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/ch_utils/engine.py +0 -0
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/check_pypi.py +0 -0
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/client.py +0 -0
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/config.py +0 -0
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/connectors.py +0 -0
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/context.py +0 -0
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/datafile.py +0 -0
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/datatypes.py +0 -0
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/feedback_manager.py +0 -0
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/git_settings.py +0 -0
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/prompts.py +0 -0
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/sql_template.py +0 -0
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/sql_template_fmt.py +0 -0
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/sql_toolset.py +0 -0
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/syncasync.py +0 -0
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/tb/cli.py +0 -0
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/tb/modules/auth.py +0 -0
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/tb/modules/build.py +0 -0
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/tb/modules/cli.py +0 -0
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/tb/modules/common.py +0 -0
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/tb/modules/config.py +0 -0
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/tb/modules/connection.py +0 -0
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/tb/modules/copy.py +0 -0
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/tb/modules/create.py +0 -0
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/tb/modules/datafile/build.py +0 -0
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/tb/modules/datafile/build_common.py +0 -0
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/tb/modules/datafile/build_datasource.py +0 -0
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/tb/modules/datafile/build_pipe.py +0 -0
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/tb/modules/datafile/diff.py +0 -0
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/tb/modules/datafile/exceptions.py +0 -0
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/tb/modules/datafile/fixture.py +0 -0
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/tb/modules/datafile/format_common.py +0 -0
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/tb/modules/datafile/format_datasource.py +0 -0
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/tb/modules/datafile/format_pipe.py +0 -0
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/tb/modules/datafile/parse_datasource.py +0 -0
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/tb/modules/datafile/parse_pipe.py +0 -0
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/tb/modules/datafile/pipe_checker.py +0 -0
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/tb/modules/datafile/playground.py +0 -0
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/tb/modules/datafile/pull.py +0 -0
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/tb/modules/datasource.py +0 -0
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/tb/modules/deployment.py +0 -0
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/tb/modules/endpoint.py +0 -0
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/tb/modules/exceptions.py +0 -0
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/tb/modules/feedback_manager.py +0 -0
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/tb/modules/fmt.py +0 -0
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/tb/modules/infra.py +0 -0
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/tb/modules/job.py +0 -0
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/tb/modules/llm.py +0 -0
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/tb/modules/llm_utils.py +0 -0
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/tb/modules/local_common.py +0 -0
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/tb/modules/logout.py +0 -0
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/tb/modules/materialization.py +0 -0
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/tb/modules/mock.py +0 -0
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/tb/modules/open.py +0 -0
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/tb/modules/pipe.py +0 -0
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/tb/modules/playground.py +0 -0
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/tb/modules/project.py +0 -0
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/tb/modules/regions.py +0 -0
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/tb/modules/secret.py +0 -0
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/tb/modules/shell.py +0 -0
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/tb/modules/table.py +0 -0
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/tb/modules/tag.py +0 -0
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/tb/modules/telemetry.py +0 -0
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/tb/modules/test.py +0 -0
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/tb/modules/tinyunit/tinyunit.py +0 -0
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/tb/modules/tinyunit/tinyunit_lib.py +0 -0
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/tb/modules/token.py +0 -0
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/tb/modules/watch.py +0 -0
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/tb/modules/workspace.py +0 -0
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/tb/modules/workspace_members.py +0 -0
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/tb_cli.py +0 -0
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/tb_cli_modules/auth.py +0 -0
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/tb_cli_modules/branch.py +0 -0
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/tb_cli_modules/cicd.py +0 -0
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/tb_cli_modules/cli.py +0 -0
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/tb_cli_modules/common.py +0 -0
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/tb_cli_modules/config.py +0 -0
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/tb_cli_modules/connection.py +0 -0
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/tb_cli_modules/datasource.py +0 -0
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/tb_cli_modules/exceptions.py +0 -0
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/tb_cli_modules/fmt.py +0 -0
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/tb_cli_modules/job.py +0 -0
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/tb_cli_modules/pipe.py +0 -0
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/tb_cli_modules/regions.py +0 -0
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/tb_cli_modules/tag.py +0 -0
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/tb_cli_modules/telemetry.py +0 -0
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/tb_cli_modules/test.py +0 -0
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/tb_cli_modules/tinyunit/tinyunit.py +0 -0
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/tb_cli_modules/tinyunit/tinyunit_lib.py +0 -0
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/tb_cli_modules/workspace.py +0 -0
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/tb_cli_modules/workspace_members.py +0 -0
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/tornado_template.py +0 -0
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird.egg-info/SOURCES.txt +0 -0
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird.egg-info/dependency_links.txt +0 -0
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird.egg-info/entry_points.txt +0 -0
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird.egg-info/requires.txt +0 -0
- {tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird.egg-info/top_level.txt +0 -0
|
@@ -9,6 +9,24 @@ valid_chars_name: str = string.ascii_letters + string.digits + "._`*<>+-'"
|
|
|
9
9
|
valid_chars_fn: str = valid_chars_name + "[](),=!?:/ \n\t\r"
|
|
10
10
|
|
|
11
11
|
INDEX_WHITELIST = ["minmax", "set", "bloom_filter", "ngrambf_v1", "tokenbf_v1"]
|
|
12
|
+
INDEX_SUPPORTED_TYPES = {
|
|
13
|
+
"bloom_filter": [
|
|
14
|
+
"Int*",
|
|
15
|
+
"UInt*",
|
|
16
|
+
"Float*",
|
|
17
|
+
"Enum",
|
|
18
|
+
"Date",
|
|
19
|
+
"DateTime",
|
|
20
|
+
"String",
|
|
21
|
+
"FixedString",
|
|
22
|
+
"Array",
|
|
23
|
+
"LowCardinality",
|
|
24
|
+
"Nullable",
|
|
25
|
+
"UUID",
|
|
26
|
+
"Map",
|
|
27
|
+
],
|
|
28
|
+
"ngrambf_v1": ["String", "FixedString", "Map"],
|
|
29
|
+
}
|
|
12
30
|
|
|
13
31
|
|
|
14
32
|
@dataclass
|
|
@@ -39,12 +57,37 @@ class TableIndex:
|
|
|
39
57
|
def clear_index_sql(self):
|
|
40
58
|
return f"CLEAR INDEX IF EXISTS {self.name}"
|
|
41
59
|
|
|
42
|
-
def
|
|
60
|
+
def _validate_index_type(self, table_structure: List[Dict[str, Any]]):
|
|
61
|
+
for col in table_structure:
|
|
62
|
+
if col["normalized_name"] != self.expr:
|
|
63
|
+
continue
|
|
64
|
+
col_type = col["type"]
|
|
65
|
+
index_supported_types: Optional[str] = next((t for t in INDEX_SUPPORTED_TYPES if t in self.type_full), None)
|
|
66
|
+
|
|
67
|
+
if index_supported_types:
|
|
68
|
+
for supported_type in INDEX_SUPPORTED_TYPES.get(index_supported_types, []):
|
|
69
|
+
# Convert supported type to regex pattern
|
|
70
|
+
# Replace * with \d+ to match any number
|
|
71
|
+
pattern = supported_type.replace("*", r"\d+")
|
|
72
|
+
if re.match(f"^{pattern}$", col_type):
|
|
73
|
+
return
|
|
74
|
+
raise ValueError(
|
|
75
|
+
f"Not allowed data type '{col_type}' for index '{self.type_full}' for column '{self.expr}' "
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
def validate_allowed(self, table_structure: Optional[List[Dict[str, Any]]] = None):
|
|
43
79
|
"""
|
|
44
80
|
Validate at API level not to depend on CLI version
|
|
45
81
|
"""
|
|
46
82
|
if not any(index in self.type_full for index in INDEX_WHITELIST):
|
|
47
83
|
raise ValueError(f"Not allowed index '{self.type_full}'")
|
|
84
|
+
try:
|
|
85
|
+
if table_structure:
|
|
86
|
+
self._validate_index_type(table_structure)
|
|
87
|
+
except ValueError as e:
|
|
88
|
+
raise e
|
|
89
|
+
except Exception:
|
|
90
|
+
logging.exception(f"Error validating index '{self.type_full}' for column '{self.expr}'")
|
|
48
91
|
|
|
49
92
|
|
|
50
93
|
@dataclass
|
|
@@ -4,5 +4,5 @@ __description__ = 'Tinybird Command Line Tool'
|
|
|
4
4
|
__url__ = 'https://www.tinybird.co/docs/cli/introduction.html'
|
|
5
5
|
__author__ = 'Tinybird'
|
|
6
6
|
__author_email__ = 'support@tinybird.co'
|
|
7
|
-
__version__ = '0.0.1.
|
|
8
|
-
__revision__ = '
|
|
7
|
+
__version__ = '0.0.1.dev110'
|
|
8
|
+
__revision__ = '034b6bf'
|
|
@@ -49,7 +49,7 @@ jobs:
|
|
|
49
49
|
steps:
|
|
50
50
|
- uses: actions/checkout@v3
|
|
51
51
|
- name: Install Tinybird CLI
|
|
52
|
-
run: curl
|
|
52
|
+
run: curl https://tinybird.co | sh
|
|
53
53
|
- name: Build project
|
|
54
54
|
run: tb build
|
|
55
55
|
- name: Test project
|
|
@@ -81,7 +81,7 @@ jobs:
|
|
|
81
81
|
steps:
|
|
82
82
|
- uses: actions/checkout@v3
|
|
83
83
|
- name: Install Tinybird CLI
|
|
84
|
-
run: curl
|
|
84
|
+
run: curl https://tinybird.co | sh
|
|
85
85
|
- name: Deploy project
|
|
86
86
|
run: tb --cloud --host ${{! env.TINYBIRD_HOST }} --token ${{! env.TINYBIRD_TOKEN }} deploy
|
|
87
87
|
"""
|
|
@@ -110,7 +110,7 @@ tinybird_ci_workflow:
|
|
|
110
110
|
- {{ data_project_dir }}/**/*{% end %}
|
|
111
111
|
before_script:
|
|
112
112
|
- apt update && apt install -y curl
|
|
113
|
-
- curl
|
|
113
|
+
- curl https://tinybird.co | sh
|
|
114
114
|
script:
|
|
115
115
|
- export PATH="$HOME/.local/bin:$PATH"
|
|
116
116
|
- cd $CI_PROJECT_DIR/{{ data_project_dir }}
|
|
@@ -191,6 +191,14 @@ KAFKA_PARAMS = {
|
|
|
191
191
|
|
|
192
192
|
REQUIRED_KAFKA_PARAMS = KAFKA_PARAMS
|
|
193
193
|
|
|
194
|
+
S3_PARAMS = {
|
|
195
|
+
"import_connection_name",
|
|
196
|
+
"import_schedule",
|
|
197
|
+
"import_bucket_uri",
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
REQUIRED_S3_PARAMS = S3_PARAMS
|
|
201
|
+
|
|
194
202
|
|
|
195
203
|
class Datafile:
|
|
196
204
|
def __init__(self) -> None:
|
|
@@ -261,6 +269,7 @@ class Datafile:
|
|
|
261
269
|
# [x] Engine is present
|
|
262
270
|
# [x] Token permissions are valid
|
|
263
271
|
# [x] If it's a kafka datasource, all required kafka params are present
|
|
272
|
+
# [x] If it's an S3 datasource, all required S3 params are present
|
|
264
273
|
# [ ] ...
|
|
265
274
|
if len(self.nodes) > 1:
|
|
266
275
|
# Our users are not aware of data source data files being a single-node data file, hence this error
|
|
@@ -283,6 +292,12 @@ class Datafile:
|
|
|
283
292
|
raise DatafileValidationError(
|
|
284
293
|
f"Some Kafka params have been provided, but the following required ones are missing: {missing}"
|
|
285
294
|
)
|
|
295
|
+
# Validate S3 params
|
|
296
|
+
if any(param in node for param in S3_PARAMS) and not all(param in node for param in REQUIRED_S3_PARAMS):
|
|
297
|
+
missing = [param for param in S3_PARAMS if param not in node]
|
|
298
|
+
raise DatafileValidationError(
|
|
299
|
+
f"Some S3 params have been provided, but the following required ones are missing: {missing}"
|
|
300
|
+
)
|
|
286
301
|
else:
|
|
287
302
|
# We cannot validate a datafile whose kind is unknown
|
|
288
303
|
pass
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import re
|
|
2
2
|
import subprocess
|
|
3
3
|
import time
|
|
4
|
+
from typing import Optional
|
|
4
5
|
|
|
5
6
|
import boto3
|
|
6
7
|
import click
|
|
7
8
|
|
|
8
9
|
import docker
|
|
9
10
|
from docker.client import DockerClient
|
|
11
|
+
from docker.models.containers import Container
|
|
10
12
|
from tinybird.tb.modules.cli import cli
|
|
11
13
|
from tinybird.tb.modules.common import coro
|
|
12
14
|
from tinybird.tb.modules.exceptions import CLIException
|
|
@@ -41,10 +43,9 @@ def start_tinybird_local(
|
|
|
41
43
|
if pull_required:
|
|
42
44
|
docker_client.images.pull(TB_IMAGE_NAME, platform="linux/amd64")
|
|
43
45
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
container = containers[0]
|
|
46
|
+
environment = get_use_aws_creds() if use_aws_creds else {}
|
|
47
|
+
|
|
48
|
+
container = get_existing_container_with_matching_env(docker_client, TB_CONTAINER_NAME, environment)
|
|
48
49
|
|
|
49
50
|
if container and not pull_required:
|
|
50
51
|
# Container `start` is idempotent. It's safe to call it even if the container is already running.
|
|
@@ -53,8 +54,6 @@ def start_tinybird_local(
|
|
|
53
54
|
if container:
|
|
54
55
|
container.remove(force=True)
|
|
55
56
|
|
|
56
|
-
environment = get_use_aws_creds() if use_aws_creds else {}
|
|
57
|
-
|
|
58
57
|
container = docker_client.containers.run(
|
|
59
58
|
TB_IMAGE_NAME,
|
|
60
59
|
name=TB_CONTAINER_NAME,
|
|
@@ -82,6 +81,43 @@ def start_tinybird_local(
|
|
|
82
81
|
image.remove(force=True)
|
|
83
82
|
|
|
84
83
|
|
|
84
|
+
def get_existing_container_with_matching_env(
|
|
85
|
+
docker_client: DockerClient, container_name: str, required_env: dict[str, str]
|
|
86
|
+
) -> Optional[Container]:
|
|
87
|
+
"""
|
|
88
|
+
Checks if a container with the given name exists and has matching environment variables.
|
|
89
|
+
If it exists but environment doesn't match, it returns None.
|
|
90
|
+
|
|
91
|
+
Args:
|
|
92
|
+
docker_client: The Docker client instance
|
|
93
|
+
container_name: The name of the container to check
|
|
94
|
+
required_env: Dictionary of environment variables that must be present
|
|
95
|
+
|
|
96
|
+
Returns:
|
|
97
|
+
The container if it exists with matching environment, None otherwise
|
|
98
|
+
"""
|
|
99
|
+
container = None
|
|
100
|
+
containers = docker_client.containers.list(all=True, filters={"name": container_name})
|
|
101
|
+
if containers:
|
|
102
|
+
container = containers[0]
|
|
103
|
+
|
|
104
|
+
if container and required_env:
|
|
105
|
+
container_info = container.attrs
|
|
106
|
+
container_env = container_info.get("Config", {}).get("Env", [])
|
|
107
|
+
env_missing = False
|
|
108
|
+
for key, value in required_env.items():
|
|
109
|
+
env_var = f"{key}={value}"
|
|
110
|
+
if env_var not in container_env:
|
|
111
|
+
env_missing = True
|
|
112
|
+
break
|
|
113
|
+
|
|
114
|
+
if env_missing:
|
|
115
|
+
container.remove(force=True)
|
|
116
|
+
container = None
|
|
117
|
+
|
|
118
|
+
return container
|
|
119
|
+
|
|
120
|
+
|
|
85
121
|
def get_docker_client() -> DockerClient:
|
|
86
122
|
"""Check if Docker is installed and running."""
|
|
87
123
|
try:
|
|
@@ -156,7 +192,7 @@ def update_cli():
|
|
|
156
192
|
text=True,
|
|
157
193
|
)
|
|
158
194
|
except FileNotFoundError:
|
|
159
|
-
raise CLIException("Cannot find required tool: uv. Reinstall using: curl
|
|
195
|
+
raise CLIException("Cannot find required tool: uv. Reinstall using: curl https://tinybird.co | sh")
|
|
160
196
|
|
|
161
197
|
stdout, stderr = process.communicate()
|
|
162
198
|
if "Nothing to upgrade" not in stdout + stderr:
|
|
@@ -208,7 +244,12 @@ async def remove() -> None:
|
|
|
208
244
|
|
|
209
245
|
@local.command()
|
|
210
246
|
@coro
|
|
211
|
-
@click.option(
|
|
247
|
+
@click.option(
|
|
248
|
+
"--use-aws-creds",
|
|
249
|
+
default=False,
|
|
250
|
+
is_flag=True,
|
|
251
|
+
help="Use local AWS credentials from your environment and pass them to the Tinybird docker container",
|
|
252
|
+
)
|
|
212
253
|
async def start(use_aws_creds: bool) -> None:
|
|
213
254
|
"""Start Tinybird Local"""
|
|
214
255
|
click.echo(FeedbackManager.highlight(message="» Starting Tinybird Local..."))
|
|
@@ -219,7 +260,12 @@ async def start(use_aws_creds: bool) -> None:
|
|
|
219
260
|
|
|
220
261
|
@local.command()
|
|
221
262
|
@coro
|
|
222
|
-
@click.option(
|
|
263
|
+
@click.option(
|
|
264
|
+
"--use-aws-creds",
|
|
265
|
+
default=False,
|
|
266
|
+
is_flag=True,
|
|
267
|
+
help="Use local AWS credentials from your environment and pass them to the Tinybird docker container",
|
|
268
|
+
)
|
|
223
269
|
async def restart(use_aws_creds: bool) -> None:
|
|
224
270
|
"""Restart Tinybird Local"""
|
|
225
271
|
click.echo(FeedbackManager.highlight(message="» Restarting Tinybird Local..."))
|
|
@@ -113,6 +113,9 @@ def start_server(auth_callback, auth_host):
|
|
|
113
113
|
@coro
|
|
114
114
|
async def login(host: str, auth_host: str, workspace: str):
|
|
115
115
|
"""Authenticate using the browser."""
|
|
116
|
+
host = host.rstrip("/")
|
|
117
|
+
auth_host = auth_host.rstrip("/")
|
|
118
|
+
|
|
116
119
|
auth_event = threading.Event()
|
|
117
120
|
auth_code: list[str] = [] # Using a list to store the code, as it's mutable
|
|
118
121
|
|
|
@@ -153,8 +156,8 @@ async def login(host: str, auth_host: str, workspace: str):
|
|
|
153
156
|
cli_config.set_token(data.get("workspace_token", ""))
|
|
154
157
|
cli_config.set_token_for_host(data.get("workspace_token", ""), host)
|
|
155
158
|
cli_config.set_user_token(data.get("user_token", ""))
|
|
156
|
-
|
|
157
|
-
|
|
159
|
+
host = data.get("api_host", host)
|
|
160
|
+
cli_config.set_host(host)
|
|
158
161
|
ws = await cli_config.get_client(token=data.get("workspace_token", ""), host=host).workspace_info(version="v1")
|
|
159
162
|
for k in ("id", "name", "user_email", "user_id", "scope"):
|
|
160
163
|
if k in ws:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/tb/modules/datafile/build_common.py
RENAMED
|
File without changes
|
{tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/tb/modules/datafile/build_datasource.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/tb/modules/datafile/format_common.py
RENAMED
|
File without changes
|
{tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/tb/modules/datafile/format_datasource.py
RENAMED
|
File without changes
|
|
File without changes
|
{tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/tb/modules/datafile/parse_datasource.py
RENAMED
|
File without changes
|
|
File without changes
|
{tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/tb/modules/datafile/pipe_checker.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/tb/modules/tinyunit/tinyunit_lib.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/tb_cli_modules/tinyunit/tinyunit.py
RENAMED
|
File without changes
|
{tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/tb_cli_modules/tinyunit/tinyunit_lib.py
RENAMED
|
File without changes
|
|
File without changes
|
{tinybird-0.0.1.dev108 → tinybird-0.0.1.dev110}/tinybird/tb_cli_modules/workspace_members.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|