tinybird 0.0.1.dev37__tar.gz → 0.0.1.dev39__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.dev37 → tinybird-0.0.1.dev39}/PKG-INFO +1 -1
- {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev39}/tinybird/tb/__cli__.py +2 -2
- {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev39}/tinybird/tb/modules/build.py +34 -17
- {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev39}/tinybird/tb/modules/local_common.py +10 -4
- {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev39}/tinybird/tb/modules/shell.py +4 -4
- {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev39}/tinybird/tb/modules/test.py +7 -9
- {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev39}/tinybird.egg-info/PKG-INFO +1 -1
- {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev39}/setup.cfg +0 -0
- {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev39}/tinybird/__cli__.py +0 -0
- {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev39}/tinybird/ch_utils/constants.py +0 -0
- {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev39}/tinybird/ch_utils/engine.py +0 -0
- {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev39}/tinybird/check_pypi.py +0 -0
- {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev39}/tinybird/client.py +0 -0
- {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev39}/tinybird/config.py +0 -0
- {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev39}/tinybird/connectors.py +0 -0
- {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev39}/tinybird/context.py +0 -0
- {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev39}/tinybird/datafile.py +0 -0
- {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev39}/tinybird/datatypes.py +0 -0
- {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev39}/tinybird/feedback_manager.py +0 -0
- {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev39}/tinybird/git_settings.py +0 -0
- {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev39}/tinybird/prompts.py +0 -0
- {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev39}/tinybird/sql.py +0 -0
- {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev39}/tinybird/sql_template.py +0 -0
- {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev39}/tinybird/sql_template_fmt.py +0 -0
- {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev39}/tinybird/sql_toolset.py +0 -0
- {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev39}/tinybird/syncasync.py +0 -0
- {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev39}/tinybird/tb/cli.py +0 -0
- {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev39}/tinybird/tb/modules/auth.py +0 -0
- {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev39}/tinybird/tb/modules/build_client.py +0 -0
- {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev39}/tinybird/tb/modules/cicd.py +0 -0
- {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev39}/tinybird/tb/modules/cli.py +0 -0
- {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev39}/tinybird/tb/modules/common.py +0 -0
- {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev39}/tinybird/tb/modules/config.py +0 -0
- {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev39}/tinybird/tb/modules/copy.py +0 -0
- {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev39}/tinybird/tb/modules/create.py +0 -0
- {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev39}/tinybird/tb/modules/datafile/build.py +0 -0
- {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev39}/tinybird/tb/modules/datafile/build_common.py +0 -0
- {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev39}/tinybird/tb/modules/datafile/build_datasource.py +0 -0
- {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev39}/tinybird/tb/modules/datafile/build_pipe.py +0 -0
- {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev39}/tinybird/tb/modules/datafile/common.py +0 -0
- {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev39}/tinybird/tb/modules/datafile/diff.py +0 -0
- {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev39}/tinybird/tb/modules/datafile/exceptions.py +0 -0
- {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev39}/tinybird/tb/modules/datafile/fixture.py +0 -0
- {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev39}/tinybird/tb/modules/datafile/format_common.py +0 -0
- {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev39}/tinybird/tb/modules/datafile/format_datasource.py +0 -0
- {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev39}/tinybird/tb/modules/datafile/format_pipe.py +0 -0
- {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev39}/tinybird/tb/modules/datafile/parse_datasource.py +0 -0
- {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev39}/tinybird/tb/modules/datafile/parse_pipe.py +0 -0
- {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev39}/tinybird/tb/modules/datafile/pipe_checker.py +0 -0
- {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev39}/tinybird/tb/modules/datafile/pull.py +0 -0
- {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev39}/tinybird/tb/modules/datasource.py +0 -0
- {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev39}/tinybird/tb/modules/deployment.py +0 -0
- {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev39}/tinybird/tb/modules/endpoint.py +0 -0
- {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev39}/tinybird/tb/modules/exceptions.py +0 -0
- {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev39}/tinybird/tb/modules/feedback_manager.py +0 -0
- {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev39}/tinybird/tb/modules/fmt.py +0 -0
- {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev39}/tinybird/tb/modules/job.py +0 -0
- {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev39}/tinybird/tb/modules/llm.py +0 -0
- {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev39}/tinybird/tb/modules/llm_utils.py +0 -0
- {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev39}/tinybird/tb/modules/local.py +0 -0
- {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev39}/tinybird/tb/modules/login.py +0 -0
- {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev39}/tinybird/tb/modules/mock.py +0 -0
- {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev39}/tinybird/tb/modules/pipe.py +0 -0
- {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev39}/tinybird/tb/modules/project.py +0 -0
- {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev39}/tinybird/tb/modules/regions.py +0 -0
- {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev39}/tinybird/tb/modules/table.py +0 -0
- {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev39}/tinybird/tb/modules/tag.py +0 -0
- {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev39}/tinybird/tb/modules/telemetry.py +0 -0
- {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev39}/tinybird/tb/modules/tinyunit/tinyunit.py +0 -0
- {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev39}/tinybird/tb/modules/tinyunit/tinyunit_lib.py +0 -0
- {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev39}/tinybird/tb/modules/token.py +0 -0
- {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev39}/tinybird/tb/modules/update.py +0 -0
- {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev39}/tinybird/tb/modules/watch.py +0 -0
- {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev39}/tinybird/tb/modules/workspace.py +0 -0
- {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev39}/tinybird/tb/modules/workspace_members.py +0 -0
- {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev39}/tinybird/tb_cli.py +0 -0
- {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev39}/tinybird/tb_cli_modules/auth.py +0 -0
- {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev39}/tinybird/tb_cli_modules/branch.py +0 -0
- {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev39}/tinybird/tb_cli_modules/cicd.py +0 -0
- {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev39}/tinybird/tb_cli_modules/cli.py +0 -0
- {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev39}/tinybird/tb_cli_modules/common.py +0 -0
- {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev39}/tinybird/tb_cli_modules/config.py +0 -0
- {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev39}/tinybird/tb_cli_modules/connection.py +0 -0
- {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev39}/tinybird/tb_cli_modules/datasource.py +0 -0
- {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev39}/tinybird/tb_cli_modules/exceptions.py +0 -0
- {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev39}/tinybird/tb_cli_modules/fmt.py +0 -0
- {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev39}/tinybird/tb_cli_modules/job.py +0 -0
- {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev39}/tinybird/tb_cli_modules/pipe.py +0 -0
- {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev39}/tinybird/tb_cli_modules/regions.py +0 -0
- {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev39}/tinybird/tb_cli_modules/tag.py +0 -0
- {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev39}/tinybird/tb_cli_modules/telemetry.py +0 -0
- {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev39}/tinybird/tb_cli_modules/test.py +0 -0
- {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev39}/tinybird/tb_cli_modules/tinyunit/tinyunit.py +0 -0
- {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev39}/tinybird/tb_cli_modules/tinyunit/tinyunit_lib.py +0 -0
- {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev39}/tinybird/tb_cli_modules/workspace.py +0 -0
- {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev39}/tinybird/tb_cli_modules/workspace_members.py +0 -0
- {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev39}/tinybird/tornado_template.py +0 -0
- {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev39}/tinybird.egg-info/SOURCES.txt +0 -0
- {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev39}/tinybird.egg-info/dependency_links.txt +0 -0
- {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev39}/tinybird.egg-info/entry_points.txt +0 -0
- {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev39}/tinybird.egg-info/requires.txt +0 -0
- {tinybird-0.0.1.dev37 → tinybird-0.0.1.dev39}/tinybird.egg-info/top_level.txt +0 -0
|
@@ -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.dev39'
|
|
8
|
+
__revision__ = 'b1233f1'
|
|
@@ -16,7 +16,7 @@ from tinybird.tb.modules.datafile.fixture import build_fixture_name, get_fixture
|
|
|
16
16
|
from tinybird.tb.modules.feedback_manager import FeedbackManager
|
|
17
17
|
from tinybird.tb.modules.local_common import get_tinybird_local_client
|
|
18
18
|
from tinybird.tb.modules.project import Project
|
|
19
|
-
from tinybird.tb.modules.shell import Shell
|
|
19
|
+
from tinybird.tb.modules.shell import Shell, print_table_formatted
|
|
20
20
|
from tinybird.tb.modules.watch import watch_project
|
|
21
21
|
|
|
22
22
|
|
|
@@ -39,15 +39,20 @@ def build(ctx: click.Context, watch: bool) -> None:
|
|
|
39
39
|
rebuild_fixture(project, tb_client, file_changed)
|
|
40
40
|
else:
|
|
41
41
|
build_project(project, tb_client)
|
|
42
|
+
new_tb_client = asyncio.run(get_tinybird_local_client(str(project.path)))
|
|
43
|
+
try:
|
|
44
|
+
if file_changed:
|
|
45
|
+
build_and_print_resource(new_tb_client, file_changed)
|
|
46
|
+
except Exception:
|
|
47
|
+
pass
|
|
42
48
|
|
|
43
49
|
process()
|
|
44
|
-
|
|
45
50
|
time_end = time.time()
|
|
46
51
|
elapsed_time = time_end - time_start
|
|
47
52
|
click.echo(FeedbackManager.success(message=f"\n✓ Build completed in {elapsed_time:.1f}s"))
|
|
48
53
|
|
|
49
54
|
if watch:
|
|
50
|
-
shell = Shell(project=project
|
|
55
|
+
shell = Shell(project=project)
|
|
51
56
|
click.echo(FeedbackManager.gray(message="\nWatching for changes..."))
|
|
52
57
|
watcher_thread = threading.Thread(
|
|
53
58
|
target=watch_project,
|
|
@@ -83,7 +88,7 @@ def build_project(project: Project, tb_client: TinyB) -> None:
|
|
|
83
88
|
files.append((MULTIPART_BOUNDARY_DATA_PROJECT, (relative_path, fd.read().decode("utf-8"), content_type)))
|
|
84
89
|
HEADERS = {"Authorization": f"Bearer {TINYBIRD_API_KEY}"}
|
|
85
90
|
|
|
86
|
-
r = requests.post(TINYBIRD_API_URL, files=files, headers=HEADERS)
|
|
91
|
+
r = requests.post(TINYBIRD_API_URL, files=files, headers=HEADERS, data={"folder": str(project_path)})
|
|
87
92
|
try:
|
|
88
93
|
result = r.json()
|
|
89
94
|
except Exception as e:
|
|
@@ -109,19 +114,23 @@ def build_project(project: Project, tb_client: TinyB) -> None:
|
|
|
109
114
|
pipe_path = pipe_path.replace(f"{project.folder}/", "")
|
|
110
115
|
click.echo(FeedbackManager.info(message=f"✓ {pipe_path} created"))
|
|
111
116
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
117
|
+
try:
|
|
118
|
+
new_tb_client = asyncio.run(get_tinybird_local_client(str(project.path)))
|
|
119
|
+
for filename in project_files:
|
|
120
|
+
if filename.endswith(".datasource"):
|
|
121
|
+
ds_path = Path(filename)
|
|
122
|
+
ds_name = ds_path.stem
|
|
123
|
+
name = build_fixture_name(filename, ds_name, ds_path.read_text())
|
|
124
|
+
fixture_folder = get_fixture_dir(project.folder)
|
|
125
|
+
fixture_path = fixture_folder / f"{name}.ndjson"
|
|
119
126
|
|
|
120
|
-
|
|
121
|
-
|
|
127
|
+
if not fixture_path.exists():
|
|
128
|
+
fixture_path = fixture_folder / f"{ds_name}.ndjson"
|
|
122
129
|
|
|
123
|
-
|
|
124
|
-
|
|
130
|
+
if fixture_path.exists():
|
|
131
|
+
append_fixture(new_tb_client, ds_name, str(fixture_path))
|
|
132
|
+
except Exception:
|
|
133
|
+
pass
|
|
125
134
|
|
|
126
135
|
elif build_result == "failed":
|
|
127
136
|
click.echo(FeedbackManager.error(message="Build failed"))
|
|
@@ -158,8 +167,8 @@ def append_fixture(
|
|
|
158
167
|
)
|
|
159
168
|
|
|
160
169
|
|
|
161
|
-
def rebuild_fixture(project: Project, tb_client: TinyB,
|
|
162
|
-
fixture_path = Path(
|
|
170
|
+
def rebuild_fixture(project: Project, tb_client: TinyB, fixture: str) -> None:
|
|
171
|
+
fixture_path = Path(fixture)
|
|
163
172
|
datasources_path = Path(project.folder) / "datasources"
|
|
164
173
|
ds_name = fixture_path.stem
|
|
165
174
|
|
|
@@ -173,3 +182,11 @@ def rebuild_fixture(project: Project, tb_client: TinyB, fixture_path: str) -> No
|
|
|
173
182
|
|
|
174
183
|
if ds_path.exists():
|
|
175
184
|
append_fixture(tb_client, ds_name, str(fixture_path))
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
def build_and_print_resource(tb_client: TinyB, filename: str):
|
|
188
|
+
resource_path = Path(filename)
|
|
189
|
+
name = resource_path.stem
|
|
190
|
+
pipeline = name if filename.endswith(".pipe") else None
|
|
191
|
+
res = asyncio.run(tb_client.query(f"SELECT * FROM {name} FORMAT JSON", pipeline=pipeline))
|
|
192
|
+
print_table_formatted(res, name)
|
|
@@ -27,6 +27,7 @@ async def get_tinybird_local_config(path: Optional[str] = None) -> CLIConfig:
|
|
|
27
27
|
It uses the tokens from tinybird local
|
|
28
28
|
"""
|
|
29
29
|
config = CLIConfig.get_project_config(path)
|
|
30
|
+
|
|
30
31
|
try:
|
|
31
32
|
# ruff: noqa: ASYNC210
|
|
32
33
|
tokens = requests.get(f"{TB_LOCAL_HOST}/tokens").json()
|
|
@@ -40,15 +41,20 @@ async def get_tinybird_local_config(path: Optional[str] = None) -> CLIConfig:
|
|
|
40
41
|
if path:
|
|
41
42
|
folder_hash = hashlib.sha256(path.encode()).hexdigest()
|
|
42
43
|
user_client = config.get_client(host=TB_LOCAL_HOST, token=user_token)
|
|
43
|
-
|
|
44
44
|
ws_name = f"Tinybird_Local_Build_{folder_hash}"
|
|
45
45
|
logging.debug(f"Workspace used for build: {ws_name}")
|
|
46
46
|
|
|
47
|
-
user_workspaces =
|
|
48
|
-
|
|
47
|
+
user_workspaces = requests.get(f"{TB_LOCAL_HOST}/v0/user/workspaces?token={user_token}").json()
|
|
48
|
+
local_workspaces = [ws for ws in user_workspaces["workspaces"] if ws["name"].startswith(ws_name)]
|
|
49
|
+
local_workspaces = sorted(local_workspaces, key=lambda x: x["name"])
|
|
50
|
+
|
|
51
|
+
ws = None
|
|
52
|
+
if len(local_workspaces) > 0:
|
|
53
|
+
ws = local_workspaces[-1]
|
|
54
|
+
|
|
49
55
|
if not ws:
|
|
50
56
|
await user_client.create_workspace(ws_name, template=None)
|
|
51
|
-
user_workspaces =
|
|
57
|
+
user_workspaces = requests.get(f"{TB_LOCAL_HOST}/v0/user/workspaces?token={user_token}").json()
|
|
52
58
|
ws = next((ws for ws in user_workspaces["workspaces"] if ws["name"] == ws_name), None)
|
|
53
59
|
if not ws:
|
|
54
60
|
raise CLIException(f"Workspace {ws_name} not found after creation")
|
|
@@ -14,9 +14,9 @@ from prompt_toolkit.key_binding import KeyBindings
|
|
|
14
14
|
from prompt_toolkit.shortcuts import CompleteStyle
|
|
15
15
|
from prompt_toolkit.styles import Style
|
|
16
16
|
|
|
17
|
-
from tinybird.client import TinyB
|
|
18
17
|
from tinybird.tb.modules.exceptions import CLIException
|
|
19
18
|
from tinybird.tb.modules.feedback_manager import FeedbackManager, bcolors
|
|
19
|
+
from tinybird.tb.modules.local_common import get_tinybird_local_client
|
|
20
20
|
from tinybird.tb.modules.project import Project
|
|
21
21
|
from tinybird.tb.modules.table import format_table
|
|
22
22
|
|
|
@@ -174,10 +174,9 @@ def _(event):
|
|
|
174
174
|
|
|
175
175
|
|
|
176
176
|
class Shell:
|
|
177
|
-
def __init__(self, project: Project
|
|
177
|
+
def __init__(self, project: Project):
|
|
178
178
|
self.history = self.get_history()
|
|
179
179
|
self.project = project
|
|
180
|
-
self.client = client
|
|
181
180
|
self.prompt_message = "\ntb > "
|
|
182
181
|
self.commands = ["create", "mock", "test", "tb", "select"]
|
|
183
182
|
self.session: PromptSession = PromptSession(
|
|
@@ -286,8 +285,9 @@ class Shell:
|
|
|
286
285
|
loop = asyncio.new_event_loop()
|
|
287
286
|
asyncio.set_event_loop(loop)
|
|
288
287
|
try:
|
|
288
|
+
tb_client = asyncio.run(get_tinybird_local_client(str(self.project.path)))
|
|
289
289
|
return loop.run_until_complete(
|
|
290
|
-
|
|
290
|
+
tb_client.query(f"SELECT * FROM ({query}) LIMIT {rows_limit} FORMAT JSON")
|
|
291
291
|
)
|
|
292
292
|
finally:
|
|
293
293
|
loop.close()
|
|
@@ -23,6 +23,7 @@ from tinybird.tb.modules.feedback_manager import FeedbackManager
|
|
|
23
23
|
from tinybird.tb.modules.llm import LLM
|
|
24
24
|
from tinybird.tb.modules.llm_utils import extract_xml, parse_xml
|
|
25
25
|
from tinybird.tb.modules.local_common import get_tinybird_local_client
|
|
26
|
+
from tinybird.tb.modules.project import Project
|
|
26
27
|
|
|
27
28
|
yaml.SafeDumper.org_represent_str = yaml.SafeDumper.represent_str # type: ignore[attr-defined]
|
|
28
29
|
|
|
@@ -62,21 +63,18 @@ def test(ctx: click.Context) -> None:
|
|
|
62
63
|
help="Create a test for an existing pipe",
|
|
63
64
|
)
|
|
64
65
|
@click.argument("name_or_filename", type=str)
|
|
65
|
-
@click.option(
|
|
66
|
-
"--folder",
|
|
67
|
-
default=".",
|
|
68
|
-
type=click.Path(exists=True, file_okay=False),
|
|
69
|
-
help="Folder where datafiles will be placed",
|
|
70
|
-
)
|
|
71
66
|
@click.option(
|
|
72
67
|
"--prompt", type=str, default="Create a test for the selected pipe", help="Prompt to be used to create the test"
|
|
73
68
|
)
|
|
69
|
+
@click.pass_context
|
|
74
70
|
@coro
|
|
75
|
-
async def test_create(
|
|
71
|
+
async def test_create(ctx: click.Context, name_or_filename: str, prompt: str) -> None:
|
|
76
72
|
"""
|
|
77
73
|
Create a test for an existing pipe
|
|
78
74
|
"""
|
|
79
|
-
|
|
75
|
+
project: Project = ctx.ensure_object(dict)["project"]
|
|
76
|
+
root_path = Path(project.folder)
|
|
77
|
+
folder = project.folder
|
|
80
78
|
try:
|
|
81
79
|
if ".pipe" in name_or_filename:
|
|
82
80
|
pipe_path = Path(name_or_filename)
|
|
@@ -98,7 +96,7 @@ async def test_create(name_or_filename: str, prompt: str, folder: str) -> None:
|
|
|
98
96
|
pipe_path = root_path / pipe_path
|
|
99
97
|
pipe_content = pipe_path.read_text()
|
|
100
98
|
|
|
101
|
-
client = await get_tinybird_local_client(
|
|
99
|
+
client = await get_tinybird_local_client(folder)
|
|
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
|
|
|
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
|
|
File without changes
|
{tinybird-0.0.1.dev37 → tinybird-0.0.1.dev39}/tinybird/tb/modules/datafile/build_datasource.py
RENAMED
|
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.dev37 → tinybird-0.0.1.dev39}/tinybird/tb/modules/datafile/format_datasource.py
RENAMED
|
File without changes
|
|
File without changes
|
{tinybird-0.0.1.dev37 → tinybird-0.0.1.dev39}/tinybird/tb/modules/datafile/parse_datasource.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
|
|
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.dev37 → tinybird-0.0.1.dev39}/tinybird/tb_cli_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
|