tinybird 0.0.1.dev255__py3-none-any.whl → 0.0.1.dev257__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.

@@ -15,13 +15,13 @@ def plan(ctx: RunContext[TinybirdAgentContext], plan: str) -> str:
15
15
  """
16
16
  try:
17
17
  ctx.deps.thinking_animation.stop()
18
+ plan = plan.strip()
18
19
  click.echo(plan)
19
20
  confirmation = show_confirmation(
20
- title="Do you want to implement the plan?", skip_confirmation=ctx.deps.dangerously_skip_permissions
21
+ title="Do you want to continue with the plan?", skip_confirmation=ctx.deps.dangerously_skip_permissions
21
22
  )
22
23
 
23
24
  if confirmation == "review":
24
- click.echo()
25
25
  feedback = show_input(ctx.deps.workspace_name)
26
26
  ctx.deps.thinking_animation.start()
27
27
  return f"User did not confirm the proposed plan and gave the following feedback: {feedback}"
@@ -13,7 +13,7 @@ def request_endpoint(
13
13
  ctx: RunContext[TinybirdAgentContext],
14
14
  endpoint_name: str,
15
15
  params: Optional[dict[str, str]] = None,
16
- cloud: bool = True,
16
+ cloud: bool = False,
17
17
  ):
18
18
  """Request an endpoint:
19
19
 
@@ -28,10 +28,10 @@ def request_endpoint(
28
28
  try:
29
29
  cloud_or_local = "cloud" if cloud else "local"
30
30
  ctx.deps.thinking_animation.stop()
31
-
31
+ with_params = f" with params {params}" if params else ""
32
32
  click.echo(
33
33
  FeedbackManager.highlight(
34
- message=f"» Calling endpoint {endpoint_name} in {cloud_or_local} environment with params {params}"
34
+ message=f"» Calling endpoint {endpoint_name} in {cloud_or_local} environment{with_params}"
35
35
  )
36
36
  )
37
37
 
@@ -59,7 +59,8 @@ def request_endpoint(
59
59
  ctx.deps.thinking_animation.stop()
60
60
  click.echo(FeedbackManager.error(message=error))
61
61
  ctx.deps.thinking_animation.start()
62
- if "not found" in error.lower() and cloud:
62
+ not_found_errors = ["not found", "does not exist"]
63
+ if any(not_found_error in error.lower() for not_found_error in not_found_errors) and cloud:
63
64
  return f"Error executing query: {error}. Please run the query against Tinybird local instead of cloud."
64
65
  else:
65
66
  return f"Error executing query: {error}. Please try again."
@@ -39,7 +39,8 @@ class TinybirdAgentContext(BaseModel):
39
39
  deploy_project: Callable[[], None]
40
40
  deploy_check_project: Callable[[], None]
41
41
  mock_data: Callable[..., list[dict[str, Any]]]
42
- append_data: Callable[..., None]
42
+ append_data_local: Callable[..., None]
43
+ append_data_cloud: Callable[..., None]
43
44
  analyze_fixture: Callable[..., dict[str, Any]]
44
45
  execute_query_cloud: Callable[..., dict[str, Any]]
45
46
  execute_query_local: Callable[..., dict[str, Any]]
@@ -55,6 +56,8 @@ class TinybirdAgentContext(BaseModel):
55
56
  token: str
56
57
  user_token: str
57
58
  host: str
59
+ local_host: str
60
+ local_token: str
58
61
 
59
62
 
60
63
  default_style = PromptStyle.from_dict(
@@ -141,7 +144,7 @@ class InquirerControl(FormattedTextControl):
141
144
  tokens.append(
142
145
  (
143
146
  "",
144
- " \u276f " if selected else " ",
147
+ "\u276f " if selected else " ",
145
148
  )
146
149
  )
147
150
  if selected:
@@ -196,7 +199,7 @@ def prompt_question(message, **kwargs):
196
199
  def get_prompt_tokens():
197
200
  tokens = []
198
201
 
199
- tokens.append(("class:question", " %s " % message))
202
+ tokens.append(("class:question", "%s " % message))
200
203
  if ic.answered:
201
204
  tokens.append(("class:answer", " " + ic.get_selection()[0]))
202
205
  else:
@@ -87,8 +87,10 @@ agent_mode_flag = os.environ.get("TB_AGENT_MODE", "false") == "true"
87
87
  hidden=True,
88
88
  )
89
89
  @click.option(
90
- "--p",
91
- help="Run agent in print mode with the provided prompt and exit.",
90
+ "--prompt",
91
+ "-p",
92
+ help="Run agent in prompt mode with the provided input and exit.",
93
+ hidden=True,
92
94
  )
93
95
  @click.version_option(version=VERSION)
94
96
  @click.pass_context
@@ -105,7 +107,7 @@ def cli(
105
107
  output: str,
106
108
  max_depth: int,
107
109
  dangerously_skip_permissions: bool,
108
- p: Optional[str],
110
+ prompt: Optional[str] = None,
109
111
  ) -> None:
110
112
  """
111
113
  Use `OBFUSCATE_REGEX_PATTERN` and `OBFUSCATE_PATTERN_SEPARATOR` environment variables to define a regex pattern and a separator (in case of a single string with multiple regex) to obfuscate secrets in the CLI output.
@@ -166,7 +168,7 @@ def cli(
166
168
  user_token = os.environ.get("TB_USER_TOKEN", "")
167
169
 
168
170
  config = get_config(host, token, user_token=user_token, config_file=config_temp._path)
169
- client = _get_tb_client(config.get("token", None), config["host"])
171
+ client = _get_tb_client(config.get("token", ""), config["host"])
170
172
 
171
173
  # Calculate project folder path properly
172
174
  tinyb_dir = os.path.dirname(config_temp._path) # Directory containing .tinyb file
@@ -207,10 +209,10 @@ def cli(
207
209
  ctx.ensure_object(dict)["output"] = output
208
210
 
209
211
  is_agent_mode = agent_mode_flag and ctx.invoked_subcommand is None
210
- is_print_mode = p is not None
212
+ is_prompt_mode = prompt is not None
211
213
 
212
- if is_agent_mode or is_print_mode:
213
- run_agent(config, project, dangerously_skip_permissions, prompt=p)
214
+ if is_agent_mode or is_prompt_mode:
215
+ run_agent(config, project, dangerously_skip_permissions, prompt=prompt)
214
216
 
215
217
 
216
218
  @cli.command(hidden=True)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: tinybird
3
- Version: 0.0.1.dev255
3
+ Version: 0.0.1.dev257
4
4
  Summary: Tinybird Command Line Tool
5
5
  Home-page: https://www.tinybird.co/docs/forward/commands
6
6
  Author: Tinybird
@@ -21,7 +21,7 @@ Requires-Dist: GitPython~=3.1.32
21
21
  Requires-Dist: humanfriendly~=8.2
22
22
  Requires-Dist: prompt_toolkit==3.0.48
23
23
  Requires-Dist: pydantic~=2.11.7
24
- Requires-Dist: pydantic-ai-slim[anthropic]~=0.3.1
24
+ Requires-Dist: pydantic-ai-slim[anthropic]~=0.4.2
25
25
  Requires-Dist: pyperclip==1.8.2
26
26
  Requires-Dist: pyyaml<6.1,>=6.0
27
27
  Requires-Dist: requests<3,>=2.28.1
@@ -12,12 +12,12 @@ tinybird/syncasync.py,sha256=IPnOx6lMbf9SNddN1eBtssg8vCLHMt76SuZ6YNYm-Yk,27761
12
12
  tinybird/tornado_template.py,sha256=jjNVDMnkYFWXflmT8KU_Ssbo5vR8KQq3EJMk5vYgXRw,41959
13
13
  tinybird/ch_utils/constants.py,sha256=fPgZtwbr1ymxaW7uqVWHKmAbt7uGj3SxCCS3xsEMJqA,4151
14
14
  tinybird/ch_utils/engine.py,sha256=4X1B-iuhdW_mxKnX_m3iCsxgP9RPVgR75g7yH1vsJ6A,40851
15
- tinybird/datafile/common.py,sha256=J0Oydru3Nh3oCx66EEEHGxm2-r5_NfxvZxiFhBjgAH0,98428
15
+ tinybird/datafile/common.py,sha256=naXznRSAceD0T05YNj0Fdk7k-6WfKA6dz2GT0tiHj9k,98505
16
16
  tinybird/datafile/exceptions.py,sha256=8rw2umdZjtby85QbuRKFO5ETz_eRHwUY5l7eHsy1wnI,556
17
17
  tinybird/datafile/parse_connection.py,sha256=tRyn2Rpr1TeWet5BXmMoQgaotbGdYep1qiTak_OqC5E,1825
18
18
  tinybird/datafile/parse_datasource.py,sha256=ssW8QeFSgglVFi3sDZj_HgkJiTJ2069v2JgqnH3CkDE,1825
19
19
  tinybird/datafile/parse_pipe.py,sha256=xf4m0Tw44QWJzHzAm7Z7FwUoUUtr7noMYjU1NiWnX0k,3880
20
- tinybird/tb/__cli__.py,sha256=51Rg-OvKFWGEJgEjFVuc2XEUi5XT3bb5o8ZEUJ1bdhA,247
20
+ tinybird/tb/__cli__.py,sha256=938aavDUj8x4pLfFvmzos4pwkLQIFF_1swhbm0m5fi4,247
21
21
  tinybird/tb/check_pypi.py,sha256=Gp0HkHHDFMSDL6nxKlOY51z7z1Uv-2LRexNTZSHHGmM,552
22
22
  tinybird/tb/cli.py,sha256=FdDFEIayjmsZEVsVSSvRiVYn_FHOVg_zWQzchnzfWho,1008
23
23
  tinybird/tb/client.py,sha256=pJbdkWMXGAqKseNAvdsRRnl_c7I-DCMB0dWCQnG82nU,54146
@@ -25,7 +25,7 @@ tinybird/tb/config.py,sha256=mhMTGnMB5KcxGoh3dewIr2Jjsa6pHE183gCPAQWyp6o,3973
25
25
  tinybird/tb/modules/build.py,sha256=efD-vamK1NPaDo9R86Hn8be2DYoW0Hh5bZiH7knK5dk,7790
26
26
  tinybird/tb/modules/build_common.py,sha256=rWhemU8bk0ZE2eiwZDaTmV9cPabDGGlyc2WnRxfhT0M,12859
27
27
  tinybird/tb/modules/cicd.py,sha256=0KLKccha9IP749QvlXBmzdWv1On3mFwMY4DUcJlBxiE,7326
28
- tinybird/tb/modules/cli.py,sha256=1kErLFhxgMWldbE7P4-bkPUcug8ymRyXDHRG9-vGb_4,16755
28
+ tinybird/tb/modules/cli.py,sha256=yLRYSk0t2WuyzBclb6HLEXHdRN8ktvypemWiTy5VmDc,16809
29
29
  tinybird/tb/modules/common.py,sha256=tj6DR2yOqMMQ0PILwFGXmMogxdrbQCgj36HdSM611rs,82657
30
30
  tinybird/tb/modules/config.py,sha256=gK7rgaWTDd4ZKCrNEg_Uemr26EQjqWt6TjyQKujxOws,11462
31
31
  tinybird/tb/modules/connection.py,sha256=-MY56NUAai6EMC4-wpi7bT0_nz_SA8QzTmHkV7HB1IQ,17810
@@ -68,29 +68,29 @@ tinybird/tb/modules/watch.py,sha256=No0bK1M1_3CYuMaIgylxf7vYFJ72lTJe3brz6xQ-mJo,
68
68
  tinybird/tb/modules/workspace.py,sha256=Q_8HcxMsNg8QG9aBlwcWS2umrDP5IkTIHqqz3sfmGuc,11341
69
69
  tinybird/tb/modules/workspace_members.py,sha256=5JdkJgfuEwbq-t6vxkBhYwgsiTDxF790wsa6Xfif9nk,8608
70
70
  tinybird/tb/modules/agent/__init__.py,sha256=i3oe3vDIWWPaicdCM0zs7D7BJ1W0k7th93ooskHAV00,54
71
- tinybird/tb/modules/agent/agent.py,sha256=HtXB75QJ71YH21BdbWhx2Pb1c2KUFu1_3TfdVulCoh4,25349
71
+ tinybird/tb/modules/agent/agent.py,sha256=_xH4No8K0cRWTRyLBR5M5p9lt-nNsPszhhQ3uaGYuN8,22264
72
72
  tinybird/tb/modules/agent/animations.py,sha256=4WOC5_2BracttmMCrV0H91tXfWcUzQHBUaIJc5FA7tE,3490
73
73
  tinybird/tb/modules/agent/banner.py,sha256=KX_e467uiy1gWOZ4ofTZt0GCFGQqHQ_8Ob27XLQqda0,3053
74
- tinybird/tb/modules/agent/memory.py,sha256=H6SJK--2L5C87B7AJd_jMqsq3sCvFvZwZXmajuT0GBE,1171
74
+ tinybird/tb/modules/agent/memory.py,sha256=O6Kumn9AyKxcTkhI45yjAUZ3ZIAibLOcNWoiEuLYeqY,3245
75
75
  tinybird/tb/modules/agent/models.py,sha256=LW1D27gjcd_jwFmghEzteCgToDfodX2B6B5S8BYbysw,735
76
- tinybird/tb/modules/agent/prompts.py,sha256=qyAv3H1x9qctlYQSel0DHxLlRJM2_8HTg7M-foSoR0k,17567
77
- tinybird/tb/modules/agent/utils.py,sha256=5mUnc4LZATHLzQZThotNErzZdHQDwK3eur6W4NZULWA,26561
76
+ tinybird/tb/modules/agent/prompts.py,sha256=ee0EGMIhcxDF2-0uAtI2ApsDk1AM_0vLTx3LZfjX760,26122
77
+ tinybird/tb/modules/agent/utils.py,sha256=FEg9-TVCa4VN5wfz568pxO9xjgRQL94AJbPECdyvBsk,26648
78
78
  tinybird/tb/modules/agent/tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
79
79
  tinybird/tb/modules/agent/tools/analyze.py,sha256=7oxJ3waCS24Qja_k5GUB59_XiHTG9pCewZogOXhH0cA,3495
80
- tinybird/tb/modules/agent/tools/append.py,sha256=ekG7OxOzPjjjAjYUONAfp_PWlzyLT1GDfQhECgO-DYY,5065
81
- tinybird/tb/modules/agent/tools/build.py,sha256=LhzJMx6tbxC7gogIrxhfKJc-SDgoSR-FC6IunfaCdn8,758
82
- tinybird/tb/modules/agent/tools/create_datafile.py,sha256=wcPcChACTIFKw0lKFTlhm0sWJKhQkMLPLnGNpKyeETA,2962
83
- tinybird/tb/modules/agent/tools/deploy.py,sha256=WrsSlaufKGOBx0S13uoMQQH2DnKue5LQ231Rx4RXh2I,1443
84
- tinybird/tb/modules/agent/tools/deploy_check.py,sha256=LBE8aENYvCEaxbVTVKMSI2NGGiHeh-y60_MPlfrcvFk,1331
85
- tinybird/tb/modules/agent/tools/diff_resource.py,sha256=euKo_mD9FZHC1X6yESv3D_CXMzBMB8EWHLeZjIRqjJg,2637
86
- tinybird/tb/modules/agent/tools/execute_query.py,sha256=hMRahWZkyP9qa-nMGzY0Z7MjDa9sb5O9V1evmA_V_w8,2702
80
+ tinybird/tb/modules/agent/tools/append.py,sha256=4SSW1e8_2IMjXbzg8a7ljPXuhd6ugUv-3qZfT2QWZBk,5884
81
+ tinybird/tb/modules/agent/tools/build.py,sha256=wcndqnxwK4lDbL_3vTdoSNXiD5P4YG_CPWykj5lInuE,756
82
+ tinybird/tb/modules/agent/tools/create_datafile.py,sha256=QeL_1uS6_uDCIQjn94KAVqKhnyYp5YZD4ZmjXLbKwjM,4530
83
+ tinybird/tb/modules/agent/tools/deploy.py,sha256=2rbmDOczXERvjPUJ7s3X9GWZuOpsPeBabyTcG8D3fu8,1320
84
+ tinybird/tb/modules/agent/tools/deploy_check.py,sha256=u_l2iTrwUJDXe-M0IpgA672CAo_GWlCrdRcuUKXIC_Q,1132
85
+ tinybird/tb/modules/agent/tools/diff_resource.py,sha256=_9xHcDzCTKk_E1wKQbuktVqV6U9sA0kqYaBxWvtliX0,2613
86
+ tinybird/tb/modules/agent/tools/execute_query.py,sha256=h8be9_lhyMy7UZoCWrExigP-cbq3lLnlLHD9SzDGBCM,2703
87
87
  tinybird/tb/modules/agent/tools/explore.py,sha256=ihALc_kBcsjrKT3hZyicqyIowB0g_K3AtNNi-5uz9-8,412
88
- tinybird/tb/modules/agent/tools/get_endpoint_stats.py,sha256=E9yPi9LwnpsTyjFd8EaiSNvDGVPkFSNqp_tZxg_pWqs,1705
89
- tinybird/tb/modules/agent/tools/get_openapi_definition.py,sha256=9cQ-SUeB1NVhPJN1s8aQh9KQxqI9-DEEW1Ot5r2JbOk,1575
90
- tinybird/tb/modules/agent/tools/mock.py,sha256=4gEAPZCdTPo1w-fbryWiEx3hPXOK2ZfW0MpXY7smpcI,3408
91
- tinybird/tb/modules/agent/tools/plan.py,sha256=pr6LnItz6vlOeCG8GE459ExsrBEG0KLx-g02SZGNjXU,1217
88
+ tinybird/tb/modules/agent/tools/get_endpoint_stats.py,sha256=LiEK6ToyPDW2aI8ijclzuwdYAcFmwH-TyjqdFEzQWAc,1689
89
+ tinybird/tb/modules/agent/tools/get_openapi_definition.py,sha256=mjIVVXtgvTs5LzOR8Bp4jB1XhLVMysHrHXawkErFdt8,2282
90
+ tinybird/tb/modules/agent/tools/mock.py,sha256=mHkDyorD51Je3AteAX_JOC9mlyW9Ca4PCkxQVLrIGQA,4068
91
+ tinybird/tb/modules/agent/tools/plan.py,sha256=3_VBs5dc4nlCKH3TVzYldFBaEdFoW5EMzw9f3prMApk,1224
92
92
  tinybird/tb/modules/agent/tools/preview_datafile.py,sha256=Gbao_FxhXstnUnngVQxztpizjugyfx1rOXTkw7Yabls,858
93
- tinybird/tb/modules/agent/tools/request_endpoint.py,sha256=Jl64ln0Jspu_rmp3ycZabj-2IXkmWFSZxoCdcavRpQo,2687
93
+ tinybird/tb/modules/agent/tools/request_endpoint.py,sha256=xNYIEFI9sfq3SjevYqJaHH1EP6uEX5HHrbKS6qo3Imo,2852
94
94
  tinybird/tb/modules/datafile/build.py,sha256=NFKBrusFLU0WJNCXePAFWiEDuTaXpwc0lHlOQWEJ43s,51117
95
95
  tinybird/tb/modules/datafile/build_common.py,sha256=2yNdxe49IMA9wNvl25NemY2Iaz8L66snjOdT64dm1is,4511
96
96
  tinybird/tb/modules/datafile/build_datasource.py,sha256=Ra8pVQBDafbFRUKlhpgohhTsRyp_ADKZJVG8Gd69idY,17227
@@ -111,8 +111,8 @@ tinybird/tb_cli_modules/config.py,sha256=IsgdtFRnUrkY8-Zo32lmk6O7u3bHie1QCxLwgp4
111
111
  tinybird/tb_cli_modules/exceptions.py,sha256=pmucP4kTF4irIt7dXiG-FcnI-o3mvDusPmch1L8RCWk,3367
112
112
  tinybird/tb_cli_modules/regions.py,sha256=QjsL5H6Kg-qr0aYVLrvb1STeJ5Sx_sjvbOYO0LrEGMk,166
113
113
  tinybird/tb_cli_modules/telemetry.py,sha256=Hh2Io8ZPROSunbOLuMvuIFU4TqwWPmQTqal4WS09K1A,10449
114
- tinybird-0.0.1.dev255.dist-info/METADATA,sha256=oudst3Nwc1lfUUD-RID7T4ncAgcIuWnv5_VNlSjK08c,1733
115
- tinybird-0.0.1.dev255.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
116
- tinybird-0.0.1.dev255.dist-info/entry_points.txt,sha256=LwdHU6TfKx4Qs7BqqtaczEZbImgU7Abe9Lp920zb_fo,43
117
- tinybird-0.0.1.dev255.dist-info/top_level.txt,sha256=VqqqEmkAy7UNaD8-V51FCoMMWXjLUlR0IstvK7tJYVY,54
118
- tinybird-0.0.1.dev255.dist-info/RECORD,,
114
+ tinybird-0.0.1.dev257.dist-info/METADATA,sha256=Fm23QkZZZv5impoV4to_Ba2OGnznHGMtLYuZK6mHVc4,1733
115
+ tinybird-0.0.1.dev257.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
116
+ tinybird-0.0.1.dev257.dist-info/entry_points.txt,sha256=LwdHU6TfKx4Qs7BqqtaczEZbImgU7Abe9Lp920zb_fo,43
117
+ tinybird-0.0.1.dev257.dist-info/top_level.txt,sha256=VqqqEmkAy7UNaD8-V51FCoMMWXjLUlR0IstvK7tJYVY,54
118
+ tinybird-0.0.1.dev257.dist-info/RECORD,,