tinybird 0.0.1.dev40__tar.gz → 0.0.1.dev42__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.dev40 → tinybird-0.0.1.dev42}/PKG-INFO +1 -1
- {tinybird-0.0.1.dev40 → tinybird-0.0.1.dev42}/tinybird/prompts.py +32 -1
- {tinybird-0.0.1.dev40 → tinybird-0.0.1.dev42}/tinybird/tb/__cli__.py +2 -2
- {tinybird-0.0.1.dev40 → tinybird-0.0.1.dev42}/tinybird/tb/modules/build.py +6 -9
- {tinybird-0.0.1.dev40 → tinybird-0.0.1.dev42}/tinybird/tb/modules/create.py +16 -1
- {tinybird-0.0.1.dev40 → tinybird-0.0.1.dev42}/tinybird/tb/modules/shell.py +4 -4
- {tinybird-0.0.1.dev40 → tinybird-0.0.1.dev42}/tinybird.egg-info/PKG-INFO +1 -1
- {tinybird-0.0.1.dev40 → tinybird-0.0.1.dev42}/setup.cfg +0 -0
- {tinybird-0.0.1.dev40 → tinybird-0.0.1.dev42}/tinybird/__cli__.py +0 -0
- {tinybird-0.0.1.dev40 → tinybird-0.0.1.dev42}/tinybird/ch_utils/constants.py +0 -0
- {tinybird-0.0.1.dev40 → tinybird-0.0.1.dev42}/tinybird/ch_utils/engine.py +0 -0
- {tinybird-0.0.1.dev40 → tinybird-0.0.1.dev42}/tinybird/check_pypi.py +0 -0
- {tinybird-0.0.1.dev40 → tinybird-0.0.1.dev42}/tinybird/client.py +0 -0
- {tinybird-0.0.1.dev40 → tinybird-0.0.1.dev42}/tinybird/config.py +0 -0
- {tinybird-0.0.1.dev40 → tinybird-0.0.1.dev42}/tinybird/connectors.py +0 -0
- {tinybird-0.0.1.dev40 → tinybird-0.0.1.dev42}/tinybird/context.py +0 -0
- {tinybird-0.0.1.dev40 → tinybird-0.0.1.dev42}/tinybird/datafile.py +0 -0
- {tinybird-0.0.1.dev40 → tinybird-0.0.1.dev42}/tinybird/datatypes.py +0 -0
- {tinybird-0.0.1.dev40 → tinybird-0.0.1.dev42}/tinybird/feedback_manager.py +0 -0
- {tinybird-0.0.1.dev40 → tinybird-0.0.1.dev42}/tinybird/git_settings.py +0 -0
- {tinybird-0.0.1.dev40 → tinybird-0.0.1.dev42}/tinybird/sql.py +0 -0
- {tinybird-0.0.1.dev40 → tinybird-0.0.1.dev42}/tinybird/sql_template.py +0 -0
- {tinybird-0.0.1.dev40 → tinybird-0.0.1.dev42}/tinybird/sql_template_fmt.py +0 -0
- {tinybird-0.0.1.dev40 → tinybird-0.0.1.dev42}/tinybird/sql_toolset.py +0 -0
- {tinybird-0.0.1.dev40 → tinybird-0.0.1.dev42}/tinybird/syncasync.py +0 -0
- {tinybird-0.0.1.dev40 → tinybird-0.0.1.dev42}/tinybird/tb/cli.py +0 -0
- {tinybird-0.0.1.dev40 → tinybird-0.0.1.dev42}/tinybird/tb/modules/auth.py +0 -0
- {tinybird-0.0.1.dev40 → tinybird-0.0.1.dev42}/tinybird/tb/modules/build_client.py +0 -0
- {tinybird-0.0.1.dev40 → tinybird-0.0.1.dev42}/tinybird/tb/modules/cicd.py +0 -0
- {tinybird-0.0.1.dev40 → tinybird-0.0.1.dev42}/tinybird/tb/modules/cli.py +0 -0
- {tinybird-0.0.1.dev40 → tinybird-0.0.1.dev42}/tinybird/tb/modules/common.py +0 -0
- {tinybird-0.0.1.dev40 → tinybird-0.0.1.dev42}/tinybird/tb/modules/config.py +0 -0
- {tinybird-0.0.1.dev40 → tinybird-0.0.1.dev42}/tinybird/tb/modules/copy.py +0 -0
- {tinybird-0.0.1.dev40 → tinybird-0.0.1.dev42}/tinybird/tb/modules/datafile/build.py +0 -0
- {tinybird-0.0.1.dev40 → tinybird-0.0.1.dev42}/tinybird/tb/modules/datafile/build_common.py +0 -0
- {tinybird-0.0.1.dev40 → tinybird-0.0.1.dev42}/tinybird/tb/modules/datafile/build_datasource.py +0 -0
- {tinybird-0.0.1.dev40 → tinybird-0.0.1.dev42}/tinybird/tb/modules/datafile/build_pipe.py +0 -0
- {tinybird-0.0.1.dev40 → tinybird-0.0.1.dev42}/tinybird/tb/modules/datafile/common.py +0 -0
- {tinybird-0.0.1.dev40 → tinybird-0.0.1.dev42}/tinybird/tb/modules/datafile/diff.py +0 -0
- {tinybird-0.0.1.dev40 → tinybird-0.0.1.dev42}/tinybird/tb/modules/datafile/exceptions.py +0 -0
- {tinybird-0.0.1.dev40 → tinybird-0.0.1.dev42}/tinybird/tb/modules/datafile/fixture.py +0 -0
- {tinybird-0.0.1.dev40 → tinybird-0.0.1.dev42}/tinybird/tb/modules/datafile/format_common.py +0 -0
- {tinybird-0.0.1.dev40 → tinybird-0.0.1.dev42}/tinybird/tb/modules/datafile/format_datasource.py +0 -0
- {tinybird-0.0.1.dev40 → tinybird-0.0.1.dev42}/tinybird/tb/modules/datafile/format_pipe.py +0 -0
- {tinybird-0.0.1.dev40 → tinybird-0.0.1.dev42}/tinybird/tb/modules/datafile/parse_datasource.py +0 -0
- {tinybird-0.0.1.dev40 → tinybird-0.0.1.dev42}/tinybird/tb/modules/datafile/parse_pipe.py +0 -0
- {tinybird-0.0.1.dev40 → tinybird-0.0.1.dev42}/tinybird/tb/modules/datafile/pipe_checker.py +0 -0
- {tinybird-0.0.1.dev40 → tinybird-0.0.1.dev42}/tinybird/tb/modules/datafile/pull.py +0 -0
- {tinybird-0.0.1.dev40 → tinybird-0.0.1.dev42}/tinybird/tb/modules/datasource.py +0 -0
- {tinybird-0.0.1.dev40 → tinybird-0.0.1.dev42}/tinybird/tb/modules/deployment.py +0 -0
- {tinybird-0.0.1.dev40 → tinybird-0.0.1.dev42}/tinybird/tb/modules/endpoint.py +0 -0
- {tinybird-0.0.1.dev40 → tinybird-0.0.1.dev42}/tinybird/tb/modules/exceptions.py +0 -0
- {tinybird-0.0.1.dev40 → tinybird-0.0.1.dev42}/tinybird/tb/modules/feedback_manager.py +0 -0
- {tinybird-0.0.1.dev40 → tinybird-0.0.1.dev42}/tinybird/tb/modules/fmt.py +0 -0
- {tinybird-0.0.1.dev40 → tinybird-0.0.1.dev42}/tinybird/tb/modules/job.py +0 -0
- {tinybird-0.0.1.dev40 → tinybird-0.0.1.dev42}/tinybird/tb/modules/llm.py +0 -0
- {tinybird-0.0.1.dev40 → tinybird-0.0.1.dev42}/tinybird/tb/modules/llm_utils.py +0 -0
- {tinybird-0.0.1.dev40 → tinybird-0.0.1.dev42}/tinybird/tb/modules/local.py +0 -0
- {tinybird-0.0.1.dev40 → tinybird-0.0.1.dev42}/tinybird/tb/modules/local_common.py +0 -0
- {tinybird-0.0.1.dev40 → tinybird-0.0.1.dev42}/tinybird/tb/modules/login.py +0 -0
- {tinybird-0.0.1.dev40 → tinybird-0.0.1.dev42}/tinybird/tb/modules/mock.py +0 -0
- {tinybird-0.0.1.dev40 → tinybird-0.0.1.dev42}/tinybird/tb/modules/pipe.py +0 -0
- {tinybird-0.0.1.dev40 → tinybird-0.0.1.dev42}/tinybird/tb/modules/project.py +0 -0
- {tinybird-0.0.1.dev40 → tinybird-0.0.1.dev42}/tinybird/tb/modules/regions.py +0 -0
- {tinybird-0.0.1.dev40 → tinybird-0.0.1.dev42}/tinybird/tb/modules/table.py +0 -0
- {tinybird-0.0.1.dev40 → tinybird-0.0.1.dev42}/tinybird/tb/modules/tag.py +0 -0
- {tinybird-0.0.1.dev40 → tinybird-0.0.1.dev42}/tinybird/tb/modules/telemetry.py +0 -0
- {tinybird-0.0.1.dev40 → tinybird-0.0.1.dev42}/tinybird/tb/modules/test.py +0 -0
- {tinybird-0.0.1.dev40 → tinybird-0.0.1.dev42}/tinybird/tb/modules/tinyunit/tinyunit.py +0 -0
- {tinybird-0.0.1.dev40 → tinybird-0.0.1.dev42}/tinybird/tb/modules/tinyunit/tinyunit_lib.py +0 -0
- {tinybird-0.0.1.dev40 → tinybird-0.0.1.dev42}/tinybird/tb/modules/token.py +0 -0
- {tinybird-0.0.1.dev40 → tinybird-0.0.1.dev42}/tinybird/tb/modules/update.py +0 -0
- {tinybird-0.0.1.dev40 → tinybird-0.0.1.dev42}/tinybird/tb/modules/watch.py +0 -0
- {tinybird-0.0.1.dev40 → tinybird-0.0.1.dev42}/tinybird/tb/modules/workspace.py +0 -0
- {tinybird-0.0.1.dev40 → tinybird-0.0.1.dev42}/tinybird/tb/modules/workspace_members.py +0 -0
- {tinybird-0.0.1.dev40 → tinybird-0.0.1.dev42}/tinybird/tb_cli.py +0 -0
- {tinybird-0.0.1.dev40 → tinybird-0.0.1.dev42}/tinybird/tb_cli_modules/auth.py +0 -0
- {tinybird-0.0.1.dev40 → tinybird-0.0.1.dev42}/tinybird/tb_cli_modules/branch.py +0 -0
- {tinybird-0.0.1.dev40 → tinybird-0.0.1.dev42}/tinybird/tb_cli_modules/cicd.py +0 -0
- {tinybird-0.0.1.dev40 → tinybird-0.0.1.dev42}/tinybird/tb_cli_modules/cli.py +0 -0
- {tinybird-0.0.1.dev40 → tinybird-0.0.1.dev42}/tinybird/tb_cli_modules/common.py +0 -0
- {tinybird-0.0.1.dev40 → tinybird-0.0.1.dev42}/tinybird/tb_cli_modules/config.py +0 -0
- {tinybird-0.0.1.dev40 → tinybird-0.0.1.dev42}/tinybird/tb_cli_modules/connection.py +0 -0
- {tinybird-0.0.1.dev40 → tinybird-0.0.1.dev42}/tinybird/tb_cli_modules/datasource.py +0 -0
- {tinybird-0.0.1.dev40 → tinybird-0.0.1.dev42}/tinybird/tb_cli_modules/exceptions.py +0 -0
- {tinybird-0.0.1.dev40 → tinybird-0.0.1.dev42}/tinybird/tb_cli_modules/fmt.py +0 -0
- {tinybird-0.0.1.dev40 → tinybird-0.0.1.dev42}/tinybird/tb_cli_modules/job.py +0 -0
- {tinybird-0.0.1.dev40 → tinybird-0.0.1.dev42}/tinybird/tb_cli_modules/pipe.py +0 -0
- {tinybird-0.0.1.dev40 → tinybird-0.0.1.dev42}/tinybird/tb_cli_modules/regions.py +0 -0
- {tinybird-0.0.1.dev40 → tinybird-0.0.1.dev42}/tinybird/tb_cli_modules/tag.py +0 -0
- {tinybird-0.0.1.dev40 → tinybird-0.0.1.dev42}/tinybird/tb_cli_modules/telemetry.py +0 -0
- {tinybird-0.0.1.dev40 → tinybird-0.0.1.dev42}/tinybird/tb_cli_modules/test.py +0 -0
- {tinybird-0.0.1.dev40 → tinybird-0.0.1.dev42}/tinybird/tb_cli_modules/tinyunit/tinyunit.py +0 -0
- {tinybird-0.0.1.dev40 → tinybird-0.0.1.dev42}/tinybird/tb_cli_modules/tinyunit/tinyunit_lib.py +0 -0
- {tinybird-0.0.1.dev40 → tinybird-0.0.1.dev42}/tinybird/tb_cli_modules/workspace.py +0 -0
- {tinybird-0.0.1.dev40 → tinybird-0.0.1.dev42}/tinybird/tb_cli_modules/workspace_members.py +0 -0
- {tinybird-0.0.1.dev40 → tinybird-0.0.1.dev42}/tinybird/tornado_template.py +0 -0
- {tinybird-0.0.1.dev40 → tinybird-0.0.1.dev42}/tinybird.egg-info/SOURCES.txt +0 -0
- {tinybird-0.0.1.dev40 → tinybird-0.0.1.dev42}/tinybird.egg-info/dependency_links.txt +0 -0
- {tinybird-0.0.1.dev40 → tinybird-0.0.1.dev42}/tinybird.egg-info/entry_points.txt +0 -0
- {tinybird-0.0.1.dev40 → tinybird-0.0.1.dev42}/tinybird.egg-info/requires.txt +0 -0
- {tinybird-0.0.1.dev40 → tinybird-0.0.1.dev42}/tinybird.egg-info/top_level.txt +0 -0
|
@@ -371,10 +371,19 @@ You are a Tinybird expert. You will be given a pipe containing different nodes w
|
|
|
371
371
|
- The test command must be a valid Tinybird command that can be run in the terminal.
|
|
372
372
|
- The test command can have as many parameters as are needed to test the pipe.
|
|
373
373
|
- The parameter within Tinybird templating syntax looks like this one {{String(my_param_name, default_value)}}.
|
|
374
|
-
- If there are no parameters, you can omit parameters and generate a single test
|
|
374
|
+
- If there are no parameters, you can omit parameters and generate a single test.
|
|
375
375
|
- The format of the parameters is the following: ?param1=value1¶m2=value2¶m3=value3
|
|
376
376
|
</instructions>
|
|
377
377
|
|
|
378
|
+
This is an example of a test with parameters:
|
|
379
|
+
<example>
|
|
380
|
+
<test>
|
|
381
|
+
<name>kpis_date_range</name>
|
|
382
|
+
<description>Test specific date range with daily granularity</description>
|
|
383
|
+
<parameters>?date_from=2024-01-01&date_to=2024-01-10</parameters>
|
|
384
|
+
</test>
|
|
385
|
+
</example>
|
|
386
|
+
|
|
378
387
|
Follow the instructions and generate the following response with no additional text:
|
|
379
388
|
|
|
380
389
|
<response>
|
|
@@ -646,6 +655,7 @@ datasource_instructions = """
|
|
|
646
655
|
- No indentation is allowed for property names: DESCRIPTION, SCHEMA, ENGINE, ENGINE_PARTITION_KEY, ENGINE_SORTING_KEY, etc.
|
|
647
656
|
- Use MergeTree engine by default.
|
|
648
657
|
- Use AggregatingMergeTree engine when the datasource is the target of a materialized pipe.
|
|
658
|
+
- Use always json paths to define the schema. Example: `user_id` String `json:$.user_id`,
|
|
649
659
|
</datasource_file_instructions>
|
|
650
660
|
"""
|
|
651
661
|
|
|
@@ -779,3 +789,24 @@ Use the following format to generate the response and do not wrap it in any othe
|
|
|
779
789
|
copy_pipe_instructions=copy_pipe_instructions,
|
|
780
790
|
materialized_pipe_instructions=materialized_pipe_instructions,
|
|
781
791
|
)
|
|
792
|
+
|
|
793
|
+
|
|
794
|
+
cursorrules_prompt = """
|
|
795
|
+
You are an expert in SQL and Tinybird. Follow these instructions when working with .datasource and .pipe files:
|
|
796
|
+
|
|
797
|
+
{datasource_instructions}
|
|
798
|
+
{pipe_instructions}
|
|
799
|
+
{sql_instructions}
|
|
800
|
+
{datasource_example}
|
|
801
|
+
{pipe_example}
|
|
802
|
+
{copy_pipe_instructions}
|
|
803
|
+
{materialized_pipe_instructions}
|
|
804
|
+
""".format(
|
|
805
|
+
datasource_instructions=datasource_instructions,
|
|
806
|
+
pipe_instructions=pipe_instructions,
|
|
807
|
+
sql_instructions=sql_instructions,
|
|
808
|
+
datasource_example=datasource_example,
|
|
809
|
+
pipe_example=pipe_example,
|
|
810
|
+
copy_pipe_instructions=copy_pipe_instructions,
|
|
811
|
+
materialized_pipe_instructions=materialized_pipe_instructions,
|
|
812
|
+
)
|
|
@@ -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.dev42'
|
|
8
|
+
__revision__ = '14b255c'
|
|
@@ -36,13 +36,12 @@ def build(ctx: click.Context, watch: bool) -> None:
|
|
|
36
36
|
|
|
37
37
|
def process(file_changed: Optional[str] = None) -> None:
|
|
38
38
|
if file_changed and file_changed.endswith(".ndjson"):
|
|
39
|
-
rebuild_fixture(project, file_changed)
|
|
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
42
|
try:
|
|
44
43
|
if file_changed:
|
|
45
|
-
build_and_print_resource(
|
|
44
|
+
build_and_print_resource(tb_client, file_changed)
|
|
46
45
|
except Exception:
|
|
47
46
|
pass
|
|
48
47
|
|
|
@@ -52,7 +51,7 @@ def build(ctx: click.Context, watch: bool) -> None:
|
|
|
52
51
|
click.echo(FeedbackManager.success(message=f"\n✓ Build completed in {elapsed_time:.1f}s"))
|
|
53
52
|
|
|
54
53
|
if watch:
|
|
55
|
-
shell = Shell(project=project)
|
|
54
|
+
shell = Shell(project=project, tb_client=tb_client)
|
|
56
55
|
click.echo(FeedbackManager.gray(message="\nWatching for changes..."))
|
|
57
56
|
watcher_thread = threading.Thread(
|
|
58
57
|
target=watch_project,
|
|
@@ -88,7 +87,7 @@ def build_project(project: Project, tb_client: TinyB) -> None:
|
|
|
88
87
|
files.append((MULTIPART_BOUNDARY_DATA_PROJECT, (relative_path, fd.read().decode("utf-8"), content_type)))
|
|
89
88
|
HEADERS = {"Authorization": f"Bearer {TINYBIRD_API_KEY}"}
|
|
90
89
|
|
|
91
|
-
r = requests.post(TINYBIRD_API_URL, files=files, headers=HEADERS
|
|
90
|
+
r = requests.post(TINYBIRD_API_URL, files=files, headers=HEADERS)
|
|
92
91
|
try:
|
|
93
92
|
result = r.json()
|
|
94
93
|
except Exception as e:
|
|
@@ -115,7 +114,6 @@ def build_project(project: Project, tb_client: TinyB) -> None:
|
|
|
115
114
|
click.echo(FeedbackManager.info(message=f"✓ {pipe_path} created"))
|
|
116
115
|
|
|
117
116
|
try:
|
|
118
|
-
new_tb_client = asyncio.run(get_tinybird_local_client(str(project.path)))
|
|
119
117
|
for filename in project_files:
|
|
120
118
|
if filename.endswith(".datasource"):
|
|
121
119
|
ds_path = Path(filename)
|
|
@@ -128,7 +126,7 @@ def build_project(project: Project, tb_client: TinyB) -> None:
|
|
|
128
126
|
fixture_path = fixture_folder / f"{ds_name}.ndjson"
|
|
129
127
|
|
|
130
128
|
if fixture_path.exists():
|
|
131
|
-
append_fixture(
|
|
129
|
+
append_fixture(tb_client, ds_name, str(fixture_path))
|
|
132
130
|
except Exception:
|
|
133
131
|
pass
|
|
134
132
|
|
|
@@ -166,9 +164,8 @@ def append_fixture(
|
|
|
166
164
|
)
|
|
167
165
|
|
|
168
166
|
|
|
169
|
-
def rebuild_fixture(project: Project, fixture: str) -> None:
|
|
167
|
+
def rebuild_fixture(project: Project, tb_client: TinyB, fixture: str) -> None:
|
|
170
168
|
try:
|
|
171
|
-
tb_client = asyncio.run(get_tinybird_local_client(str(project.path)))
|
|
172
169
|
fixture_path = Path(fixture)
|
|
173
170
|
datasources_path = Path(project.folder) / "datasources"
|
|
174
171
|
ds_name = fixture_path.stem
|
|
@@ -7,7 +7,7 @@ from typing import Optional
|
|
|
7
7
|
import click
|
|
8
8
|
|
|
9
9
|
from tinybird.client import TinyB
|
|
10
|
-
from tinybird.prompts import create_prompt, mock_prompt
|
|
10
|
+
from tinybird.prompts import create_prompt, cursorrules_prompt, mock_prompt
|
|
11
11
|
from tinybird.tb.modules.cicd import init_cicd
|
|
12
12
|
from tinybird.tb.modules.cli import cli
|
|
13
13
|
from tinybird.tb.modules.common import _generate_datafile, check_user_token_with_client, coro, generate_datafile
|
|
@@ -40,12 +40,14 @@ from tinybird.tb.modules.local_common import get_tinybird_local_client
|
|
|
40
40
|
help="Folder where datafiles will be placed",
|
|
41
41
|
)
|
|
42
42
|
@click.option("--rows", type=int, default=10, help="Number of events to send")
|
|
43
|
+
@click.option("--cursor", default=False, is_flag=True, help="Create .cursorrules file with Tinybird rules")
|
|
43
44
|
@coro
|
|
44
45
|
async def create(
|
|
45
46
|
data: Optional[str],
|
|
46
47
|
prompt: Optional[str],
|
|
47
48
|
folder: Optional[str],
|
|
48
49
|
rows: int,
|
|
50
|
+
cursor: bool,
|
|
49
51
|
) -> None:
|
|
50
52
|
"""Initialize a new project."""
|
|
51
53
|
folder = folder or getcwd()
|
|
@@ -121,7 +123,11 @@ async def create(
|
|
|
121
123
|
persist_fixture(fixture_name, data, folder)
|
|
122
124
|
click.echo(FeedbackManager.info(message=f"✓ /fixtures/{datasource_name}"))
|
|
123
125
|
|
|
126
|
+
if cursor and not already_has_cursorrules(folder):
|
|
127
|
+
click.echo(FeedbackManager.highlight(message="\n» Creating .cursorrules..."))
|
|
128
|
+
create_cursorrules(folder)
|
|
124
129
|
click.echo(FeedbackManager.success(message="✓ Done!\n"))
|
|
130
|
+
|
|
125
131
|
except Exception as e:
|
|
126
132
|
click.echo(FeedbackManager.error(message=f"Error: {str(e)}"))
|
|
127
133
|
|
|
@@ -286,3 +292,12 @@ def generate_pipe_file(name: str, content: str, folder: str):
|
|
|
286
292
|
with open(f"{f}", "w") as file:
|
|
287
293
|
file.write(content)
|
|
288
294
|
click.echo(FeedbackManager.info_file_created(file=f.relative_to(folder)))
|
|
295
|
+
|
|
296
|
+
|
|
297
|
+
def already_has_cursorrules(folder: str) -> bool:
|
|
298
|
+
return (Path(folder) / ".cursorrules").exists()
|
|
299
|
+
|
|
300
|
+
|
|
301
|
+
def create_cursorrules(folder: str):
|
|
302
|
+
cursorrules_file = Path(folder) / ".cursorrules"
|
|
303
|
+
cursorrules_file.write_text(cursorrules_prompt)
|
|
@@ -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
|
|
17
18
|
from tinybird.tb.modules.exceptions import CLIException
|
|
18
19
|
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,9 +174,10 @@ def _(event):
|
|
|
174
174
|
|
|
175
175
|
|
|
176
176
|
class Shell:
|
|
177
|
-
def __init__(self, project: Project):
|
|
177
|
+
def __init__(self, project: Project, tb_client: TinyB):
|
|
178
178
|
self.history = self.get_history()
|
|
179
179
|
self.project = project
|
|
180
|
+
self.tb_client = tb_client
|
|
180
181
|
self.prompt_message = "\ntb > "
|
|
181
182
|
self.commands = ["create", "mock", "test", "tb", "select"]
|
|
182
183
|
self.session: PromptSession = PromptSession(
|
|
@@ -285,9 +286,8 @@ class Shell:
|
|
|
285
286
|
loop = asyncio.new_event_loop()
|
|
286
287
|
asyncio.set_event_loop(loop)
|
|
287
288
|
try:
|
|
288
|
-
tb_client = asyncio.run(get_tinybird_local_client(str(self.project.path)))
|
|
289
289
|
return loop.run_until_complete(
|
|
290
|
-
tb_client.query(f"SELECT * FROM ({query}) LIMIT {rows_limit} FORMAT JSON")
|
|
290
|
+
self.tb_client.query(f"SELECT * FROM ({query}) LIMIT {rows_limit} FORMAT JSON")
|
|
291
291
|
)
|
|
292
292
|
finally:
|
|
293
293
|
loop.close()
|
|
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.dev40 → tinybird-0.0.1.dev42}/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.dev40 → tinybird-0.0.1.dev42}/tinybird/tb/modules/datafile/format_datasource.py
RENAMED
|
File without changes
|
|
File without changes
|
{tinybird-0.0.1.dev40 → tinybird-0.0.1.dev42}/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
|
|
File without changes
|
|
File without changes
|
{tinybird-0.0.1.dev40 → tinybird-0.0.1.dev42}/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
|