tinybird 0.0.1.dev91__py3-none-any.whl → 0.0.1.dev92__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
@@ -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.dev91'
8
- __revision__ = 'b965ddf'
7
+ __version__ = '0.0.1.dev92'
8
+ __revision__ = 'd99cccc'
@@ -4,7 +4,7 @@ import sys
4
4
  import time
5
5
  from datetime import datetime
6
6
  from pathlib import Path
7
- from typing import Optional, Union
7
+ from typing import Any, Dict, Optional, Union
8
8
 
9
9
  import click
10
10
  import requests
@@ -330,7 +330,7 @@ def create_deployment(
330
330
  }
331
331
  project: Project = ctx.ensure_object(dict)["project"]
332
332
  client = ctx.ensure_object(dict)["client"]
333
- config = ctx.ensure_object(dict)["config"]
333
+ config: Dict[str, Any] = ctx.ensure_object(dict)["config"]
334
334
  TINYBIRD_API_URL = f"{client.host}/v1/deploy"
335
335
  TINYBIRD_API_KEY = client.token
336
336
 
@@ -62,7 +62,7 @@ def playground(
62
62
  """Build the project in Tinybird Local."""
63
63
  project: Project = ctx.ensure_object(dict)["project"]
64
64
  tb_client: TinyB = ctx.ensure_object(dict)["client"]
65
- config: CLIConfig = ctx.ensure_object(dict)["config"]
65
+ config = CLIConfig.get_project_config()
66
66
  context.disable_template_security_validation.set(True)
67
67
 
68
68
  async def process(filenames: List[str], watch: bool = False):
@@ -5,6 +5,7 @@
5
5
 
6
6
  import difflib
7
7
  import glob
8
+ import os
8
9
  import sys
9
10
  import urllib.parse
10
11
  from pathlib import Path
@@ -75,8 +76,8 @@ async def test_create(ctx: click.Context, name_or_filename: str, prompt: str) ->
75
76
  """
76
77
  project: Project = ctx.ensure_object(dict)["project"]
77
78
  client: TinyB = ctx.ensure_object(dict)["client"]
78
- config: CLIConfig = ctx.ensure_object(dict)["config"]
79
- root_path = Path(project.folder)
79
+ config = CLIConfig.get_project_config()
80
+ root_path = project.path
80
81
  folder = project.folder
81
82
  try:
82
83
  if ".pipe" in name_or_filename:
@@ -85,20 +86,17 @@ async def test_create(ctx: click.Context, name_or_filename: str, prompt: str) ->
85
86
  raise CLIException(FeedbackManager.error(message=f"Pipe {name_or_filename} not found"))
86
87
  else:
87
88
  pipe_folders = ("endpoints", "copies", "materializations", "sinks", "pipes")
88
- try:
89
- pipe_path = next(
90
- root_path / folder / f"{name_or_filename}.pipe"
91
- for folder in pipe_folders
92
- if (root_path / folder / f"{name_or_filename}.pipe").exists()
93
- )
94
- except Exception:
89
+ pipe_path = next(
90
+ root_path / folder / f"{name_or_filename}.pipe"
91
+ for folder in pipe_folders
92
+ if os.path.exists(root_path / folder / f"{name_or_filename}.pipe")
93
+ )
94
+ if not pipe_path:
95
95
  raise CLIException(FeedbackManager.error(message=f"Pipe {name_or_filename} not found"))
96
96
 
97
97
  pipe_name = pipe_path.stem
98
98
  click.echo(FeedbackManager.highlight(message=f"\n» Creating tests for {pipe_name} endpoint..."))
99
- pipe_path = root_path / pipe_path
100
99
  pipe_content = pipe_path.read_text()
101
-
102
100
  pipe = await client._req(f"/v0/pipes/{pipe_name}")
103
101
  parameters = set([param["name"] for node in pipe["nodes"] for param in node["params"]])
104
102
 
@@ -112,7 +110,6 @@ async def test_create(ctx: click.Context, name_or_filename: str, prompt: str) ->
112
110
  raise CLIException(FeedbackManager.error(message="No user token found"))
113
111
 
114
112
  llm = LLM(user_token=user_token, host=config.get_client().host)
115
- click.echo(FeedbackManager.highlight(message=f"\n» Creating test for {pipe_name} endpoint..."))
116
113
  response_llm = llm.ask(system_prompt=system_prompt, prompt=prompt)
117
114
  response_xml = extract_xml(response_llm, "response")
118
115
  tests_content = parse_xml(response_xml, "test")
@@ -216,9 +213,12 @@ async def test_update(ctx: click.Context, pipe: str) -> None:
216
213
  async def run_tests(ctx: click.Context, name: Tuple[str, ...]) -> None:
217
214
  click.echo(FeedbackManager.highlight(message="\n» Running tests"))
218
215
  client: TinyB = ctx.ensure_object(dict)["client"]
216
+ project: Project = ctx.ensure_object(dict)["project"]
219
217
  paths = [Path(n) for n in name]
220
- endpoints = [f"./tests/{p.stem}.yaml" for p in paths]
221
- test_files: List[str] = endpoints if len(endpoints) > 0 else glob.glob("./tests/**/*.y*ml", recursive=True)
218
+ endpoints = [f"{project.path}/tests/{p.stem}.yaml" for p in paths]
219
+ test_files: List[str] = (
220
+ endpoints if len(endpoints) > 0 else glob.glob(f"{project.path}/tests/**/*.y*ml", recursive=True)
221
+ )
222
222
 
223
223
  async def run_test(test_file):
224
224
  test_file_path = Path(test_file)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: tinybird
3
- Version: 0.0.1.dev91
3
+ Version: 0.0.1.dev92
4
4
  Summary: Tinybird Command Line Tool
5
5
  Home-page: https://www.tinybird.co/docs/cli/introduction.html
6
6
  Author: Tinybird
@@ -15,7 +15,7 @@ tinybird/syncasync.py,sha256=IPnOx6lMbf9SNddN1eBtssg8vCLHMt76SuZ6YNYm-Yk,27761
15
15
  tinybird/tornado_template.py,sha256=jjNVDMnkYFWXflmT8KU_Ssbo5vR8KQq3EJMk5vYgXRw,41959
16
16
  tinybird/ch_utils/constants.py,sha256=aYvg2C_WxYWsnqPdZB1ZFoIr8ZY-XjUXYyHKE9Ansj0,3890
17
17
  tinybird/ch_utils/engine.py,sha256=BZuPM7MFS7vaEKK5tOMR2bwSAgJudPrJt27uVEwZmTY,40512
18
- tinybird/tb/__cli__.py,sha256=T_ssIbV6pifxlCyF-t9ua_F2d_5mle0hocUCAZm8PNY,251
18
+ tinybird/tb/__cli__.py,sha256=JauWMFoQBsfMiTW1HIS8HciaaGZR3hE0PE8cWmZXvBU,251
19
19
  tinybird/tb/cli.py,sha256=SSXALqjtPShcQbgvT1u7up2YL0ls36wXABX0hZwebdQ,1070
20
20
  tinybird/tb/modules/auth.py,sha256=L1IatO2arRSzys3t8px8xVt8uPWUL5EVD0sFzAV_uVU,9022
21
21
  tinybird/tb/modules/build.py,sha256=-lRGBxKtuipmyl3pmiGcfp67fH1Ed-COfHAZKdgLIWo,10483
@@ -27,7 +27,7 @@ tinybird/tb/modules/connection.py,sha256=WKeDxbTpSsQ1PUmsT730g3S5RT2PtR5mPpVEanD
27
27
  tinybird/tb/modules/copy.py,sha256=MAVqKip8_QhOYq99U_XuqSO6hCLJEh5sFtbhcXtI3SI,5802
28
28
  tinybird/tb/modules/create.py,sha256=KjotVfIQLfcPyQBykTHnPLn4ikrm6qqeMcbRE1d-6Jo,13280
29
29
  tinybird/tb/modules/datasource.py,sha256=dNCK9iCR2xPLfwqqwg2ixyE6NuoVEiJU2mBZBmOYrVY,16906
30
- tinybird/tb/modules/deployment.py,sha256=oSRnQnz2Wkvp1y0yt_tVa9g0aCYyFxNAsUyxoZTIcpY,17615
30
+ tinybird/tb/modules/deployment.py,sha256=Mfqx5Qq4HP8Ym0Vd_LnzFv8QkVyxI77-M0QkKmmZ_go,17642
31
31
  tinybird/tb/modules/endpoint.py,sha256=EhVoGAXsFz-83Fiwj1gI-I73iRRvL49d0W81un7hvPE,12080
32
32
  tinybird/tb/modules/exceptions.py,sha256=4A2sSjCEqKUMqpP3WI00zouCWW4uLaghXXLZBSw04mY,3363
33
33
  tinybird/tb/modules/feedback_manager.py,sha256=7nNiOx7OMebiheLED1r0d75SbuXCNxyBmF4e20rCBNc,69511
@@ -42,7 +42,7 @@ tinybird/tb/modules/logout.py,sha256=ULooy1cDBD02-r7voZmhV7udA0ML5tVuflJyShrh56Y
42
42
  tinybird/tb/modules/materialization.py,sha256=r8Q9HXcYEmfrEzP4WpiasCKDJdSkTPaAKJtZMoJKhi8,5749
43
43
  tinybird/tb/modules/mock.py,sha256=3q4i6CXKcS-zsgevbN_zpAP4AnB9_WIVxmVSJV3FNPQ,3881
44
44
  tinybird/tb/modules/pipe.py,sha256=gcLz0qHgwKDLsWFY3yFLO9a0ETAV1dFbI8YeLHi9460,2429
45
- tinybird/tb/modules/playground.py,sha256=CQaz2JqFDdReK2fJY1yZsSwiSY24_jeTb9PKw1WUigA,4848
45
+ tinybird/tb/modules/playground.py,sha256=bN0whphoSO6p1_u3b6OAUoc3ieG5Cl3qNXwt2HcUOp8,4834
46
46
  tinybird/tb/modules/project.py,sha256=ei0TIAuRksdV2g2FJqByuV4DPyivQGrZ42z_eQDNBgI,2963
47
47
  tinybird/tb/modules/regions.py,sha256=QjsL5H6Kg-qr0aYVLrvb1STeJ5Sx_sjvbOYO0LrEGMk,166
48
48
  tinybird/tb/modules/secret.py,sha256=xxzfKxfFN7GORib1WslCaFDHt_dgnjmfOewyptPU_VM,2820
@@ -50,7 +50,7 @@ tinybird/tb/modules/shell.py,sha256=a98W4L4gfrmxEyybtu6S4ENXrBYtgNASB5e_evuXQvI,
50
50
  tinybird/tb/modules/table.py,sha256=4XrtjM-N0zfNtxVkbvLDQQazno1EPXnxTyo7llivfXk,11035
51
51
  tinybird/tb/modules/tag.py,sha256=anPmMUBc-TbFovlpFi8GPkKA18y7Y0GczMsMms5TZsU,3502
52
52
  tinybird/tb/modules/telemetry.py,sha256=Hh2Io8ZPROSunbOLuMvuIFU4TqwWPmQTqal4WS09K1A,10449
53
- tinybird/tb/modules/test.py,sha256=oa6_ApTCT526W8-hngpZwNyl2AbIpOztOsxf0iwlSwc,11547
53
+ tinybird/tb/modules/test.py,sha256=FUU-drY8mdjNoKsw16O5ZqvYvZqzycrZBEpSwbhGDUE,11456
54
54
  tinybird/tb/modules/token.py,sha256=OhqLFpCHVfYeBCxJ0n7n2qoho9E9eGcUfHgL7R1MUVQ,13485
55
55
  tinybird/tb/modules/watch.py,sha256=qMQhewRSso1AFSEFLuyeyGFA8Lxf9ccYJxmVdPU1BgM,8808
56
56
  tinybird/tb/modules/workspace.py,sha256=SYkEULv_Gg8FhnAnZspengzyT5N4w0wjsvWWZ3vy3Ho,7753
@@ -79,8 +79,8 @@ tinybird/tb_cli_modules/config.py,sha256=IsgdtFRnUrkY8-Zo32lmk6O7u3bHie1QCxLwgp4
79
79
  tinybird/tb_cli_modules/exceptions.py,sha256=pmucP4kTF4irIt7dXiG-FcnI-o3mvDusPmch1L8RCWk,3367
80
80
  tinybird/tb_cli_modules/regions.py,sha256=QjsL5H6Kg-qr0aYVLrvb1STeJ5Sx_sjvbOYO0LrEGMk,166
81
81
  tinybird/tb_cli_modules/telemetry.py,sha256=Hh2Io8ZPROSunbOLuMvuIFU4TqwWPmQTqal4WS09K1A,10449
82
- tinybird-0.0.1.dev91.dist-info/METADATA,sha256=iN68_RO9ZH5bntib_gq07U3hcPtPv206bagyLYciECw,2585
83
- tinybird-0.0.1.dev91.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
84
- tinybird-0.0.1.dev91.dist-info/entry_points.txt,sha256=LwdHU6TfKx4Qs7BqqtaczEZbImgU7Abe9Lp920zb_fo,43
85
- tinybird-0.0.1.dev91.dist-info/top_level.txt,sha256=VqqqEmkAy7UNaD8-V51FCoMMWXjLUlR0IstvK7tJYVY,54
86
- tinybird-0.0.1.dev91.dist-info/RECORD,,
82
+ tinybird-0.0.1.dev92.dist-info/METADATA,sha256=D4Zz8uPHhOGElZtKIwMnCE5o5021zYYpC7Ah-TaHVBc,2585
83
+ tinybird-0.0.1.dev92.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
84
+ tinybird-0.0.1.dev92.dist-info/entry_points.txt,sha256=LwdHU6TfKx4Qs7BqqtaczEZbImgU7Abe9Lp920zb_fo,43
85
+ tinybird-0.0.1.dev92.dist-info/top_level.txt,sha256=VqqqEmkAy7UNaD8-V51FCoMMWXjLUlR0IstvK7tJYVY,54
86
+ tinybird-0.0.1.dev92.dist-info/RECORD,,