tinybird 0.0.1.dev8__tar.gz → 0.0.1.dev9__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.dev8 → tinybird-0.0.1.dev9}/PKG-INFO +1 -1
- {tinybird-0.0.1.dev8 → tinybird-0.0.1.dev9}/tinybird/tb/modules/build.py +21 -3
- {tinybird-0.0.1.dev8 → tinybird-0.0.1.dev9}/tinybird/tb/modules/create.py +14 -2
- {tinybird-0.0.1.dev8 → tinybird-0.0.1.dev9}/tinybird.egg-info/PKG-INFO +1 -1
- {tinybird-0.0.1.dev8 → tinybird-0.0.1.dev9}/setup.cfg +0 -0
- {tinybird-0.0.1.dev8 → tinybird-0.0.1.dev9}/tinybird/__cli__.py +0 -0
- {tinybird-0.0.1.dev8 → tinybird-0.0.1.dev9}/tinybird/ch_utils/constants.py +0 -0
- {tinybird-0.0.1.dev8 → tinybird-0.0.1.dev9}/tinybird/ch_utils/engine.py +0 -0
- {tinybird-0.0.1.dev8 → tinybird-0.0.1.dev9}/tinybird/check_pypi.py +0 -0
- {tinybird-0.0.1.dev8 → tinybird-0.0.1.dev9}/tinybird/client.py +0 -0
- {tinybird-0.0.1.dev8 → tinybird-0.0.1.dev9}/tinybird/config.py +0 -0
- {tinybird-0.0.1.dev8 → tinybird-0.0.1.dev9}/tinybird/connectors.py +0 -0
- {tinybird-0.0.1.dev8 → tinybird-0.0.1.dev9}/tinybird/context.py +0 -0
- {tinybird-0.0.1.dev8 → tinybird-0.0.1.dev9}/tinybird/datafile.py +0 -0
- {tinybird-0.0.1.dev8 → tinybird-0.0.1.dev9}/tinybird/datatypes.py +0 -0
- {tinybird-0.0.1.dev8 → tinybird-0.0.1.dev9}/tinybird/feedback_manager.py +0 -0
- {tinybird-0.0.1.dev8 → tinybird-0.0.1.dev9}/tinybird/git_settings.py +0 -0
- {tinybird-0.0.1.dev8 → tinybird-0.0.1.dev9}/tinybird/sql.py +0 -0
- {tinybird-0.0.1.dev8 → tinybird-0.0.1.dev9}/tinybird/sql_template.py +0 -0
- {tinybird-0.0.1.dev8 → tinybird-0.0.1.dev9}/tinybird/sql_template_fmt.py +0 -0
- {tinybird-0.0.1.dev8 → tinybird-0.0.1.dev9}/tinybird/sql_toolset.py +0 -0
- {tinybird-0.0.1.dev8 → tinybird-0.0.1.dev9}/tinybird/syncasync.py +0 -0
- {tinybird-0.0.1.dev8 → tinybird-0.0.1.dev9}/tinybird/tb/cli.py +0 -0
- {tinybird-0.0.1.dev8 → tinybird-0.0.1.dev9}/tinybird/tb/modules/auth.py +0 -0
- {tinybird-0.0.1.dev8 → tinybird-0.0.1.dev9}/tinybird/tb/modules/branch.py +0 -0
- {tinybird-0.0.1.dev8 → tinybird-0.0.1.dev9}/tinybird/tb/modules/cicd.py +0 -0
- {tinybird-0.0.1.dev8 → tinybird-0.0.1.dev9}/tinybird/tb/modules/cli.py +0 -0
- {tinybird-0.0.1.dev8 → tinybird-0.0.1.dev9}/tinybird/tb/modules/common.py +0 -0
- {tinybird-0.0.1.dev8 → tinybird-0.0.1.dev9}/tinybird/tb/modules/config.py +0 -0
- {tinybird-0.0.1.dev8 → tinybird-0.0.1.dev9}/tinybird/tb/modules/connection.py +0 -0
- {tinybird-0.0.1.dev8 → tinybird-0.0.1.dev9}/tinybird/tb/modules/datafile/build.py +0 -0
- {tinybird-0.0.1.dev8 → tinybird-0.0.1.dev9}/tinybird/tb/modules/datafile/build_common.py +0 -0
- {tinybird-0.0.1.dev8 → tinybird-0.0.1.dev9}/tinybird/tb/modules/datafile/build_datasource.py +0 -0
- {tinybird-0.0.1.dev8 → tinybird-0.0.1.dev9}/tinybird/tb/modules/datafile/build_pipe.py +0 -0
- {tinybird-0.0.1.dev8 → tinybird-0.0.1.dev9}/tinybird/tb/modules/datafile/common.py +0 -0
- {tinybird-0.0.1.dev8 → tinybird-0.0.1.dev9}/tinybird/tb/modules/datafile/diff.py +0 -0
- {tinybird-0.0.1.dev8 → tinybird-0.0.1.dev9}/tinybird/tb/modules/datafile/exceptions.py +0 -0
- {tinybird-0.0.1.dev8 → tinybird-0.0.1.dev9}/tinybird/tb/modules/datafile/format_common.py +0 -0
- {tinybird-0.0.1.dev8 → tinybird-0.0.1.dev9}/tinybird/tb/modules/datafile/format_datasource.py +0 -0
- {tinybird-0.0.1.dev8 → tinybird-0.0.1.dev9}/tinybird/tb/modules/datafile/format_pipe.py +0 -0
- {tinybird-0.0.1.dev8 → tinybird-0.0.1.dev9}/tinybird/tb/modules/datafile/parse_datasource.py +0 -0
- {tinybird-0.0.1.dev8 → tinybird-0.0.1.dev9}/tinybird/tb/modules/datafile/parse_pipe.py +0 -0
- {tinybird-0.0.1.dev8 → tinybird-0.0.1.dev9}/tinybird/tb/modules/datafile/pipe_checker.py +0 -0
- {tinybird-0.0.1.dev8 → tinybird-0.0.1.dev9}/tinybird/tb/modules/datafile/pull.py +0 -0
- {tinybird-0.0.1.dev8 → tinybird-0.0.1.dev9}/tinybird/tb/modules/datasource.py +0 -0
- {tinybird-0.0.1.dev8 → tinybird-0.0.1.dev9}/tinybird/tb/modules/exceptions.py +0 -0
- {tinybird-0.0.1.dev8 → tinybird-0.0.1.dev9}/tinybird/tb/modules/fmt.py +0 -0
- {tinybird-0.0.1.dev8 → tinybird-0.0.1.dev9}/tinybird/tb/modules/job.py +0 -0
- {tinybird-0.0.1.dev8 → tinybird-0.0.1.dev9}/tinybird/tb/modules/llm.py +0 -0
- {tinybird-0.0.1.dev8 → tinybird-0.0.1.dev9}/tinybird/tb/modules/local.py +0 -0
- {tinybird-0.0.1.dev8 → tinybird-0.0.1.dev9}/tinybird/tb/modules/mock.py +0 -0
- {tinybird-0.0.1.dev8 → tinybird-0.0.1.dev9}/tinybird/tb/modules/pipe.py +0 -0
- {tinybird-0.0.1.dev8 → tinybird-0.0.1.dev9}/tinybird/tb/modules/prompts.py +0 -0
- {tinybird-0.0.1.dev8 → tinybird-0.0.1.dev9}/tinybird/tb/modules/regions.py +0 -0
- {tinybird-0.0.1.dev8 → tinybird-0.0.1.dev9}/tinybird/tb/modules/table.py +0 -0
- {tinybird-0.0.1.dev8 → tinybird-0.0.1.dev9}/tinybird/tb/modules/tag.py +0 -0
- {tinybird-0.0.1.dev8 → tinybird-0.0.1.dev9}/tinybird/tb/modules/telemetry.py +0 -0
- {tinybird-0.0.1.dev8 → tinybird-0.0.1.dev9}/tinybird/tb/modules/test.py +0 -0
- {tinybird-0.0.1.dev8 → tinybird-0.0.1.dev9}/tinybird/tb/modules/tinyunit/tinyunit.py +0 -0
- {tinybird-0.0.1.dev8 → tinybird-0.0.1.dev9}/tinybird/tb/modules/tinyunit/tinyunit_lib.py +0 -0
- {tinybird-0.0.1.dev8 → tinybird-0.0.1.dev9}/tinybird/tb/modules/token.py +0 -0
- {tinybird-0.0.1.dev8 → tinybird-0.0.1.dev9}/tinybird/tb/modules/workspace.py +0 -0
- {tinybird-0.0.1.dev8 → tinybird-0.0.1.dev9}/tinybird/tb/modules/workspace_members.py +0 -0
- {tinybird-0.0.1.dev8 → tinybird-0.0.1.dev9}/tinybird/tb_cli.py +0 -0
- {tinybird-0.0.1.dev8 → tinybird-0.0.1.dev9}/tinybird/tb_cli_modules/auth.py +0 -0
- {tinybird-0.0.1.dev8 → tinybird-0.0.1.dev9}/tinybird/tb_cli_modules/branch.py +0 -0
- {tinybird-0.0.1.dev8 → tinybird-0.0.1.dev9}/tinybird/tb_cli_modules/cicd.py +0 -0
- {tinybird-0.0.1.dev8 → tinybird-0.0.1.dev9}/tinybird/tb_cli_modules/cli.py +0 -0
- {tinybird-0.0.1.dev8 → tinybird-0.0.1.dev9}/tinybird/tb_cli_modules/common.py +0 -0
- {tinybird-0.0.1.dev8 → tinybird-0.0.1.dev9}/tinybird/tb_cli_modules/config.py +0 -0
- {tinybird-0.0.1.dev8 → tinybird-0.0.1.dev9}/tinybird/tb_cli_modules/connection.py +0 -0
- {tinybird-0.0.1.dev8 → tinybird-0.0.1.dev9}/tinybird/tb_cli_modules/datasource.py +0 -0
- {tinybird-0.0.1.dev8 → tinybird-0.0.1.dev9}/tinybird/tb_cli_modules/exceptions.py +0 -0
- {tinybird-0.0.1.dev8 → tinybird-0.0.1.dev9}/tinybird/tb_cli_modules/fmt.py +0 -0
- {tinybird-0.0.1.dev8 → tinybird-0.0.1.dev9}/tinybird/tb_cli_modules/job.py +0 -0
- {tinybird-0.0.1.dev8 → tinybird-0.0.1.dev9}/tinybird/tb_cli_modules/pipe.py +0 -0
- {tinybird-0.0.1.dev8 → tinybird-0.0.1.dev9}/tinybird/tb_cli_modules/regions.py +0 -0
- {tinybird-0.0.1.dev8 → tinybird-0.0.1.dev9}/tinybird/tb_cli_modules/tag.py +0 -0
- {tinybird-0.0.1.dev8 → tinybird-0.0.1.dev9}/tinybird/tb_cli_modules/telemetry.py +0 -0
- {tinybird-0.0.1.dev8 → tinybird-0.0.1.dev9}/tinybird/tb_cli_modules/test.py +0 -0
- {tinybird-0.0.1.dev8 → tinybird-0.0.1.dev9}/tinybird/tb_cli_modules/tinyunit/tinyunit.py +0 -0
- {tinybird-0.0.1.dev8 → tinybird-0.0.1.dev9}/tinybird/tb_cli_modules/tinyunit/tinyunit_lib.py +0 -0
- {tinybird-0.0.1.dev8 → tinybird-0.0.1.dev9}/tinybird/tb_cli_modules/workspace.py +0 -0
- {tinybird-0.0.1.dev8 → tinybird-0.0.1.dev9}/tinybird/tb_cli_modules/workspace_members.py +0 -0
- {tinybird-0.0.1.dev8 → tinybird-0.0.1.dev9}/tinybird/tornado_template.py +0 -0
- {tinybird-0.0.1.dev8 → tinybird-0.0.1.dev9}/tinybird.egg-info/SOURCES.txt +0 -0
- {tinybird-0.0.1.dev8 → tinybird-0.0.1.dev9}/tinybird.egg-info/dependency_links.txt +0 -0
- {tinybird-0.0.1.dev8 → tinybird-0.0.1.dev9}/tinybird.egg-info/entry_points.txt +0 -0
- {tinybird-0.0.1.dev8 → tinybird-0.0.1.dev9}/tinybird.egg-info/requires.txt +0 -0
- {tinybird-0.0.1.dev8 → tinybird-0.0.1.dev9}/tinybird.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import asyncio
|
|
2
2
|
import os
|
|
3
3
|
import random
|
|
4
|
+
import subprocess
|
|
5
|
+
import threading
|
|
4
6
|
import time
|
|
5
7
|
from pathlib import Path
|
|
6
8
|
from typing import Any, Awaitable, Callable, List, Union
|
|
@@ -14,6 +16,7 @@ import tinybird.context as context
|
|
|
14
16
|
from tinybird.client import TinyB
|
|
15
17
|
from tinybird.config import FeatureFlags
|
|
16
18
|
from tinybird.feedback_manager import FeedbackManager, bcolors
|
|
19
|
+
from tinybird.syncasync import sync_to_async
|
|
17
20
|
from tinybird.tb.modules.cli import cli
|
|
18
21
|
from tinybird.tb.modules.common import (
|
|
19
22
|
coro,
|
|
@@ -58,7 +61,7 @@ def watch_files(
|
|
|
58
61
|
elapsed_time = time_end - time_start
|
|
59
62
|
click.echo(
|
|
60
63
|
FeedbackManager.success(message="\n✓ ")
|
|
61
|
-
+ FeedbackManager.gray(message=f"Rebuild completed in {elapsed_time:.1f}s")
|
|
64
|
+
+ FeedbackManager.gray(message=f"Rebuild completed in {elapsed_time:.1f}s\n")
|
|
62
65
|
)
|
|
63
66
|
|
|
64
67
|
event_handler = FileChangeHandler(filenames, lambda f: asyncio.run(process_wrapper(f)))
|
|
@@ -161,8 +164,23 @@ async def build(
|
|
|
161
164
|
await build_once(filenames)
|
|
162
165
|
|
|
163
166
|
if watch:
|
|
164
|
-
click.echo(FeedbackManager.highlight(message="◎ Watching for changes
|
|
165
|
-
watch_files(filenames, process)
|
|
167
|
+
click.echo(FeedbackManager.highlight(message="◎ Watching for changes...\n"))
|
|
168
|
+
watcher_thread = threading.Thread(target=watch_files, args=(filenames, process), daemon=True)
|
|
169
|
+
watcher_thread.start()
|
|
170
|
+
|
|
171
|
+
# Main CLI loop
|
|
172
|
+
while True:
|
|
173
|
+
user_input = click.prompt("", prompt_suffix="")
|
|
174
|
+
if user_input.lower() == "exit":
|
|
175
|
+
break
|
|
176
|
+
|
|
177
|
+
if "tb build" in user_input:
|
|
178
|
+
click.echo(FeedbackManager.error(message="Build command is already running"))
|
|
179
|
+
else:
|
|
180
|
+
# Process the user command
|
|
181
|
+
await sync_to_async(subprocess.run, thread_sensitive=True)(user_input, shell=True, text=True)
|
|
182
|
+
|
|
183
|
+
click.echo(FeedbackManager.highlight(message="\n◎ Watching for changes...\n"))
|
|
166
184
|
|
|
167
185
|
|
|
168
186
|
async def build_and_print_pipe(tb_client: TinyB, filename: str):
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import json
|
|
1
2
|
import os
|
|
2
3
|
from os import getcwd
|
|
3
4
|
from pathlib import Path
|
|
@@ -39,6 +40,7 @@ from tinybird.tb.modules.local import (
|
|
|
39
40
|
type=click.Path(exists=True, file_okay=False),
|
|
40
41
|
help="Folder where datafiles will be placed",
|
|
41
42
|
)
|
|
43
|
+
@click.option("--rows", type=int, default=100, help="Number of events to send")
|
|
42
44
|
@click.pass_context
|
|
43
45
|
@coro
|
|
44
46
|
async def create(
|
|
@@ -46,9 +48,9 @@ async def create(
|
|
|
46
48
|
data: Optional[str],
|
|
47
49
|
prompt: Optional[str],
|
|
48
50
|
folder: Optional[str],
|
|
51
|
+
rows: int,
|
|
49
52
|
) -> None:
|
|
50
53
|
"""Initialize a new project."""
|
|
51
|
-
click.echo(FeedbackManager.gray(message="Setting up Tinybird Local"))
|
|
52
54
|
folder = folder or getcwd()
|
|
53
55
|
try:
|
|
54
56
|
tb_client = get_tinybird_local_client()
|
|
@@ -72,7 +74,17 @@ async def create(
|
|
|
72
74
|
datasource_content = datasource_path.read_text()
|
|
73
75
|
has_json_path = "`json:" in datasource_content
|
|
74
76
|
if has_json_path:
|
|
75
|
-
await llm.generate_sql_sample_data(tb_client, datasource_name, datasource_content)
|
|
77
|
+
sql = await llm.generate_sql_sample_data(tb_client, datasource_name, datasource_content, rows)
|
|
78
|
+
result = await tb_client.query(f"{sql} FORMAT JSON")
|
|
79
|
+
data = result.get("data", [])
|
|
80
|
+
max_rows_per_request = 100
|
|
81
|
+
sent_rows = 0
|
|
82
|
+
for i in range(0, len(data), max_rows_per_request):
|
|
83
|
+
batch = data[i : i + max_rows_per_request]
|
|
84
|
+
ndjson_data = "\n".join([json.dumps(row) for row in batch])
|
|
85
|
+
await tb_client.datasource_events(datasource_name, ndjson_data)
|
|
86
|
+
sent_rows += len(batch)
|
|
87
|
+
click.echo(f"Sent {sent_rows} rows to datasource '{datasource_name}'")
|
|
76
88
|
click.echo(FeedbackManager.success(message="\n✓ Tinybird Local is ready!"))
|
|
77
89
|
except Exception as e:
|
|
78
90
|
click.echo(FeedbackManager.error(message=f"Error: {str(e)}"))
|
|
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.dev8 → tinybird-0.0.1.dev9}/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
|
{tinybird-0.0.1.dev8 → tinybird-0.0.1.dev9}/tinybird/tb/modules/datafile/format_datasource.py
RENAMED
|
File without changes
|
|
File without changes
|
{tinybird-0.0.1.dev8 → tinybird-0.0.1.dev9}/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
|
{tinybird-0.0.1.dev8 → tinybird-0.0.1.dev9}/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
|