tinybird 0.0.1.dev40__py3-none-any.whl → 0.0.1.dev41__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/prompts.py CHANGED
@@ -646,6 +646,7 @@ datasource_instructions = """
646
646
  - No indentation is allowed for property names: DESCRIPTION, SCHEMA, ENGINE, ENGINE_PARTITION_KEY, ENGINE_SORTING_KEY, etc.
647
647
  - Use MergeTree engine by default.
648
648
  - Use AggregatingMergeTree engine when the datasource is the target of a materialized pipe.
649
+ - Use always json paths to define the schema. Example: `user_id` String `json:$.user_id`,
649
650
  </datasource_file_instructions>
650
651
  """
651
652
 
@@ -779,3 +780,24 @@ Use the following format to generate the response and do not wrap it in any othe
779
780
  copy_pipe_instructions=copy_pipe_instructions,
780
781
  materialized_pipe_instructions=materialized_pipe_instructions,
781
782
  )
783
+
784
+
785
+ cursorrules_prompt = """
786
+ You are an expert in SQL and Tinybird. Follow these instructions when working with .datasource and .pipe files:
787
+
788
+ {datasource_instructions}
789
+ {pipe_instructions}
790
+ {sql_instructions}
791
+ {datasource_example}
792
+ {pipe_example}
793
+ {copy_pipe_instructions}
794
+ {materialized_pipe_instructions}
795
+ """.format(
796
+ datasource_instructions=datasource_instructions,
797
+ pipe_instructions=pipe_instructions,
798
+ sql_instructions=sql_instructions,
799
+ datasource_example=datasource_example,
800
+ pipe_example=pipe_example,
801
+ copy_pipe_instructions=copy_pipe_instructions,
802
+ materialized_pipe_instructions=materialized_pipe_instructions,
803
+ )
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.dev40'
8
- __revision__ = '4f6c174'
7
+ __version__ = '0.0.1.dev41'
8
+ __revision__ = '86b5c65'
@@ -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)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: tinybird
3
- Version: 0.0.1.dev40
3
+ Version: 0.0.1.dev41
4
4
  Summary: Tinybird Command Line Tool
5
5
  Home-page: https://www.tinybird.co/docs/cli/introduction.html
6
6
  Author: Tinybird
@@ -6,7 +6,7 @@ tinybird/context.py,sha256=A3GBApac9xO6hrAMJ1s9dMrI_ou9aKF84CdEjtPddMk,1417
6
6
  tinybird/datatypes.py,sha256=XNypumfqNjsvLJ5iNXnbVHRvAJe0aQwI3lS6Cxox-e0,10979
7
7
  tinybird/feedback_manager.py,sha256=ON5Zu-G3-QDVfH2i_P-V4EtyhlNtAzyp1YDZsnce0_U,67826
8
8
  tinybird/git_settings.py,sha256=Sw_8rGmribEFJ4Z_6idrVytxpFYk7ez8ei0qHULzs3E,3934
9
- tinybird/prompts.py,sha256=EDQXikdLUFK0TvDsT7ROKcbAKNOyUC2JhX_Ff5GN_Sg,24515
9
+ tinybird/prompts.py,sha256=2UdLOCjIWbLINI1TuUSDXOW2T0YaPD0RHZAa26j6VlE,25247
10
10
  tinybird/sql.py,sha256=eulpRe05ZFrKFrxYawgxDxxrktFE8uL6hSL1gHIWKyg,46166
11
11
  tinybird/sql_template.py,sha256=GmMLAI10MTqjQo9qztuQHLRWs67teozsWDxUBdvkAn4,93668
12
12
  tinybird/sql_template_fmt.py,sha256=1z-PuqSZXtzso8Z_mPqUc-NxIxUrNUcVIPezNieZk-M,10196
@@ -15,7 +15,7 @@ tinybird/syncasync.py,sha256=IPnOx6lMbf9SNddN1eBtssg8vCLHMt76SuZ6YNYm-Yk,27761
15
15
  tinybird/tornado_template.py,sha256=oflXyoL2LSCegvl6bAzqw2JIqRaN5WPjhYYDtQcfuOE,41869
16
16
  tinybird/ch_utils/constants.py,sha256=aYvg2C_WxYWsnqPdZB1ZFoIr8ZY-XjUXYyHKE9Ansj0,3890
17
17
  tinybird/ch_utils/engine.py,sha256=OXkBhlzGjZotjD0vaT-rFIbSGV4tpiHxE8qO_ip0SyQ,40454
18
- tinybird/tb/__cli__.py,sha256=PAQF5s6_WEF5_AUzS6gZHRr7FVd3KcOTXI-X-Beaa_g,251
18
+ tinybird/tb/__cli__.py,sha256=Py43Okm6MRi1REBHdZBS-rEI97DI49FulIJwEZXDzhs,251
19
19
  tinybird/tb/cli.py,sha256=_kYDnDS3a45MMKJFZnYZx1gLuVqs4N_Rt8GO4sueAeg,957
20
20
  tinybird/tb/modules/auth.py,sha256=EzRWFmwRkXNhUmRaruEVFLdkbUg8xMSix0cAWl5D4Jg,9029
21
21
  tinybird/tb/modules/build.py,sha256=N1I_MWPChBdfrFMcHdIbsTbMrGSNDBPBmhv2xSLsoWw,7500
@@ -25,7 +25,7 @@ tinybird/tb/modules/cli.py,sha256=hD_mUAXtUofU20UC9j8Pzc4QI1gV0Y9Zefwe24T-qZA,19
25
25
  tinybird/tb/modules/common.py,sha256=e4U7AT0dUBG6O-7Iq2CVN1UHPd6-ZCFucyW0L5gBi4g,70592
26
26
  tinybird/tb/modules/config.py,sha256=mie3oMVTf5YOUFEiLs88P16U4LkJafJjSpjwyAkFHog,10979
27
27
  tinybird/tb/modules/copy.py,sha256=qrtU1PFXmu-xhq1LR2uo7-1MoCOOQeVb_j10vcasXmI,2415
28
- tinybird/tb/modules/create.py,sha256=x-lXLlr9d0kvkdqHbioA0m-hgutRXWeJS_pjJjoqrFM,10854
28
+ tinybird/tb/modules/create.py,sha256=iUYt5XG-GPwE3LnHrWqlOHmke0Bv8VMPxjAffxRFYoQ,11438
29
29
  tinybird/tb/modules/datasource.py,sha256=-VG2qKlu0fmkhsIB5bPiTp3XuktB_r-ZkIoohEBEXtI,13713
30
30
  tinybird/tb/modules/deployment.py,sha256=fCWHlfMrAbHLst_-pveH6oPHPnDsXqv1bAkzoFtxvEM,9597
31
31
  tinybird/tb/modules/endpoint.py,sha256=iYSWzi3_VJzHcq1_j_Hv4cfG1GFKXKxqEY4jLjKhxag,6488
@@ -75,8 +75,8 @@ tinybird/tb_cli_modules/config.py,sha256=6u6B5QCdiQLbJkCkwtnKGs9H3nP-KXXhC75mF7B
75
75
  tinybird/tb_cli_modules/exceptions.py,sha256=pmucP4kTF4irIt7dXiG-FcnI-o3mvDusPmch1L8RCWk,3367
76
76
  tinybird/tb_cli_modules/regions.py,sha256=QjsL5H6Kg-qr0aYVLrvb1STeJ5Sx_sjvbOYO0LrEGMk,166
77
77
  tinybird/tb_cli_modules/telemetry.py,sha256=iEGnMuCuNhvF6ln__j6X9MSTwL_0Hm-GgFHHHvhfknk,10466
78
- tinybird-0.0.1.dev40.dist-info/METADATA,sha256=-SL3t1aF0EYwE17Sifa5_QKjjRezBVaKsfRnP6nspNU,2482
79
- tinybird-0.0.1.dev40.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
80
- tinybird-0.0.1.dev40.dist-info/entry_points.txt,sha256=LwdHU6TfKx4Qs7BqqtaczEZbImgU7Abe9Lp920zb_fo,43
81
- tinybird-0.0.1.dev40.dist-info/top_level.txt,sha256=pgw6AzERHBcW3YTi2PW4arjxLkulk2msOz_SomfOEuc,45
82
- tinybird-0.0.1.dev40.dist-info/RECORD,,
78
+ tinybird-0.0.1.dev41.dist-info/METADATA,sha256=VrfRatTvL5BvgKELZsK-vEW6vu_4_5cbWnWf7Penawo,2482
79
+ tinybird-0.0.1.dev41.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
80
+ tinybird-0.0.1.dev41.dist-info/entry_points.txt,sha256=LwdHU6TfKx4Qs7BqqtaczEZbImgU7Abe9Lp920zb_fo,43
81
+ tinybird-0.0.1.dev41.dist-info/top_level.txt,sha256=pgw6AzERHBcW3YTi2PW4arjxLkulk2msOz_SomfOEuc,45
82
+ tinybird-0.0.1.dev41.dist-info/RECORD,,