tinybird 0.0.1.dev166__py3-none-any.whl → 0.0.1.dev167__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of tinybird might be problematic. Click here for more details.
- tinybird/ch_utils/engine.py +5 -2
- tinybird/tb/__cli__.py +2 -2
- tinybird/tb/modules/local_common.py +70 -7
- {tinybird-0.0.1.dev166.dist-info → tinybird-0.0.1.dev167.dist-info}/METADATA +1 -1
- {tinybird-0.0.1.dev166.dist-info → tinybird-0.0.1.dev167.dist-info}/RECORD +8 -8
- {tinybird-0.0.1.dev166.dist-info → tinybird-0.0.1.dev167.dist-info}/WHEEL +0 -0
- {tinybird-0.0.1.dev166.dist-info → tinybird-0.0.1.dev167.dist-info}/entry_points.txt +0 -0
- {tinybird-0.0.1.dev166.dist-info → tinybird-0.0.1.dev167.dist-info}/top_level.txt +0 -0
tinybird/ch_utils/engine.py
CHANGED
|
@@ -146,10 +146,9 @@ class TableDetails:
|
|
|
146
146
|
def is_replacing_engine(self) -> bool:
|
|
147
147
|
if self.engine:
|
|
148
148
|
engine_lower = self.engine.lower()
|
|
149
|
-
is_aggregating = "aggregatingmergetree" in engine_lower
|
|
150
149
|
is_replacing = "replacingmergetree" in engine_lower
|
|
151
150
|
is_collapsing = "collapsingmergetree" in engine_lower
|
|
152
|
-
return
|
|
151
|
+
return is_replacing or is_collapsing
|
|
153
152
|
return False
|
|
154
153
|
|
|
155
154
|
def diff_ttl(self, new_ttl: str) -> bool:
|
|
@@ -169,6 +168,10 @@ class TableDetails:
|
|
|
169
168
|
@property
|
|
170
169
|
def sorting_key(self) -> Optional[str]:
|
|
171
170
|
_sorting_key = self.details.get("sorting_key", None)
|
|
171
|
+
# TODO: This should use ENABLED_ENGINES to guess if the sorting key is required or not
|
|
172
|
+
# Also checking this and raising an error in a getter is a bit of an anti-pattern,
|
|
173
|
+
# a data source could have a "wrong" sorting key and we won't be able to even show it in the API.
|
|
174
|
+
# All these checks be performed only on creation time.
|
|
172
175
|
if self.is_replacing_engine() and not _sorting_key:
|
|
173
176
|
raise ValueError(f"SORTING_KEY must be defined for the {self.engine} engine")
|
|
174
177
|
if self.is_mergetree_family():
|
tinybird/tb/__cli__.py
CHANGED
|
@@ -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__ = '0.0.1.
|
|
8
|
-
__revision__ = '
|
|
7
|
+
__version__ = '0.0.1.dev167'
|
|
8
|
+
__revision__ = '1b40d30'
|
|
@@ -109,22 +109,84 @@ def get_local_tokens() -> Dict[str, str]:
|
|
|
109
109
|
# ruff: noqa: ASYNC210
|
|
110
110
|
return requests.get(f"{TB_LOCAL_ADDRESS}/tokens").json()
|
|
111
111
|
except Exception:
|
|
112
|
+
# Check if tinybird-local is running using docker client (some clients use podman and won't have docker cmd)
|
|
112
113
|
try:
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
114
|
+
docker_client = get_docker_client()
|
|
115
|
+
container = get_existing_container_with_matching_env(docker_client, TB_CONTAINER_NAME, {})
|
|
116
|
+
|
|
117
|
+
output = {}
|
|
118
|
+
if container:
|
|
119
|
+
output = container.attrs
|
|
120
|
+
add_telemetry_event(
|
|
121
|
+
"docker_debug",
|
|
122
|
+
data={
|
|
123
|
+
"container_attrs": output,
|
|
124
|
+
},
|
|
119
125
|
)
|
|
126
|
+
|
|
127
|
+
if container and container.status == "running":
|
|
128
|
+
if container.health == "healthy":
|
|
129
|
+
raise CLILocalException(
|
|
130
|
+
FeedbackManager.error(
|
|
131
|
+
message=(
|
|
132
|
+
"Looks like Tinybird Local is running but we are not able to connect to it.\n\n"
|
|
133
|
+
"If you've run it manually using different host or port, please set the environment variables "
|
|
134
|
+
"TB_LOCAL_HOST and TB_LOCAL_PORT to match the ones you're using.\n"
|
|
135
|
+
"If you're not sure about this, please run `tb local restart` and try again."
|
|
136
|
+
)
|
|
137
|
+
)
|
|
138
|
+
)
|
|
139
|
+
raise CLILocalException(
|
|
140
|
+
FeedbackManager.error(
|
|
141
|
+
message=(
|
|
142
|
+
"Tinybird Local is running but it's unhealthy. Please check if it's running and try again.\n"
|
|
143
|
+
"If the problem persists, please run `tb local restart` and try again."
|
|
144
|
+
)
|
|
145
|
+
)
|
|
146
|
+
)
|
|
147
|
+
except CLILocalException as e:
|
|
148
|
+
raise e
|
|
149
|
+
except Exception:
|
|
150
|
+
pass
|
|
151
|
+
|
|
152
|
+
# Check if tinybird-local is running with docker
|
|
153
|
+
try:
|
|
154
|
+
output_str = subprocess.check_output(
|
|
155
|
+
["docker", "ps", "--filter", f"name={TB_CONTAINER_NAME}", "--format", "json"], text=True
|
|
156
|
+
)
|
|
157
|
+
output = {}
|
|
158
|
+
if output_str:
|
|
159
|
+
output = json.loads(output_str)
|
|
120
160
|
add_telemetry_event(
|
|
121
161
|
"docker_debug",
|
|
122
162
|
data={
|
|
123
|
-
"docker_ps_output":
|
|
163
|
+
"docker_ps_output": output,
|
|
124
164
|
},
|
|
125
165
|
)
|
|
166
|
+
|
|
167
|
+
if output.get("State", "") == "running":
|
|
168
|
+
if "(healthy)" in output.get("Status", ""):
|
|
169
|
+
raise CLILocalException(
|
|
170
|
+
FeedbackManager.error(
|
|
171
|
+
message=(
|
|
172
|
+
"Looks like Tinybird Local is running but we are not able to connect to it.\n\n"
|
|
173
|
+
"If you've run it manually using different host or port, please set the environment variables "
|
|
174
|
+
"TB_LOCAL_HOST and TB_LOCAL_PORT to match the ones you're using.\n"
|
|
175
|
+
"If you're not sure about this, please run `tb local restart` and try again."
|
|
176
|
+
)
|
|
177
|
+
)
|
|
178
|
+
)
|
|
179
|
+
raise CLILocalException(
|
|
180
|
+
FeedbackManager.error(
|
|
181
|
+
message="Tinybird Local is running but it's unhealthy. Please check if it's running and try again.\n"
|
|
182
|
+
"If the problem persists, please run `tb local restart` and try again."
|
|
183
|
+
)
|
|
184
|
+
)
|
|
185
|
+
except CLILocalException as e:
|
|
186
|
+
raise e
|
|
126
187
|
except Exception:
|
|
127
188
|
pass
|
|
189
|
+
|
|
128
190
|
is_ci = (
|
|
129
191
|
os.getenv("GITHUB_ACTIONS")
|
|
130
192
|
or os.getenv("TRAVIS")
|
|
@@ -146,6 +208,7 @@ def get_local_tokens() -> Dict[str, str]:
|
|
|
146
208
|
start_tinybird_local(docker_client, False)
|
|
147
209
|
click.echo(FeedbackManager.success(message="✓ Tinybird Local is ready!"))
|
|
148
210
|
return get_local_tokens()
|
|
211
|
+
|
|
149
212
|
raise CLILocalException(
|
|
150
213
|
FeedbackManager.error(message="Tinybird local is not running. Please run `tb local start` first.")
|
|
151
214
|
)
|
|
@@ -11,8 +11,8 @@ tinybird/sql_toolset.py,sha256=KORVbNAUTfW1qo3U9oe7Z59xQ0QMsFhB0ji3HzY2JVo,15324
|
|
|
11
11
|
tinybird/syncasync.py,sha256=IPnOx6lMbf9SNddN1eBtssg8vCLHMt76SuZ6YNYm-Yk,27761
|
|
12
12
|
tinybird/tornado_template.py,sha256=jjNVDMnkYFWXflmT8KU_Ssbo5vR8KQq3EJMk5vYgXRw,41959
|
|
13
13
|
tinybird/ch_utils/constants.py,sha256=aYvg2C_WxYWsnqPdZB1ZFoIr8ZY-XjUXYyHKE9Ansj0,3890
|
|
14
|
-
tinybird/ch_utils/engine.py,sha256=
|
|
15
|
-
tinybird/tb/__cli__.py,sha256=
|
|
14
|
+
tinybird/ch_utils/engine.py,sha256=X4tE9OrfaUy6kO9cqVEzyI9cDcmOF3IAssRRzsTsfEQ,40781
|
|
15
|
+
tinybird/tb/__cli__.py,sha256=hOH0V0bHJIUdoaXgkkQIrbemhjCdguZddpBYgdOb1_A,247
|
|
16
16
|
tinybird/tb/check_pypi.py,sha256=rW4QmDRbtgKdUUwJCnBkVjmTjZSZGN-XgZhx7vMkC0w,1009
|
|
17
17
|
tinybird/tb/cli.py,sha256=u3eGOhX0MHkuT6tiwaZ0_3twqLmqKXDAOxF7yV_Nn9Q,1075
|
|
18
18
|
tinybird/tb/client.py,sha256=CSBl_JRuioPyY0H8Ac96dJ9wQXDXfrvK2lwqlOxKGoY,55715
|
|
@@ -38,7 +38,7 @@ tinybird/tb/modules/job.py,sha256=n4dSSBgnA8NqD7srGahf2xRj6wxkmX9Vl0J-QJ_a2w0,29
|
|
|
38
38
|
tinybird/tb/modules/llm.py,sha256=KfsCYmKeW1VQz0iDZhGKCRkQv_Y3kTHh6JuxvofOguE,1076
|
|
39
39
|
tinybird/tb/modules/llm_utils.py,sha256=nS9r4FAElJw8yXtmdYrx-rtI2zXR8qXfi1QqUDCfxvg,3469
|
|
40
40
|
tinybird/tb/modules/local.py,sha256=SUaGWH9TLDFFF9uCw4y7UW4NsKgnXG8uxTcxz1dbkCM,14230
|
|
41
|
-
tinybird/tb/modules/local_common.py,sha256=
|
|
41
|
+
tinybird/tb/modules/local_common.py,sha256=msAZDNPPVenNyL9Dqfb0Z5uFC_1O809xdAi7j1iKmJA,17066
|
|
42
42
|
tinybird/tb/modules/login.py,sha256=fmXPSdvJnKPv03chptGuu3_Fm6LhP6kUsUKhrmT8rJc,8269
|
|
43
43
|
tinybird/tb/modules/logout.py,sha256=ULooy1cDBD02-r7voZmhV7udA0ML5tVuflJyShrh56Y,1022
|
|
44
44
|
tinybird/tb/modules/materialization.py,sha256=QJX5kCPhhm6IXBO1JsalVfbQdypCe_eOUDZ_WHJZWS8,5478
|
|
@@ -80,8 +80,8 @@ tinybird/tb_cli_modules/config.py,sha256=IsgdtFRnUrkY8-Zo32lmk6O7u3bHie1QCxLwgp4
|
|
|
80
80
|
tinybird/tb_cli_modules/exceptions.py,sha256=pmucP4kTF4irIt7dXiG-FcnI-o3mvDusPmch1L8RCWk,3367
|
|
81
81
|
tinybird/tb_cli_modules/regions.py,sha256=QjsL5H6Kg-qr0aYVLrvb1STeJ5Sx_sjvbOYO0LrEGMk,166
|
|
82
82
|
tinybird/tb_cli_modules/telemetry.py,sha256=Hh2Io8ZPROSunbOLuMvuIFU4TqwWPmQTqal4WS09K1A,10449
|
|
83
|
-
tinybird-0.0.1.
|
|
84
|
-
tinybird-0.0.1.
|
|
85
|
-
tinybird-0.0.1.
|
|
86
|
-
tinybird-0.0.1.
|
|
87
|
-
tinybird-0.0.1.
|
|
83
|
+
tinybird-0.0.1.dev167.dist-info/METADATA,sha256=zC83ZfhfJZO452npBKKZrv20pk5lG41o4mD0dkImgE4,1607
|
|
84
|
+
tinybird-0.0.1.dev167.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
|
85
|
+
tinybird-0.0.1.dev167.dist-info/entry_points.txt,sha256=LwdHU6TfKx4Qs7BqqtaczEZbImgU7Abe9Lp920zb_fo,43
|
|
86
|
+
tinybird-0.0.1.dev167.dist-info/top_level.txt,sha256=VqqqEmkAy7UNaD8-V51FCoMMWXjLUlR0IstvK7tJYVY,54
|
|
87
|
+
tinybird-0.0.1.dev167.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|