tinybird 4.3.3.dev0__tar.gz → 4.4.1.dev0__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.
Files changed (126) hide show
  1. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/PKG-INFO +6 -1
  2. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/client.py +7 -1
  3. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/datafile/common.py +55 -41
  4. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/service_datasources.py +25 -18
  5. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/tb/__cli__.py +2 -2
  6. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/tb/client.py +8 -1
  7. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/tb/modules/copy.py +15 -2
  8. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/tb_cli_modules/pipe.py +14 -2
  9. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird.egg-info/PKG-INFO +6 -1
  10. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/setup.cfg +0 -0
  11. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/__cli__.py +0 -0
  12. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/ch_utils/constants.py +0 -0
  13. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/ch_utils/engine.py +0 -0
  14. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/check_pypi.py +0 -0
  15. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/config.py +0 -0
  16. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/context.py +0 -0
  17. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/datafile/exceptions.py +0 -0
  18. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/datafile/parse_connection.py +0 -0
  19. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/datafile/parse_datasource.py +0 -0
  20. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/datafile/parse_pipe.py +0 -0
  21. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/datatypes.py +0 -0
  22. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/feedback_manager.py +0 -0
  23. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/git_settings.py +0 -0
  24. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/prompts.py +0 -0
  25. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/sql.py +0 -0
  26. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/sql_template.py +0 -0
  27. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/sql_template_fmt.py +0 -0
  28. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/sql_toolset.py +0 -0
  29. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/syncasync.py +0 -0
  30. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/tb/check_pypi.py +0 -0
  31. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/tb/cli.py +0 -0
  32. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/tb/config.py +0 -0
  33. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/tb/modules/branch.py +0 -0
  34. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/tb/modules/build.py +0 -0
  35. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/tb/modules/build_common.py +0 -0
  36. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/tb/modules/cicd.py +0 -0
  37. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/tb/modules/cli.py +0 -0
  38. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/tb/modules/common.py +0 -0
  39. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/tb/modules/config.py +0 -0
  40. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/tb/modules/connection.py +0 -0
  41. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/tb/modules/connection_kafka.py +0 -0
  42. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/tb/modules/connection_s3.py +0 -0
  43. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/tb/modules/create.py +0 -0
  44. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/tb/modules/datafile/build.py +0 -0
  45. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/tb/modules/datafile/build_common.py +0 -0
  46. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/tb/modules/datafile/build_datasource.py +0 -0
  47. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/tb/modules/datafile/build_pipe.py +0 -0
  48. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/tb/modules/datafile/diff.py +0 -0
  49. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/tb/modules/datafile/fixture.py +0 -0
  50. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/tb/modules/datafile/format_common.py +0 -0
  51. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/tb/modules/datafile/format_connection.py +0 -0
  52. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/tb/modules/datafile/format_datasource.py +0 -0
  53. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/tb/modules/datafile/format_pipe.py +0 -0
  54. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/tb/modules/datafile/pipe_checker.py +0 -0
  55. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/tb/modules/datafile/playground.py +0 -0
  56. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/tb/modules/datafile/pull.py +0 -0
  57. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/tb/modules/datasource.py +0 -0
  58. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/tb/modules/deployment.py +0 -0
  59. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/tb/modules/deployment_common.py +0 -0
  60. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/tb/modules/deprecations.py +0 -0
  61. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/tb/modules/endpoint.py +0 -0
  62. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/tb/modules/exceptions.py +0 -0
  63. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/tb/modules/feedback_manager.py +0 -0
  64. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/tb/modules/fmt.py +0 -0
  65. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/tb/modules/info.py +0 -0
  66. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/tb/modules/infra.py +0 -0
  67. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/tb/modules/job.py +0 -0
  68. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/tb/modules/job_common.py +0 -0
  69. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/tb/modules/llm.py +0 -0
  70. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/tb/modules/llm_utils.py +0 -0
  71. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/tb/modules/local.py +0 -0
  72. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/tb/modules/local_common.py +0 -0
  73. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/tb/modules/local_logs.py +0 -0
  74. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/tb/modules/login.py +0 -0
  75. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/tb/modules/login_common.py +0 -0
  76. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/tb/modules/logout.py +0 -0
  77. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/tb/modules/logs.py +0 -0
  78. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/tb/modules/materialization.py +0 -0
  79. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/tb/modules/open.py +0 -0
  80. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/tb/modules/pipe.py +0 -0
  81. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/tb/modules/preview.py +0 -0
  82. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/tb/modules/project.py +0 -0
  83. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/tb/modules/project_commands.py +0 -0
  84. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/tb/modules/py_project.py +0 -0
  85. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/tb/modules/query_output.py +0 -0
  86. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/tb/modules/regions.py +0 -0
  87. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/tb/modules/secret.py +0 -0
  88. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/tb/modules/secret_common.py +0 -0
  89. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/tb/modules/sink.py +0 -0
  90. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/tb/modules/table.py +0 -0
  91. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/tb/modules/telemetry.py +0 -0
  92. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/tb/modules/test.py +0 -0
  93. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/tb/modules/test_common.py +0 -0
  94. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/tb/modules/tinyunit/tinyunit.py +0 -0
  95. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/tb/modules/tinyunit/tinyunit_lib.py +0 -0
  96. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/tb/modules/token.py +0 -0
  97. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/tb/modules/ts_project.py +0 -0
  98. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/tb/modules/watch.py +0 -0
  99. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/tb/modules/workspace.py +0 -0
  100. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/tb/modules/workspace_members.py +0 -0
  101. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/tb_cli.py +0 -0
  102. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/tb_cli_modules/auth.py +0 -0
  103. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/tb_cli_modules/branch.py +0 -0
  104. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/tb_cli_modules/cicd.py +0 -0
  105. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/tb_cli_modules/cli.py +0 -0
  106. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/tb_cli_modules/common.py +0 -0
  107. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/tb_cli_modules/config.py +0 -0
  108. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/tb_cli_modules/connection.py +0 -0
  109. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/tb_cli_modules/datasource.py +0 -0
  110. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/tb_cli_modules/exceptions.py +0 -0
  111. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/tb_cli_modules/fmt.py +0 -0
  112. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/tb_cli_modules/job.py +0 -0
  113. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/tb_cli_modules/regions.py +0 -0
  114. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/tb_cli_modules/tag.py +0 -0
  115. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/tb_cli_modules/telemetry.py +0 -0
  116. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/tb_cli_modules/test.py +0 -0
  117. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/tb_cli_modules/tinyunit/tinyunit.py +0 -0
  118. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/tb_cli_modules/tinyunit/tinyunit_lib.py +0 -0
  119. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/tb_cli_modules/workspace.py +0 -0
  120. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/tb_cli_modules/workspace_members.py +0 -0
  121. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird/tornado_template.py +0 -0
  122. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird.egg-info/SOURCES.txt +0 -0
  123. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird.egg-info/dependency_links.txt +0 -0
  124. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird.egg-info/entry_points.txt +0 -0
  125. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird.egg-info/requires.txt +0 -0
  126. {tinybird-4.3.3.dev0 → tinybird-4.4.1.dev0}/tinybird.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: tinybird
3
- Version: 4.3.3.dev0
3
+ Version: 4.4.1.dev0
4
4
  Summary: Tinybird Command Line Tool
5
5
  Home-page: https://www.tinybird.co/docs/forward/commands
6
6
  Author: Tinybird
@@ -52,6 +52,11 @@ The Tinybird command-line tool allows you to use all the Tinybird functionality
52
52
  Changelog
53
53
  ----------
54
54
 
55
+ 4.4.0
56
+ *******
57
+
58
+ - `Added` `tb copy run` has a new `--on-demand-compute` flag to use on-demand compute instances for copy jobs.
59
+
55
60
  4.3.2
56
61
  *******
57
62
 
@@ -635,11 +635,17 @@ class TinyB:
635
635
  return await self._req(f"/v0/pipes/{pipe_name_or_id}/nodes/{node_id}/copy", method="DELETE")
636
636
 
637
637
  async def pipe_run_copy(
638
- self, pipe_name_or_id: str, params: Optional[Dict[str, str]] = None, mode: Optional[str] = None
638
+ self,
639
+ pipe_name_or_id: str,
640
+ params: Optional[Dict[str, str]] = None,
641
+ mode: Optional[str] = None,
642
+ on_demand_compute: bool = False,
639
643
  ):
640
644
  params = {**params} if params else {}
641
645
  if mode:
642
646
  params["_mode"] = mode
647
+ if on_demand_compute:
648
+ params["on_demand_compute"] = "true"
643
649
  return await self._req(f"/v0/pipes/{pipe_name_or_id}/copy?{urlencode(params)}", method="POST")
644
650
 
645
651
  async def pipe_resume_copy(self, pipe_name_or_id: str):
@@ -282,12 +282,16 @@ def extract_column_names_from_sorting_key_part(part: str) -> List[str]:
282
282
  """
283
283
  Extract actual column names from a sorting key part (which might be an expression).
284
284
 
285
- Examples:
286
- - "shop" -> ["shop"]
287
- - "`column_name`" -> ["column_name"]
288
- - "ifNull(ad_id, '')" -> ["ad_id"]
289
- - "toDate(timestamp)" -> ["timestamp"]
290
- - "concat(first_name, last_name)" -> ["first_name", "last_name"]
285
+ >>> extract_column_names_from_sorting_key_part("shop")
286
+ ['shop']
287
+ >>> extract_column_names_from_sorting_key_part("`column_name`")
288
+ ['column_name']
289
+ >>> extract_column_names_from_sorting_key_part("ifNull(ad_id, '')")
290
+ ['ad_id']
291
+ >>> extract_column_names_from_sorting_key_part("toDate(timestamp)")
292
+ ['timestamp']
293
+ >>> extract_column_names_from_sorting_key_part("concat(first_name, last_name)")
294
+ ['first_name', 'last_name']
291
295
  """
292
296
  columns = []
293
297
 
@@ -312,10 +316,20 @@ def parse_sorting_key_column_names(sorting_key: str) -> List[str]:
312
316
  """
313
317
  Extract all column names from a sorting key expression.
314
318
 
315
- Examples:
316
- - "shop, event_date, channel" -> ["shop", "event_date", "channel"]
317
- - "shop, event_date, ifNull(ad_id, ''), event_id" -> ["shop", "event_date", "ad_id", "event_id"]
318
- - "tuple(shop, toDate(timestamp))" -> ["shop", "timestamp"]
319
+ >>> parse_sorting_key_column_names("shop, event_date, channel")
320
+ ['shop', 'event_date', 'channel']
321
+ >>> parse_sorting_key_column_names("shop, event_date, ifNull(ad_id, ''), event_id")
322
+ ['shop', 'event_date', 'ad_id', 'event_id']
323
+ >>> parse_sorting_key_column_names("tuple(shop, toDate(timestamp))")
324
+ ['shop', 'timestamp']
325
+ >>> parse_sorting_key_column_names("timestamp, substring(value, 2, 1)")
326
+ ['timestamp', 'value']
327
+ >>> parse_sorting_key_column_names("cityHash64(id)")
328
+ ['id']
329
+ >>> parse_sorting_key_column_names("toStartOfHour(timestamp)")
330
+ ['timestamp']
331
+ >>> parse_sorting_key_column_names("toStartOfHour(timestamp), id, substring(a, 2, 1)")
332
+ ['timestamp', 'id', 'a']
319
333
  """
320
334
  # Remove tuple() wrapper if present
321
335
  column_str = sorting_key
@@ -611,7 +625,6 @@ class Datafile:
611
625
 
612
626
  def _parse_sorting_key_columns(self, sorting_key: str, engine_ver_column: Optional[str]) -> List[str]:
613
627
  """Parse sorting key to extract column names and validate constraints."""
614
- # Validate ENGINE_VER column constraint early
615
628
  if engine_ver_column and engine_ver_column in sorting_key:
616
629
  raise DatafileValidationError(
617
630
  f"ENGINE_VER column '{engine_ver_column}' cannot be included in the sorting key for ReplacingMergeTree. "
@@ -620,36 +633,33 @@ class Datafile:
620
633
  f"define the record identity (what makes it unique), while ENGINE_VER tracks which version to keep."
621
634
  )
622
635
 
623
- # Remove tuple() wrapper if present
624
- column_str = sorting_key
625
- if column_str.startswith("tuple(") and column_str.endswith(")"):
626
- column_str = column_str[6:-1]
627
-
628
- sorting_key_columns = []
629
-
630
- for part in column_str.split(","):
631
- part = part.strip()
632
-
633
- if self._is_aggregate_function_expression(part):
636
+ self._validate_no_aggregate_functions_in_sorting_key(sorting_key)
637
+
638
+ return parse_sorting_key_column_names(sorting_key)
639
+
640
+ def _validate_no_aggregate_functions_in_sorting_key(self, sorting_key: str) -> None:
641
+ """Validate that sorting key doesn't contain aggregate function expressions."""
642
+ for match in re.finditer(r"(\w+)\s*\(", sorting_key):
643
+ func_name = match.group(1)
644
+ if self._is_aggregate_function_expression(func_name):
645
+ start = match.start()
646
+ paren_start = match.end() - 1
647
+ depth = 1
648
+ pos = paren_start + 1
649
+ while pos < len(sorting_key) and depth > 0:
650
+ if sorting_key[pos] == "(":
651
+ depth += 1
652
+ elif sorting_key[pos] == ")":
653
+ depth -= 1
654
+ pos += 1
655
+ full_expr = sorting_key[start:pos]
634
656
  raise DatafileValidationError(
635
- f"Sorting key contains aggregate function expression '{part}'. Aggregate function expressions cannot be used in sorting keys."
657
+ f"Sorting key contains aggregate function expression '{full_expr}'. "
658
+ f"Aggregate function expressions cannot be used in sorting keys."
636
659
  )
637
660
 
638
- # Extract column names from the part
639
- extracted_columns = extract_column_names_from_sorting_key_part(part)
640
- sorting_key_columns.extend(extracted_columns)
641
-
642
- return sorting_key_columns
643
-
644
- def _is_aggregate_function_expression(self, part: str) -> bool:
645
- """Check if a sorting key part is an aggregate function expression."""
646
- if not ("(" in part and part.endswith(")")):
647
- return False
648
-
649
- func_start = part.find("(")
650
- func_name = part[:func_start].strip().lower()
651
-
652
- aggregate_function_names = {
661
+ _AGGREGATE_FUNCTION_NAMES = frozenset(
662
+ {
653
663
  "sum",
654
664
  "count",
655
665
  "avg",
@@ -669,8 +679,11 @@ class Datafile:
669
679
  "groupuniqarraymerge",
670
680
  "uniqmerge",
671
681
  }
682
+ )
672
683
 
673
- return func_name in aggregate_function_names
684
+ def _is_aggregate_function_expression(self, func_name: str) -> bool:
685
+ """Check if a function name is an aggregate function."""
686
+ return func_name.lower() in self._AGGREGATE_FUNCTION_NAMES
674
687
 
675
688
  def _validate_columns_against_schema(
676
689
  self, sorting_key_columns: List[str], schema_columns: Dict[str, Dict[str, Any]]
@@ -680,10 +693,11 @@ class Datafile:
680
693
  return # No schema information available, can't validate
681
694
 
682
695
  for col_name in sorting_key_columns:
683
- if col_name not in schema_columns:
696
+ column_info = schema_columns.get(col_name)
697
+ if column_info is None:
684
698
  continue
685
699
 
686
- self._validate_single_column(col_name, schema_columns[col_name])
700
+ self._validate_single_column(col_name, column_info)
687
701
 
688
702
  def _validate_single_column(self, col_name: str, column_info: Dict[str, Any]) -> None:
689
703
  """Validate a single column for use in sorting keys."""
@@ -36,6 +36,7 @@ def get_tinybird_service_datasources() -> List[Dict[str, Any]]:
36
36
  {"name": "read_bytes", "type": "UInt64"},
37
37
  {"name": "read_rows", "type": "UInt64"},
38
38
  {"name": "cpu_time", "type": "Float32"},
39
+ {"name": "result_rows", "type": "UInt64"},
39
40
  {"name": "url", "type": "Nullable(String)"},
40
41
  {"name": "error", "type": "UInt8"},
41
42
  {"name": "status_code", "type": "Int32"},
@@ -90,11 +91,8 @@ def get_tinybird_service_datasources() -> List[Dict[str, Any]]:
90
91
  {"name": "import_id", "type": "String"},
91
92
  {"name": "job_id", "type": "Nullable(String)"},
92
93
  {"name": "source", "type": "String"},
93
- {"name": "token_id", "type": "String"},
94
94
  {"name": "block_id", "type": "String"},
95
95
  {"name": "status", "type": "String"},
96
- {"name": "user_id", "type": "String"},
97
- {"name": "user_mail", "type": "String"},
98
96
  {"name": "datasource_id", "type": "String"},
99
97
  {"name": "datasource_name", "type": "String"},
100
98
  {"name": "start_offset", "type": "Nullable(Int64)"},
@@ -125,6 +123,8 @@ def get_tinybird_service_datasources() -> List[Dict[str, Any]]:
125
123
  {"name": "result", "type": "String"},
126
124
  {"name": "elapsed_time", "type": "Float32"},
127
125
  {"name": "error", "type": "Nullable(String)"},
126
+ {"name": "Options.Names", "type": "Array(String)"},
127
+ {"name": "Options.Values", "type": "Array(String)"},
128
128
  {"name": "request_id", "type": "String"},
129
129
  {"name": "import_id", "type": "Nullable(String)"},
130
130
  {"name": "job_id", "type": "Nullable(String)"},
@@ -133,9 +133,9 @@ def get_tinybird_service_datasources() -> List[Dict[str, Any]]:
133
133
  {"name": "blocks_ids", "type": "Array(String)"},
134
134
  {"name": "operation_id", "type": "String"},
135
135
  {"name": "read_rows", "type": "UInt64"},
136
+ {"name": "read_bytes", "type": "UInt64"},
136
137
  {"name": "cpu_time", "type": "Float32"},
137
138
  {"name": "memory_usage", "type": "UInt64"},
138
- {"name": "read_bytes", "type": "UInt64"},
139
139
  {"name": "written_rows", "type": "UInt64"},
140
140
  {"name": "written_bytes", "type": "UInt64"},
141
141
  {"name": "written_rows_quarantine", "type": "UInt64"},
@@ -143,6 +143,7 @@ def get_tinybird_service_datasources() -> List[Dict[str, Any]]:
143
143
  {"name": "pipe_id", "type": "String"},
144
144
  {"name": "pipe_name", "type": "String"},
145
145
  {"name": "release", "type": "String"},
146
+ {"name": "resource_tags", "type": "Array(String)"},
146
147
  ],
147
148
  },
148
149
  {
@@ -156,7 +157,8 @@ def get_tinybird_service_datasources() -> List[Dict[str, Any]]:
156
157
  },
157
158
  "columns": [
158
159
  {"name": "event_date", "type": "DateTime"},
159
- {"name": "workspace_id", "type": "String"},
160
+ {"name": "datasource_id", "type": "String"},
161
+ {"name": "datasource_name", "type": "String"},
160
162
  {"name": "event_type", "type": "LowCardinality(String)"},
161
163
  {"name": "pipe_id", "type": "String"},
162
164
  {"name": "pipe_name", "type": "String"},
@@ -193,6 +195,7 @@ def get_tinybird_service_datasources() -> List[Dict[str, Any]]:
193
195
  {"name": "url", "type": "Nullable(String)"},
194
196
  {"name": "status_code", "type": "Nullable(Int32)"},
195
197
  {"name": "error", "type": "Nullable(String)"},
198
+ {"name": "resource_tags", "type": "Array(String)"},
196
199
  ],
197
200
  },
198
201
  {
@@ -252,7 +255,6 @@ def get_tinybird_service_datasources() -> List[Dict[str, Any]]:
252
255
  {"name": "query_normalized", "type": "String"},
253
256
  {"name": "error_code", "type": "Int32"},
254
257
  {"name": "error", "type": "Nullable(String)"},
255
- {"name": "url", "type": "String"},
256
258
  {"name": "duration", "type": "UInt64"},
257
259
  {"name": "read_rows", "type": "UInt64"},
258
260
  {"name": "read_bytes", "type": "UInt64"},
@@ -337,7 +339,7 @@ def get_tinybird_service_datasources() -> List[Dict[str, Any]]:
337
339
  "engine": {},
338
340
  "columns": [
339
341
  {"name": "timestamp", "type": "DateTime"},
340
- {"name": "event_type", "type": "LowCardinality(String)"},
342
+ {"name": "event", "type": "LowCardinality(String)"},
341
343
  {"name": "origin_provider", "type": "LowCardinality(String)"},
342
344
  {"name": "origin_region", "type": "LowCardinality(String)"},
343
345
  {"name": "destination_provider", "type": "LowCardinality(String)"},
@@ -441,10 +443,7 @@ def get_tinybird_service_datasources() -> List[Dict[str, Any]]:
441
443
  "columns": [
442
444
  {"name": "start_time", "type": "DateTime"},
443
445
  {"name": "end_time", "type": "DateTime"},
444
- {"name": "organization_id", "type": "String"},
445
- {"name": "organization_name", "type": "String"},
446
446
  {"name": "workspace_id", "type": "String"},
447
- {"name": "workspace_name", "type": "String"},
448
447
  {"name": "user_email", "type": "String"},
449
448
  {"name": "request_id", "type": "String"},
450
449
  {"name": "prompt_tokens", "type": "UInt32"},
@@ -466,7 +465,6 @@ def get_tinybird_service_datasources() -> List[Dict[str, Any]]:
466
465
  "partition_key": "toYYYYMM(run_validation)",
467
466
  },
468
467
  "columns": [
469
- {"name": "cluster", "type": "LowCardinality(String)"},
470
468
  {"name": "host", "type": "LowCardinality(String)"},
471
469
  {"name": "version", "type": "LowCardinality(String)"},
472
470
  {"name": "stable_version", "type": "LowCardinality(String)"},
@@ -553,6 +551,7 @@ def get_organization_service_datasources() -> List[Dict[str, Any]]:
553
551
  {"name": "plan", "type": "String"},
554
552
  {"name": "created_at", "type": "DateTime"},
555
553
  {"name": "deleted_at", "type": "Nullable(DateTime)"},
554
+ {"name": "origin", "type": "String"},
556
555
  ],
557
556
  },
558
557
  {
@@ -609,6 +608,8 @@ def get_organization_service_datasources() -> List[Dict[str, Any]]:
609
608
  {"name": "result", "type": "String"},
610
609
  {"name": "elapsed_time", "type": "Float32"},
611
610
  {"name": "error", "type": "Nullable(String)"},
611
+ {"name": "Options.Names", "type": "Array(String)"},
612
+ {"name": "Options.Values", "type": "Array(String)"},
612
613
  {"name": "request_id", "type": "String"},
613
614
  {"name": "import_id", "type": "Nullable(String)"},
614
615
  {"name": "job_id", "type": "Nullable(String)"},
@@ -617,16 +618,16 @@ def get_organization_service_datasources() -> List[Dict[str, Any]]:
617
618
  {"name": "blocks_ids", "type": "Array(String)"},
618
619
  {"name": "operation_id", "type": "String"},
619
620
  {"name": "read_rows", "type": "UInt64"},
621
+ {"name": "read_bytes", "type": "UInt64"},
620
622
  {"name": "cpu_time", "type": "Float32"},
621
623
  {"name": "memory_usage", "type": "UInt64"},
622
- {"name": "read_bytes", "type": "UInt64"},
623
624
  {"name": "written_rows", "type": "UInt64"},
624
625
  {"name": "written_bytes", "type": "UInt64"},
625
626
  {"name": "written_rows_quarantine", "type": "UInt64"},
626
627
  {"name": "written_bytes_quarantine", "type": "UInt64"},
627
628
  {"name": "pipe_id", "type": "String"},
628
629
  {"name": "pipe_name", "type": "String"},
629
- {"name": "release", "type": "String"},
630
+ {"name": "resource_tags", "type": "Array(String)"},
630
631
  ],
631
632
  },
632
633
  {
@@ -641,6 +642,8 @@ def get_organization_service_datasources() -> List[Dict[str, Any]]:
641
642
  "columns": [
642
643
  {"name": "event_date", "type": "DateTime"},
643
644
  {"name": "workspace_id", "type": "String"},
645
+ {"name": "datasource_id", "type": "String"},
646
+ {"name": "datasource_name", "type": "String"},
644
647
  {"name": "event_type", "type": "LowCardinality(String)"},
645
648
  {"name": "pipe_id", "type": "String"},
646
649
  {"name": "pipe_name", "type": "String"},
@@ -648,12 +651,14 @@ def get_organization_service_datasources() -> List[Dict[str, Any]]:
648
651
  {"name": "executions", "type": "UInt64"},
649
652
  {"name": "avg_elapsed_time_state", "type": "AggregateFunction(avg, Float32)"},
650
653
  {"name": "quantiles_state", "type": "AggregateFunction(quantiles(0.9, 0.95, 0.99), Float64)"},
651
- {"name": "read_rows", "type": "UInt64"},
652
654
  {"name": "read_bytes", "type": "UInt64"},
653
- {"name": "written_rows", "type": "UInt64"},
655
+ {"name": "read_rows", "type": "UInt64"},
654
656
  {"name": "written_bytes", "type": "UInt64"},
657
+ {"name": "written_rows", "type": "UInt64"},
655
658
  {"name": "written_rows_quarantine", "type": "UInt64"},
656
659
  {"name": "written_bytes_quarantine", "type": "UInt64"},
660
+ {"name": "cpu_time", "type": "Float32"},
661
+ {"name": "resource_tags", "type": "Array(String)"},
657
662
  ],
658
663
  },
659
664
  {
@@ -703,6 +708,7 @@ def get_organization_service_datasources() -> List[Dict[str, Any]]:
703
708
  {"name": "read_bytes", "type": "UInt64"},
704
709
  {"name": "read_rows", "type": "UInt64"},
705
710
  {"name": "cpu_time", "type": "Float32"},
711
+ {"name": "result_rows", "type": "UInt64"},
706
712
  {"name": "url", "type": "Nullable(String)"},
707
713
  {"name": "error", "type": "UInt8"},
708
714
  {"name": "status_code", "type": "Int32"},
@@ -712,6 +718,7 @@ def get_organization_service_datasources() -> List[Dict[str, Any]]:
712
718
  {"name": "release", "type": "String"},
713
719
  {"name": "user_agent", "type": "Nullable(String)"},
714
720
  {"name": "resource_tags", "type": "Array(String)"},
721
+ {"name": "memory_usage", "type": "UInt64"},
715
722
  ],
716
723
  },
717
724
  {
@@ -722,7 +729,7 @@ def get_organization_service_datasources() -> List[Dict[str, Any]]:
722
729
  "columns": [
723
730
  {"name": "workspace_id", "type": "String"},
724
731
  {"name": "timestamp", "type": "DateTime"},
725
- {"name": "event_type", "type": "LowCardinality(String)"},
732
+ {"name": "event", "type": "LowCardinality(String)"},
726
733
  {"name": "origin_provider", "type": "LowCardinality(String)"},
727
734
  {"name": "origin_region", "type": "LowCardinality(String)"},
728
735
  {"name": "destination_provider", "type": "LowCardinality(String)"},
@@ -801,7 +808,6 @@ def get_organization_service_datasources() -> List[Dict[str, Any]]:
801
808
  {"name": "query_normalized", "type": "String"},
802
809
  {"name": "error_code", "type": "Int32"},
803
810
  {"name": "error", "type": "Nullable(String)"},
804
- {"name": "url", "type": "String"},
805
811
  {"name": "duration", "type": "UInt64"},
806
812
  {"name": "read_rows", "type": "UInt64"},
807
813
  {"name": "read_bytes", "type": "UInt64"},
@@ -893,6 +899,7 @@ def get_organization_service_datasources() -> List[Dict[str, Any]]:
893
899
  {"name": "url", "type": "Nullable(String)"},
894
900
  {"name": "status_code", "type": "Nullable(Int32)"},
895
901
  {"name": "error", "type": "Nullable(String)"},
902
+ {"name": "resource_tags", "type": "Array(String)"},
896
903
  ],
897
904
  },
898
905
  {
@@ -934,7 +941,7 @@ def get_organization_service_datasources() -> List[Dict[str, Any]]:
934
941
  {"name": "organization_name", "type": "String"},
935
942
  {"name": "plan_qps", "type": "SimpleAggregateFunction(max, Int64)"},
936
943
  {"name": "total_qps", "type": "UInt64"},
937
- {"name": "overage", "type": "Int64"},
944
+ {"name": "overages", "type": "Int64"},
938
945
  ],
939
946
  },
940
947
  {
@@ -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__ = '4.3.3.dev0'
8
- __revision__ = '894a8b6'
7
+ __version__ = '4.4.1.dev0'
8
+ __revision__ = 'b610ec3'
@@ -645,11 +645,18 @@ class TinyB:
645
645
  return self._req(f"/v0/pipes/{pipe_name_or_id}/nodes/{node_id}/copy", method="DELETE")
646
646
 
647
647
  def pipe_run(
648
- self, pipe_name_or_id: str, pipe_type: str, params: Optional[Dict[str, str]] = None, mode: Optional[str] = None
648
+ self,
649
+ pipe_name_or_id: str,
650
+ pipe_type: str,
651
+ params: Optional[Dict[str, str]] = None,
652
+ mode: Optional[str] = None,
653
+ on_demand_compute: bool = False,
649
654
  ):
650
655
  params = {**params} if params else {}
651
656
  if mode:
652
657
  params["_mode"] = mode
658
+ if on_demand_compute:
659
+ params["on_demand_compute"] = "true"
653
660
  return self._req(f"/v0/pipes/{pipe_name_or_id}/{pipe_type}?{urlencode(params)}", method="POST")
654
661
 
655
662
  def pipe_resume_copy(self, pipe_name_or_id: str):
@@ -83,8 +83,21 @@ def copy_ls(ctx: Context, match: str, format_: str):
83
83
  default=None,
84
84
  help="Key and value of the params you want the Copy pipe to be called with. For example: tb pipe copy run <my_copy_pipe> --param foo=bar",
85
85
  )
86
+ @click.option(
87
+ "--on-demand-compute",
88
+ is_flag=True,
89
+ default=False,
90
+ help="Use on-demand compute instances for the copy job.",
91
+ )
86
92
  @click.pass_context
87
- def copy_run(ctx: click.Context, pipe_name_or_id: str, wait: bool, mode: str, param: Optional[Tuple[str]]):
93
+ def copy_run(
94
+ ctx: click.Context,
95
+ pipe_name_or_id: str,
96
+ wait: bool,
97
+ mode: str,
98
+ param: Optional[Tuple[str]],
99
+ on_demand_compute: bool,
100
+ ):
88
101
  """Run an on-demand copy pipe"""
89
102
 
90
103
  params = dict(key_value.split("=") for key_value in param) if param else {}
@@ -93,7 +106,7 @@ def copy_run(ctx: click.Context, pipe_name_or_id: str, wait: bool, mode: str, pa
93
106
  config = ctx.ensure_object(dict)["config"]
94
107
 
95
108
  try:
96
- response = client.pipe_run(pipe_name_or_id, "copy", params, mode)
109
+ response = client.pipe_run(pipe_name_or_id, "copy", params, mode, on_demand_compute=on_demand_compute)
97
110
  job_id = response["job"]["job_id"]
98
111
  job_url = response["job"]["job_url"]
99
112
  echo_job_url(client.token, client.host, config.get("name") or "", job_url)
@@ -732,10 +732,22 @@ async def regression_test(
732
732
  default=None,
733
733
  help="Key and value of the params you want the Copy pipe to be called with. For example: tb pipe copy run <my_copy_pipe> --param foo=bar",
734
734
  )
735
+ @click.option(
736
+ "--on-demand-compute",
737
+ is_flag=True,
738
+ default=False,
739
+ help="Use on-demand compute instances for the copy job.",
740
+ )
735
741
  @click.pass_context
736
742
  @coro
737
743
  async def pipe_copy_run(
738
- ctx: click.Context, pipe_name_or_id: str, wait: bool, mode: str, yes: bool, param: Optional[Tuple[str]]
744
+ ctx: click.Context,
745
+ pipe_name_or_id: str,
746
+ wait: bool,
747
+ mode: str,
748
+ yes: bool,
749
+ param: Optional[Tuple[str]],
750
+ on_demand_compute: bool,
739
751
  ):
740
752
  """Run an on-demand copy job"""
741
753
 
@@ -746,7 +758,7 @@ async def pipe_copy_run(
746
758
  client: TinyB = ctx.ensure_object(dict)["client"]
747
759
 
748
760
  try:
749
- response = await client.pipe_run_copy(pipe_name_or_id, params, mode)
761
+ response = await client.pipe_run_copy(pipe_name_or_id, params, mode, on_demand_compute=on_demand_compute)
750
762
 
751
763
  job_id = response["job"]["job_id"]
752
764
  job_url = response["job"]["job_url"]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: tinybird
3
- Version: 4.3.3.dev0
3
+ Version: 4.4.1.dev0
4
4
  Summary: Tinybird Command Line Tool
5
5
  Home-page: https://www.tinybird.co/docs/forward/commands
6
6
  Author: Tinybird
@@ -52,6 +52,11 @@ The Tinybird command-line tool allows you to use all the Tinybird functionality
52
52
  Changelog
53
53
  ----------
54
54
 
55
+ 4.4.0
56
+ *******
57
+
58
+ - `Added` `tb copy run` has a new `--on-demand-compute` flag to use on-demand compute instances for copy jobs.
59
+
55
60
  4.3.2
56
61
  *******
57
62
 
File without changes