tinybird 0.0.1.dev91__py3-none-any.whl → 0.0.1.dev93__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 +2 -2
- tinybird/tb/modules/deployment.py +11 -2
- tinybird/tb/modules/playground.py +1 -1
- tinybird/tb/modules/test.py +14 -14
- {tinybird-0.0.1.dev91.dist-info → tinybird-0.0.1.dev93.dist-info}/METADATA +1 -1
- {tinybird-0.0.1.dev91.dist-info → tinybird-0.0.1.dev93.dist-info}/RECORD +9 -9
- {tinybird-0.0.1.dev91.dist-info → tinybird-0.0.1.dev93.dist-info}/WHEEL +0 -0
- {tinybird-0.0.1.dev91.dist-info → tinybird-0.0.1.dev93.dist-info}/entry_points.txt +0 -0
- {tinybird-0.0.1.dev91.dist-info → tinybird-0.0.1.dev93.dist-info}/top_level.txt +0 -0
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.
|
|
8
|
-
__revision__ = '
|
|
7
|
+
__version__ = '0.0.1.dev93'
|
|
8
|
+
__revision__ = '8ee6a21'
|
|
@@ -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
|
|
|
@@ -460,18 +460,27 @@ def print_changes(result: dict, project: Project) -> None:
|
|
|
460
460
|
for p in deployment.get("new_pipe_names", []):
|
|
461
461
|
resources.append(["new", p, project.get_resource_path(p, "pipe")])
|
|
462
462
|
|
|
463
|
+
for dc in deployment.get("new_data_connector_names", []):
|
|
464
|
+
resources.append(["new", dc, project.get_resource_path(dc, "data_connector")])
|
|
465
|
+
|
|
463
466
|
for ds in deployment.get("changed_datasource_names", []):
|
|
464
467
|
resources.append(["modified", ds, project.get_resource_path(ds, "datasource")])
|
|
465
468
|
|
|
466
469
|
for p in deployment.get("changed_pipe_names", []):
|
|
467
470
|
resources.append(["modified", p, project.get_resource_path(p, "pipe")])
|
|
468
471
|
|
|
472
|
+
for dc in deployment.get("changed_data_connector_names", []):
|
|
473
|
+
resources.append(["modified", dc, project.get_resource_path(dc, "data_connector")])
|
|
474
|
+
|
|
469
475
|
for ds in deployment.get("deleted_datasource_names", []):
|
|
470
476
|
resources.append(["deleted", ds, project.get_resource_path(ds, "datasource")])
|
|
471
477
|
|
|
472
478
|
for p in deployment.get("deleted_pipe_names", []):
|
|
473
479
|
resources.append(["deleted", p, project.get_resource_path(p, "pipe")])
|
|
474
480
|
|
|
481
|
+
for dc in deployment.get("deleted_data_connector_names", []):
|
|
482
|
+
resources.append(["deleted", dc, project.get_resource_path(dc, "data_connector")])
|
|
483
|
+
|
|
475
484
|
if resources:
|
|
476
485
|
click.echo(FeedbackManager.highlight(message="\n» Changes to be deployed...\n"))
|
|
477
486
|
echo_safe_humanfriendly_tables_format_smart_table(resources, column_names=columns)
|
|
@@ -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
|
|
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):
|
tinybird/tb/modules/test.py
CHANGED
|
@@ -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
|
|
79
|
-
root_path =
|
|
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
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
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"
|
|
221
|
-
test_files: List[str] =
|
|
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)
|
|
@@ -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=
|
|
18
|
+
tinybird/tb/__cli__.py,sha256=bNoBpW1G6tYs3EKrC-mlXTGvxaOMRSrxlyybi-I06Y0,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=
|
|
30
|
+
tinybird/tb/modules/deployment.py,sha256=ZX9fTxenVN0oCbJTa_5Ap1bmyqT8zt9PMBmBP949Ag4,18109
|
|
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=
|
|
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=
|
|
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.
|
|
83
|
-
tinybird-0.0.1.
|
|
84
|
-
tinybird-0.0.1.
|
|
85
|
-
tinybird-0.0.1.
|
|
86
|
-
tinybird-0.0.1.
|
|
82
|
+
tinybird-0.0.1.dev93.dist-info/METADATA,sha256=IVb38UDMgY5n1eKji5lTeEKlcIytmZ6bi8GmcYVd3Y0,2585
|
|
83
|
+
tinybird-0.0.1.dev93.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
|
84
|
+
tinybird-0.0.1.dev93.dist-info/entry_points.txt,sha256=LwdHU6TfKx4Qs7BqqtaczEZbImgU7Abe9Lp920zb_fo,43
|
|
85
|
+
tinybird-0.0.1.dev93.dist-info/top_level.txt,sha256=VqqqEmkAy7UNaD8-V51FCoMMWXjLUlR0IstvK7tJYVY,54
|
|
86
|
+
tinybird-0.0.1.dev93.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|