tinybird 0.0.1.dev153__py3-none-any.whl → 0.0.1.dev154__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/tb/__cli__.py CHANGED
@@ -1,8 +1,8 @@
1
1
 
2
2
  __name__ = 'tinybird'
3
3
  __description__ = 'Tinybird Command Line Tool'
4
- __url__ = 'https://www.tinybird.co/docs/cli/introduction.html'
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.dev153'
8
- __revision__ = '24d7d4a'
7
+ __version__ = '0.0.1.dev154'
8
+ __revision__ = 'db74d7e'
@@ -184,7 +184,7 @@ def build_project(project: Project, tb_client: TinyB, file_changed: Optional[str
184
184
  build_errors = result.get("errors")
185
185
  full_error_msg = ""
186
186
  for build_error in build_errors:
187
- filename_bit = build_error.get("filename", "")
187
+ filename_bit = build_error.get("filename", build_error.get("resource", ""))
188
188
  error_bit = build_error.get("error") or build_error.get("message") or ""
189
189
  error_msg = ((filename_bit + "\n") if filename_bit else "") + error_bit
190
190
  full_error_msg += error_msg + "\n\n"
@@ -16,6 +16,7 @@ from tinybird.tb.modules.common import coro
16
16
  from tinybird.tb.modules.exceptions import CLIException, CLILocalException
17
17
  from tinybird.tb.modules.feedback_manager import FeedbackManager
18
18
  from tinybird.tb.modules.local_common import TB_CONTAINER_NAME, TB_IMAGE_NAME, TB_LOCAL_PORT
19
+ from tinybird.tb.modules.telemetry import add_telemetry_event
19
20
 
20
21
 
21
22
  def start_tinybird_local(
@@ -131,16 +132,70 @@ def get_docker_client() -> DockerClient:
131
132
  if not docker_host:
132
133
  # Try to get docker host from docker context
133
134
  try:
134
- output = subprocess.check_output(["docker", "context", "inspect"], text=True)
135
- context = json.loads(output)
135
+ try:
136
+ output = subprocess.check_output(["docker", "context", "inspect"], text=True)
137
+ except Exception as e:
138
+ add_telemetry_event(
139
+ "docker_error",
140
+ data={
141
+ "error_kind": "docker_context_inspect_error",
142
+ "exception": str(e),
143
+ },
144
+ )
145
+ raise e
146
+ try:
147
+ context = json.loads(output)
148
+ except Exception as e:
149
+ add_telemetry_event(
150
+ "docker_error",
151
+ data={
152
+ "error_kind": "docker_context_inspect_parse_output_error",
153
+ "exception": str(e),
154
+ "docker_context_inspect_output": output,
155
+ },
156
+ )
157
+ raise e
136
158
  if context and len(context) > 0:
137
- docker_host = context[0].get("Endpoints", {}).get("docker", {}).get("Host")
138
- if docker_host:
139
- os.environ["DOCKER_HOST"] = docker_host
159
+ try:
160
+ docker_host = context[0].get("Endpoints", {}).get("docker", {}).get("Host")
161
+ if docker_host:
162
+ os.environ["DOCKER_HOST"] = docker_host
163
+ except Exception as e:
164
+ add_telemetry_event(
165
+ "docker_error",
166
+ data={
167
+ "error_kind": "docker_context_parse_host_error",
168
+ "exception": str(e),
169
+ "context": json.dumps(context),
170
+ },
171
+ )
172
+ raise e
140
173
  except Exception:
141
174
  pass
142
- client = docker.from_env() # type: ignore
143
- client.ping()
175
+ try:
176
+ client = docker.from_env() # type: ignore
177
+ except Exception as e:
178
+ add_telemetry_event(
179
+ "docker_error",
180
+ data={
181
+ "error_kind": "docker_get_client_from_env_error",
182
+ "exception": str(e),
183
+ },
184
+ )
185
+ raise e
186
+ try:
187
+ client.ping()
188
+ except Exception as e:
189
+ client_dict_non_sensitive = {k: v for k, v in client.api.__dict__.items() if "auth" not in k}
190
+ add_telemetry_event(
191
+ "docker_error",
192
+ data={
193
+ "error_kind": "docker_ping_error",
194
+ "exception": str(e),
195
+ "client": repr(client_dict_non_sensitive),
196
+ },
197
+ )
198
+ raise e
144
199
  return client
145
200
  except Exception:
146
201
  raise CLILocalException(
@@ -2,6 +2,7 @@ import hashlib
2
2
  import logging
3
3
  import os
4
4
  import re
5
+ import subprocess
5
6
  from typing import Any, Dict
6
7
 
7
8
  import requests
@@ -10,6 +11,7 @@ from tinybird.tb.client import AuthNoTokenException, TinyB
10
11
  from tinybird.tb.modules.config import CLIConfig
11
12
  from tinybird.tb.modules.exceptions import CLILocalException
12
13
  from tinybird.tb.modules.feedback_manager import FeedbackManager
14
+ from tinybird.tb.modules.telemetry import add_telemetry_event
13
15
 
14
16
  TB_IMAGE_NAME = "tinybirdco/tinybird-local:latest"
15
17
  TB_CONTAINER_NAME = "tinybird-local"
@@ -37,6 +39,22 @@ async def get_tinybird_local_config(config_obj: Dict[str, Any], test: bool = Fal
37
39
  # ruff: noqa: ASYNC210
38
40
  tokens = requests.get(f"{TB_LOCAL_ADDRESS}/tokens").json()
39
41
  except Exception:
42
+ try:
43
+ # Check if tinybird-local is running with docker, in case it's a config issue
44
+ output = subprocess.check_output(["docker", "ps"], text=True) # noqa: ASYNC221
45
+ header_row = next((line for line in output.splitlines() if "CONTAINER ID" in line), "")
46
+ tb_local_row = next(
47
+ (line for line in output.splitlines() if TB_CONTAINER_NAME in line),
48
+ f"{TB_CONTAINER_NAME} not found in output",
49
+ )
50
+ add_telemetry_event(
51
+ "docker_debug",
52
+ data={
53
+ "docker_ps_output": header_row + tb_local_row,
54
+ },
55
+ )
56
+ except Exception:
57
+ pass
40
58
  raise CLILocalException(
41
59
  FeedbackManager.error(message="Tinybird local is not running. Please run `tb local start` first.")
42
60
  )
@@ -1,8 +1,8 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: tinybird
3
- Version: 0.0.1.dev153
3
+ Version: 0.0.1.dev154
4
4
  Summary: Tinybird Command Line Tool
5
- Home-page: https://www.tinybird.co/docs/cli/introduction.html
5
+ Home-page: https://www.tinybird.co/docs/forward/commands
6
6
  Author: Tinybird
7
7
  Author-email: support@tinybird.co
8
8
  Requires-Python: >=3.9, <3.14
@@ -12,13 +12,13 @@ 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
14
  tinybird/ch_utils/engine.py,sha256=BZuPM7MFS7vaEKK5tOMR2bwSAgJudPrJt27uVEwZmTY,40512
15
- tinybird/tb/__cli__.py,sha256=V2P7LUM2Vw2frXY-02zxDbU0UWJW6e_-DJj6Csa4P5Y,252
15
+ tinybird/tb/__cli__.py,sha256=OrWQsqWlL7qgpSbsPAJ-mQZxZnMtsVL0MZkOzFitD88,247
16
16
  tinybird/tb/check_pypi.py,sha256=rW4QmDRbtgKdUUwJCnBkVjmTjZSZGN-XgZhx7vMkC0w,1009
17
17
  tinybird/tb/cli.py,sha256=uPV6pvi4aYVfaiGs0DQO-eoi1g9dHlrgvhutkXkdJko,1075
18
18
  tinybird/tb/client.py,sha256=aaPKq5C77e72kR7IMv9WrvnvNki8mKMOTi9EsCp0eUc,55962
19
19
  tinybird/tb/config.py,sha256=jT9xndpeCY_g0HdB5qE2EquC0TFRRnkPnQFWZWd04jo,3998
20
20
  tinybird/tb/modules/auth.py,sha256=_OeYnmTH83lnqCgQEdS6K0bx1KBUeRmZk2M7JnRmWpk,9037
21
- tinybird/tb/modules/build.py,sha256=PJxsI4Wqw8lRkSw0RrQqkwAHYClikJ4ZKd9i1_gRdkk,18488
21
+ tinybird/tb/modules/build.py,sha256=sj77FyQRAtAQdifY8sqVzPzeIUKsxUDwPsz17NSRsVA,18517
22
22
  tinybird/tb/modules/cicd.py,sha256=Cn1DyE28w2maQgIJF4IjZU7J7ULPvMG11DjN2OH-cqE,7161
23
23
  tinybird/tb/modules/cli.py,sha256=TCms3gyokv3ES1yD6WuL_mLNEqBcAFQHSvgOnr6RYDY,14266
24
24
  tinybird/tb/modules/common.py,sha256=WzF_zRtAl3FKqbzK6yi_IjeeGIjQNu6SKnP-PX-o3Kk,85196
@@ -37,8 +37,8 @@ tinybird/tb/modules/infra.py,sha256=fve30Gj3mG9zbquGxS2e4ipcOYOxviWQCpNFfEzJN_Q,
37
37
  tinybird/tb/modules/job.py,sha256=n4dSSBgnA8NqD7srGahf2xRj6wxkmX9Vl0J-QJ_a2w0,2966
38
38
  tinybird/tb/modules/llm.py,sha256=KfsCYmKeW1VQz0iDZhGKCRkQv_Y3kTHh6JuxvofOguE,1076
39
39
  tinybird/tb/modules/llm_utils.py,sha256=nS9r4FAElJw8yXtmdYrx-rtI2zXR8qXfi1QqUDCfxvg,3469
40
- tinybird/tb/modules/local.py,sha256=kxdF8NXZYYwtUwlFHxHKq_PA9CpMrG-rXOg_i_hlvnY,12158
41
- tinybird/tb/modules/local_common.py,sha256=jNbVG_nk5sNduPo3JDSNtop1H2X1Tdd5j4q3xXUR6W8,3965
40
+ tinybird/tb/modules/local.py,sha256=bMrDxvhNuc3O1Gb2CL51IgoT1XXujs0NqwWpoE_bOS4,14299
41
+ tinybird/tb/modules/local_common.py,sha256=GMbA0aKaDXzOIHVCfi_IJyQ7ziWPUhTWk0I_CZm8nmQ,4763
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.dev153.dist-info/METADATA,sha256=ssrKpwmrdIOxtjrzdNFLCOKObE89ZhkF0hO0VSOC-tA,1612
84
- tinybird-0.0.1.dev153.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
85
- tinybird-0.0.1.dev153.dist-info/entry_points.txt,sha256=LwdHU6TfKx4Qs7BqqtaczEZbImgU7Abe9Lp920zb_fo,43
86
- tinybird-0.0.1.dev153.dist-info/top_level.txt,sha256=VqqqEmkAy7UNaD8-V51FCoMMWXjLUlR0IstvK7tJYVY,54
87
- tinybird-0.0.1.dev153.dist-info/RECORD,,
83
+ tinybird-0.0.1.dev154.dist-info/METADATA,sha256=PnWxtxSIaHMNfsIBGjf2-dFk1zw2g1wx80rl_2u1Gw4,1607
84
+ tinybird-0.0.1.dev154.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
85
+ tinybird-0.0.1.dev154.dist-info/entry_points.txt,sha256=LwdHU6TfKx4Qs7BqqtaczEZbImgU7Abe9Lp920zb_fo,43
86
+ tinybird-0.0.1.dev154.dist-info/top_level.txt,sha256=VqqqEmkAy7UNaD8-V51FCoMMWXjLUlR0IstvK7tJYVY,54
87
+ tinybird-0.0.1.dev154.dist-info/RECORD,,