tinybird 0.0.1.dev299__py3-none-any.whl → 0.0.1.dev300__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.

@@ -630,7 +630,10 @@ class Datafile:
630
630
  def _validate_single_column(self, col_name: str, column_info: Dict[str, Any]) -> None:
631
631
  """Validate a single column for use in sorting keys."""
632
632
  col_type = column_info.get("type", "").lower()
633
- is_nullable = column_info.get("nullable", False)
633
+
634
+ # we need to check any presence of Nullable in the column type
635
+ is_nullable = column_info.get("nullable", False) or "Nullable(" in column_info.get("type", "")
636
+
634
637
  if is_nullable:
635
638
  raise DatafileValidationError(
636
639
  f"Sorting key contains nullable column '{col_name}'. Nullable columns cannot be used in sorting keys."
@@ -428,6 +428,34 @@ def get_tinybird_service_datasources() -> List[Dict[str, Any]]:
428
428
  {"name": "total_cpu_time_seconds", "type": "Float64"},
429
429
  ],
430
430
  },
431
+ {
432
+ "name": "tinybird.llm_usage",
433
+ "description": "LLM usage metrics from Tinybird AI features including token consumption, costs, and model usage for each request in the workspace.",
434
+ "dateColumn": "start_time",
435
+ "engine": {
436
+ "engine": "MergeTree",
437
+ "sorting_key": "workspace_id, start_time, user_email, request_id",
438
+ "partition_key": "toYYYYMM(start_time)",
439
+ },
440
+ "columns": [
441
+ {"name": "start_time", "type": "DateTime"},
442
+ {"name": "end_time", "type": "DateTime"},
443
+ {"name": "organization_id", "type": "String"},
444
+ {"name": "organization_name", "type": "String"},
445
+ {"name": "workspace_id", "type": "String"},
446
+ {"name": "workspace_name", "type": "String"},
447
+ {"name": "user_email", "type": "String"},
448
+ {"name": "request_id", "type": "String"},
449
+ {"name": "model", "type": "LowCardinality(String)"},
450
+ {"name": "prompt_tokens", "type": "UInt32"},
451
+ {"name": "completion_tokens", "type": "UInt32"},
452
+ {"name": "total_tokens", "type": "UInt32"},
453
+ {"name": "duration", "type": "Float32"},
454
+ {"name": "cost", "type": "Float32"},
455
+ {"name": "origin", "type": "String"},
456
+ {"name": "feature", "type": "String"},
457
+ ],
458
+ },
431
459
  ]
432
460
 
433
461
 
@@ -881,6 +909,34 @@ def get_organization_service_datasources() -> List[Dict[str, Any]]:
881
909
  {"name": "total_written_bytes", "type": "UInt64"},
882
910
  ],
883
911
  },
912
+ {
913
+ "name": "organization.llm_usage",
914
+ "description": "LLM usage metrics from Tinybird AI features including token consumption, costs, and model usage for each request in the organization.",
915
+ "dateColumn": "start_time",
916
+ "engine": {
917
+ "engine": "MergeTree",
918
+ "sorting_key": "workspace_id, start_time, user_email, request_id",
919
+ "partition_key": "toYYYYMM(start_time)",
920
+ },
921
+ "columns": [
922
+ {"name": "start_time", "type": "DateTime"},
923
+ {"name": "end_time", "type": "DateTime"},
924
+ {"name": "organization_id", "type": "String"},
925
+ {"name": "organization_name", "type": "String"},
926
+ {"name": "workspace_id", "type": "String"},
927
+ {"name": "workspace_name", "type": "String"},
928
+ {"name": "user_email", "type": "String"},
929
+ {"name": "request_id", "type": "String"},
930
+ {"name": "model", "type": "LowCardinality(String)"},
931
+ {"name": "prompt_tokens", "type": "UInt32"},
932
+ {"name": "completion_tokens", "type": "UInt32"},
933
+ {"name": "total_tokens", "type": "UInt32"},
934
+ {"name": "duration", "type": "Float32"},
935
+ {"name": "cost", "type": "Float32"},
936
+ {"name": "origin", "type": "String"},
937
+ {"name": "feature", "type": "String"},
938
+ ],
939
+ },
884
940
  ]
885
941
 
886
942
 
tinybird/tb/__cli__.py CHANGED
@@ -4,5 +4,5 @@ __description__ = 'Tinybird Command Line Tool'
4
4
  __url__ = 'https://www.tinybird.co/docs/forward/commands'
5
5
  __author__ = 'Tinybird'
6
6
  __author_email__ = 'support@tinybird.co'
7
- __version__ = '0.0.1.dev299'
8
- __revision__ = '7e8ff36'
7
+ __version__ = '0.0.1.dev300'
8
+ __revision__ = '9791d55'
@@ -2,8 +2,8 @@ from pathlib import Path
2
2
 
3
3
  import click
4
4
  import requests
5
-
6
5
  from docker.client import DockerClient
6
+
7
7
  from tinybird.tb.modules.cli import cli
8
8
  from tinybird.tb.modules.common import update_cli
9
9
  from tinybird.tb.modules.feedback_manager import FeedbackManager
@@ -11,10 +11,10 @@ from typing import Any, Dict, Optional
11
11
  import boto3
12
12
  import click
13
13
  import requests
14
-
15
- import docker
16
14
  from docker.client import DockerClient
17
15
  from docker.models.containers import Container
16
+
17
+ import docker
18
18
  from tinybird.tb.client import AuthNoTokenException, TinyB
19
19
  from tinybird.tb.modules.config import CLIConfig
20
20
  from tinybird.tb.modules.exceptions import CLILocalException
@@ -1169,7 +1169,7 @@ def check_valid_expr(expr):
1169
1169
  check_valid_expr(expr.slice.lower)
1170
1170
  if expr.slice.upper is not None:
1171
1171
  check_valid_expr(expr.slice.upper)
1172
- elif isinstance(expr.slice, ast.Constant) or isinstance(expr.slice, ast.Subscript):
1172
+ elif isinstance(expr.slice, (ast.Constant, ast.Subscript)):
1173
1173
  check_valid_expr(expr.slice)
1174
1174
  else:
1175
1175
  raise SecurityException(f"Invalid Slice expression: {ast.dump(expr.slice)}")
@@ -1178,7 +1178,7 @@ def check_valid_expr(expr):
1178
1178
  check_valid_expr(key)
1179
1179
  for value in expr.values:
1180
1180
  check_valid_expr(value)
1181
- elif isinstance(expr, ast.Tuple) or isinstance(expr, ast.List) or isinstance(expr, ast.Set):
1181
+ elif isinstance(expr, (ast.Tuple, ast.List, ast.Set)):
1182
1182
  for x in expr.elts:
1183
1183
  check_valid_expr(x)
1184
1184
  elif isinstance(expr, ast.JoinedStr):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: tinybird
3
- Version: 0.0.1.dev299
3
+ Version: 0.0.1.dev300
4
4
  Summary: Tinybird Command Line Tool
5
5
  Home-page: https://www.tinybird.co/docs/forward/commands
6
6
  Author: Tinybird
@@ -13,7 +13,7 @@ Requires-Dist: boto3
13
13
  Requires-Dist: click<8.2,>=8.1.6
14
14
  Requires-Dist: clickhouse-toolset==0.34.dev0
15
15
  Requires-Dist: colorama==0.4.6
16
- Requires-Dist: confluent-kafka==2.8.0
16
+ Requires-Dist: confluent-kafka==2.8.2
17
17
  Requires-Dist: cryptography~=41.0.0
18
18
  Requires-Dist: croniter==1.3.15
19
19
  Requires-Dist: docker==7.1.0
@@ -25,7 +25,7 @@ Requires-Dist: logfire-api==4.2.0
25
25
  Requires-Dist: pydantic~=2.11.7
26
26
  Requires-Dist: pydantic-ai-slim[anthropic]~=0.5.0
27
27
  Requires-Dist: pydantic-ai-slim[retries]~=0.5.0
28
- Requires-Dist: pyperclip==1.8.2
28
+ Requires-Dist: pyperclip==1.9.0
29
29
  Requires-Dist: pyyaml<6.1,>=6.0
30
30
  Requires-Dist: requests<3,>=2.28.1
31
31
  Requires-Dist: shandy-sqlfmt==0.11.1
@@ -4,21 +4,21 @@ tinybird/datatypes.py,sha256=r4WCvspmrXTJHiPjjyOTiZyZl31FO3Ynkwq4LQsYm6E,11059
4
4
  tinybird/feedback_manager.py,sha256=XY8d83pRlq-LH7xHMApkaEebfXEWLjDzrGe1prpcTHE,69778
5
5
  tinybird/git_settings.py,sha256=Sw_8rGmribEFJ4Z_6idrVytxpFYk7ez8ei0qHULzs3E,3934
6
6
  tinybird/prompts.py,sha256=HoDv9TxPiP8v2XoGTWYxP133dK9CEbXVv4XE5IT339c,45483
7
- tinybird/service_datasources.py,sha256=o6Az3T6OvcChR_7GXRu7sJH173KzGg1Gv-dNd0bI_vY,46085
7
+ tinybird/service_datasources.py,sha256=zpQJxgmV9iZwa6PLjF1oMmXYNHFTld-FrKkN4r69sv8,49052
8
8
  tinybird/sql.py,sha256=7pkwQMUVy0CH5zFgLMZyCx1BeaJSQYC05EmOb9vO3Ls,48694
9
9
  tinybird/sql_template.py,sha256=rNePArEmx5GemxW6GJAiNnln0NRWncGgFe0EbC8G2f4,102463
10
10
  tinybird/sql_template_fmt.py,sha256=KUHdj5rYCYm_rKKdXYSJAE9vIyXUQLB0YSZnUXHeBlY,10196
11
11
  tinybird/sql_toolset.py,sha256=Y2_fQrbk5GSNoRncAmRS_snpV61XQbiOy4uYkeF6pr4,19767
12
12
  tinybird/syncasync.py,sha256=IPnOx6lMbf9SNddN1eBtssg8vCLHMt76SuZ6YNYm-Yk,27761
13
- tinybird/tornado_template.py,sha256=jjNVDMnkYFWXflmT8KU_Ssbo5vR8KQq3EJMk5vYgXRw,41959
13
+ tinybird/tornado_template.py,sha256=ADKooqQfXHIwPcypILvpQpd1mrt7HGBa9r4MmsbcuJs,41897
14
14
  tinybird/ch_utils/constants.py,sha256=yTNizMzgYNBzUc2EV3moBfdrDIggOe9hiuAgWF7sv2c,4333
15
15
  tinybird/ch_utils/engine.py,sha256=4X1B-iuhdW_mxKnX_m3iCsxgP9RPVgR75g7yH1vsJ6A,40851
16
- tinybird/datafile/common.py,sha256=hr9Qv4Xot21l2dW6xKPa5_JUu8pnGuDNnVpDf8pgthc,105659
16
+ tinybird/datafile/common.py,sha256=_76V_oaKYFwTivBYUNM1JaAh8YLnkAuyJMVl5O8SU04,105778
17
17
  tinybird/datafile/exceptions.py,sha256=8rw2umdZjtby85QbuRKFO5ETz_eRHwUY5l7eHsy1wnI,556
18
18
  tinybird/datafile/parse_connection.py,sha256=tRyn2Rpr1TeWet5BXmMoQgaotbGdYep1qiTak_OqC5E,1825
19
19
  tinybird/datafile/parse_datasource.py,sha256=ssW8QeFSgglVFi3sDZj_HgkJiTJ2069v2JgqnH3CkDE,1825
20
20
  tinybird/datafile/parse_pipe.py,sha256=8e9LMecSQVWHC4AXf8cdxoQ1nxUR4fTObYxTctO_EXQ,3816
21
- tinybird/tb/__cli__.py,sha256=9xQZS6K0YDCjiorgU1hjPlnG_m1PzNU9a3uRw5TdU1A,247
21
+ tinybird/tb/__cli__.py,sha256=kmXWs7vrFSKf5ehCuYtRgMNypconz5KmXGqxZKS23P0,247
22
22
  tinybird/tb/check_pypi.py,sha256=Gp0HkHHDFMSDL6nxKlOY51z7z1Uv-2LRexNTZSHHGmM,552
23
23
  tinybird/tb/cli.py,sha256=FdDFEIayjmsZEVsVSSvRiVYn_FHOVg_zWQzchnzfWho,1008
24
24
  tinybird/tb/client.py,sha256=IQRaInDjOwr9Fzaz3_xXc3aUGqh94tM2lew7IZbB9eM,53733
@@ -45,8 +45,8 @@ tinybird/tb/modules/infra.py,sha256=JE9oLIyF4bi_JBoe-BgZ5HhKp_lQgSihuSV1KIS02Qs,
45
45
  tinybird/tb/modules/job.py,sha256=wBsnu8UPTOha2rkLvucgmw4xYv73ubmui3eeSIF68ZM,3107
46
46
  tinybird/tb/modules/llm.py,sha256=fPBBCmM3KlCksLlgJkg4joDn6y3H5QjDzE-Pm4YNf7E,1782
47
47
  tinybird/tb/modules/llm_utils.py,sha256=nS9r4FAElJw8yXtmdYrx-rtI2zXR8qXfi1QqUDCfxvg,3469
48
- tinybird/tb/modules/local.py,sha256=kW3IHwJPvhBsa1eMh_xzow9Az3yYpHthkzsLSHeP5HE,6512
49
- tinybird/tb/modules/local_common.py,sha256=vHgFIH7cLNX6085iCls_grj_Dud_yRegr9Zia5Fgtgw,18528
48
+ tinybird/tb/modules/local.py,sha256=cez8ZV7Gt9F1siz54dpgtynEw-il3Y9mNcQgEtOVvmw,6512
49
+ tinybird/tb/modules/local_common.py,sha256=KhALzU0L3AC56vqs3peBe-dqGzw5hWkOg_CfS0skohk,18528
50
50
  tinybird/tb/modules/login.py,sha256=zerXZqIv15pbFk5XRt746xGcVnp01YmL_403byBf4jQ,1245
51
51
  tinybird/tb/modules/login_common.py,sha256=CKXD_BjivhGUmBtNbLTJwzQDr6885C72XPZjo0GLLvI,12010
52
52
  tinybird/tb/modules/logout.py,sha256=sniI4JNxpTrVeRCp0oGJuQ3yRerG4hH5uz6oBmjv724,1009
@@ -121,8 +121,8 @@ tinybird/tb_cli_modules/config.py,sha256=IsgdtFRnUrkY8-Zo32lmk6O7u3bHie1QCxLwgp4
121
121
  tinybird/tb_cli_modules/exceptions.py,sha256=pmucP4kTF4irIt7dXiG-FcnI-o3mvDusPmch1L8RCWk,3367
122
122
  tinybird/tb_cli_modules/regions.py,sha256=QjsL5H6Kg-qr0aYVLrvb1STeJ5Sx_sjvbOYO0LrEGMk,166
123
123
  tinybird/tb_cli_modules/telemetry.py,sha256=Hh2Io8ZPROSunbOLuMvuIFU4TqwWPmQTqal4WS09K1A,10449
124
- tinybird-0.0.1.dev299.dist-info/METADATA,sha256=jyFm0Dv3xSAaUqQjb4IyV9Yj2V4rjxYOL-Wqo5MAsa8,1845
125
- tinybird-0.0.1.dev299.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
126
- tinybird-0.0.1.dev299.dist-info/entry_points.txt,sha256=LwdHU6TfKx4Qs7BqqtaczEZbImgU7Abe9Lp920zb_fo,43
127
- tinybird-0.0.1.dev299.dist-info/top_level.txt,sha256=VqqqEmkAy7UNaD8-V51FCoMMWXjLUlR0IstvK7tJYVY,54
128
- tinybird-0.0.1.dev299.dist-info/RECORD,,
124
+ tinybird-0.0.1.dev300.dist-info/METADATA,sha256=yAfqcIHVKoPkyppgAcTSTcSSQ_xehIQ3mEN-bfu8VEY,1845
125
+ tinybird-0.0.1.dev300.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
126
+ tinybird-0.0.1.dev300.dist-info/entry_points.txt,sha256=LwdHU6TfKx4Qs7BqqtaczEZbImgU7Abe9Lp920zb_fo,43
127
+ tinybird-0.0.1.dev300.dist-info/top_level.txt,sha256=VqqqEmkAy7UNaD8-V51FCoMMWXjLUlR0IstvK7tJYVY,54
128
+ tinybird-0.0.1.dev300.dist-info/RECORD,,