tinybird 4.6.10.dev0__tar.gz → 4.6.11__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 (127) hide show
  1. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/PKG-INFO +11 -1
  2. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/ch_utils/engine.py +6 -0
  3. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/datafile/common.py +8 -4
  4. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/service_datasources.py +1 -88
  5. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/tb/__cli__.py +2 -2
  6. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/tb/client.py +20 -4
  7. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/tb/modules/common.py +13 -6
  8. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/tb/modules/connection_dynamodb.py +1 -0
  9. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/tb/modules/connection_s3.py +1 -0
  10. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/tb/modules/datasource.py +60 -8
  11. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/tb/modules/logs.py +1 -13
  12. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird.egg-info/PKG-INFO +11 -1
  13. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/setup.cfg +0 -0
  14. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/__cli__.py +0 -0
  15. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/ch_utils/constants.py +0 -0
  16. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/check_pypi.py +0 -0
  17. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/client.py +0 -0
  18. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/config.py +0 -0
  19. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/context.py +0 -0
  20. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/datafile/exceptions.py +0 -0
  21. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/datafile/parse_connection.py +0 -0
  22. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/datafile/parse_datasource.py +0 -0
  23. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/datafile/parse_pipe.py +0 -0
  24. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/datatypes.py +0 -0
  25. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/feedback_manager.py +0 -0
  26. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/git_settings.py +0 -0
  27. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/iterating/__init__.py +0 -0
  28. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/iterating/data_branch_modes.py +0 -0
  29. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/prompts.py +0 -0
  30. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/sql.py +0 -0
  31. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/sql_template.py +0 -0
  32. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/sql_template_fmt.py +0 -0
  33. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/sql_toolset.py +0 -0
  34. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/syncasync.py +0 -0
  35. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/tb/check_pypi.py +0 -0
  36. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/tb/cli.py +0 -0
  37. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/tb/config.py +0 -0
  38. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/tb/modules/branch.py +0 -0
  39. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/tb/modules/build.py +0 -0
  40. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/tb/modules/build_common.py +0 -0
  41. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/tb/modules/cicd.py +0 -0
  42. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/tb/modules/cli.py +0 -0
  43. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/tb/modules/config.py +0 -0
  44. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/tb/modules/connection.py +0 -0
  45. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/tb/modules/connection_kafka.py +0 -0
  46. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/tb/modules/copy.py +0 -0
  47. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/tb/modules/create.py +0 -0
  48. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/tb/modules/datafile/build.py +0 -0
  49. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/tb/modules/datafile/build_common.py +0 -0
  50. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/tb/modules/datafile/build_datasource.py +0 -0
  51. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/tb/modules/datafile/build_pipe.py +0 -0
  52. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/tb/modules/datafile/diff.py +0 -0
  53. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/tb/modules/datafile/fixture.py +0 -0
  54. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/tb/modules/datafile/format_common.py +0 -0
  55. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/tb/modules/datafile/format_connection.py +0 -0
  56. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/tb/modules/datafile/format_datasource.py +0 -0
  57. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/tb/modules/datafile/format_pipe.py +0 -0
  58. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/tb/modules/datafile/pipe_checker.py +0 -0
  59. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/tb/modules/datafile/playground.py +0 -0
  60. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/tb/modules/datafile/pull.py +0 -0
  61. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/tb/modules/deployment.py +0 -0
  62. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/tb/modules/deployment_common.py +0 -0
  63. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/tb/modules/deprecations.py +0 -0
  64. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/tb/modules/endpoint.py +0 -0
  65. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/tb/modules/exceptions.py +0 -0
  66. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/tb/modules/feedback_manager.py +0 -0
  67. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/tb/modules/fmt.py +0 -0
  68. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/tb/modules/info.py +0 -0
  69. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/tb/modules/infra.py +0 -0
  70. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/tb/modules/job.py +0 -0
  71. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/tb/modules/job_common.py +0 -0
  72. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/tb/modules/llm.py +0 -0
  73. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/tb/modules/llm_utils.py +0 -0
  74. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/tb/modules/local.py +0 -0
  75. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/tb/modules/local_common.py +0 -0
  76. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/tb/modules/local_logs.py +0 -0
  77. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/tb/modules/login.py +0 -0
  78. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/tb/modules/login_common.py +0 -0
  79. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/tb/modules/logout.py +0 -0
  80. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/tb/modules/materialization.py +0 -0
  81. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/tb/modules/open.py +0 -0
  82. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/tb/modules/pipe.py +0 -0
  83. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/tb/modules/preview.py +0 -0
  84. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/tb/modules/project.py +0 -0
  85. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/tb/modules/project_commands.py +0 -0
  86. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/tb/modules/py_project.py +0 -0
  87. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/tb/modules/query_output.py +0 -0
  88. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/tb/modules/regions.py +0 -0
  89. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/tb/modules/secret.py +0 -0
  90. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/tb/modules/secret_common.py +0 -0
  91. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/tb/modules/sink.py +0 -0
  92. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/tb/modules/table.py +0 -0
  93. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/tb/modules/telemetry.py +0 -0
  94. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/tb/modules/test.py +0 -0
  95. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/tb/modules/test_common.py +0 -0
  96. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/tb/modules/tinyunit/tinyunit.py +0 -0
  97. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/tb/modules/token.py +0 -0
  98. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/tb/modules/ts_project.py +0 -0
  99. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/tb/modules/watch.py +0 -0
  100. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/tb/modules/workspace.py +0 -0
  101. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/tb/modules/workspace_members.py +0 -0
  102. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/tb_cli.py +0 -0
  103. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/tb_cli_modules/auth.py +0 -0
  104. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/tb_cli_modules/branch.py +0 -0
  105. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/tb_cli_modules/cicd.py +0 -0
  106. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/tb_cli_modules/cli.py +0 -0
  107. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/tb_cli_modules/common.py +0 -0
  108. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/tb_cli_modules/config.py +0 -0
  109. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/tb_cli_modules/connection.py +0 -0
  110. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/tb_cli_modules/datasource.py +0 -0
  111. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/tb_cli_modules/exceptions.py +0 -0
  112. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/tb_cli_modules/fmt.py +0 -0
  113. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/tb_cli_modules/job.py +0 -0
  114. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/tb_cli_modules/pipe.py +0 -0
  115. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/tb_cli_modules/regions.py +0 -0
  116. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/tb_cli_modules/tag.py +0 -0
  117. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/tb_cli_modules/telemetry.py +0 -0
  118. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/tb_cli_modules/test.py +0 -0
  119. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/tb_cli_modules/tinyunit/tinyunit.py +0 -0
  120. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/tb_cli_modules/workspace.py +0 -0
  121. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/tb_cli_modules/workspace_members.py +0 -0
  122. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird/tornado_template.py +0 -0
  123. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird.egg-info/SOURCES.txt +0 -0
  124. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird.egg-info/dependency_links.txt +0 -0
  125. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird.egg-info/entry_points.txt +0 -0
  126. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/tinybird.egg-info/requires.txt +0 -0
  127. {tinybird-4.6.10.dev0 → tinybird-4.6.11}/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.6.10.dev0
3
+ Version: 4.6.11
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,16 @@ The Tinybird command-line tool allows you to use all the Tinybird functionality
52
52
  Changelog
53
53
  ----------
54
54
 
55
+ 4.6.11
56
+ ********
57
+
58
+ - `Added` `tb datasource sample` support for DynamoDB connectors.
59
+
60
+ 4.6.10
61
+ ********
62
+
63
+ - `Removed` `tinybird.bi_stats_rt` from `tb logs` sources. The BI Connector `bi_stats` / `bi_stats_rt` service datasources are deprecated.
64
+
55
65
  4.6.9
56
66
  *******
57
67
 
@@ -121,6 +121,12 @@ class TableDetails:
121
121
  def is_mergetree_family(self) -> bool:
122
122
  return self.engine is not None and "mergetree" in self.engine.lower()
123
123
 
124
+ def is_view(self) -> bool:
125
+ return self.original_engine == "View"
126
+
127
+ def is_merge_final_engine(self) -> bool:
128
+ return self.original_engine == "MergeFinal"
129
+
124
130
  def supports_alter_add_column(self) -> bool:
125
131
  return self.is_mergetree_family() or (self.engine is not None and self.engine.lower() == "null")
126
132
 
@@ -221,8 +221,6 @@ INTERNAL_TABLES: Tuple[str, ...] = (
221
221
  "kafka_ops_log",
222
222
  "datasources_storage",
223
223
  "endpoint_errors",
224
- "bi_stats_rt",
225
- "bi_stats",
226
224
  )
227
225
 
228
226
  PREVIEW_CONNECTOR_SERVICES = ["s3", "s3_iamrole", "gcs"]
@@ -1725,7 +1723,9 @@ def parse(
1725
1723
 
1726
1724
  parser_state.current_node["indexes"] = indexes
1727
1725
 
1728
- def assign_var(v: str, allowed_values: Optional[set[str]] = None) -> Callable[[VarArg(str), KwArg(Any)], None]:
1726
+ def assign_var(
1727
+ v: str, allowed_values: Optional[set[str]] = None, lowercase: bool = False
1728
+ ) -> Callable[[VarArg(str), KwArg(Any)], None]:
1729
1729
  @multiline_not_supported
1730
1730
  def _f(*args: str, **kwargs: Any):
1731
1731
  s = _unquote((" ".join(args)).strip())
@@ -1736,6 +1736,8 @@ def parse(
1736
1736
  lineno=kwargs["lineno"],
1737
1737
  pos=1,
1738
1738
  )
1739
+ if lowercase:
1740
+ val = val.lower()
1739
1741
  parser_state.current_node[v.lower()] = val
1740
1742
 
1741
1743
  return _f
@@ -2048,7 +2050,9 @@ def parse(
2048
2050
  "import_schedule": assign_var("import_schedule"),
2049
2051
  "import_strategy": import_strategy_deprecated, # Deprecated, always append
2050
2052
  "import_bucket_uri": assign_var("import_bucket_uri"),
2051
- "import_format": assign_var("import_format"),
2053
+ # Lowercase: format checks and executor routing downstream expect
2054
+ # lowercase values (ANALYTICS-A8M)
2055
+ "import_format": assign_var("import_format", lowercase=True),
2052
2056
  "import_from_timestamp": assign_var("import_from_timestamp"),
2053
2057
  "import_service": import_service_deprecated, # Deprecated
2054
2058
  "import_external_datasource": import_external_datasource_deprecated, # Deprecated, BQ and SFK
@@ -244,49 +244,6 @@ def get_tinybird_service_datasources() -> List[Dict[str, Any]]:
244
244
  {"name": "rows_quarantine", "type": "SimpleAggregateFunction(max, UInt64)"},
245
245
  ],
246
246
  },
247
- {
248
- "name": "tinybird.bi_stats_rt",
249
- "description": "Contains information about all requests to your BI Connector interface in real time.",
250
- "dateColumn": "start_datetime",
251
- "engine": {
252
- "engine": "MergeTree",
253
- "sorting_key": "cityHash64(query_normalized), start_datetime",
254
- "ttl": "start_datetime + toIntervalDay(7)",
255
- },
256
- "columns": [
257
- {"name": "start_datetime", "type": "DateTime"},
258
- {"name": "query", "type": "String"},
259
- {"name": "query_normalized", "type": "String"},
260
- {"name": "error_code", "type": "Int32"},
261
- {"name": "error", "type": "Nullable(String)"},
262
- {"name": "duration", "type": "UInt64"},
263
- {"name": "read_rows", "type": "UInt64"},
264
- {"name": "read_bytes", "type": "UInt64"},
265
- {"name": "result_rows", "type": "UInt64"},
266
- {"name": "result_bytes", "type": "UInt64"},
267
- ],
268
- },
269
- {
270
- "name": "tinybird.bi_stats",
271
- "description": "Aggregates the stats in tinybird.bi_stats_rt by day.",
272
- "dateColumn": "date",
273
- "engine": {"engine": "MergeTree", "sorting_key": "cityHash64(query_normalized), start_datetime"},
274
- "columns": [
275
- {"name": "date", "type": "Date"},
276
- {"name": "query_normalized", "type": "String"},
277
- {"name": "view_count", "type": "UInt64"},
278
- {"name": "error_count", "type": "UInt64"},
279
- {"name": "avg_duration_state", "type": "AggregateFunction(avg, Float32)"},
280
- {
281
- "name": "quantile_timing_state",
282
- "type": "AggregateFunction(quantilesTiming(0.9, 0.95, 0.99), Float64)",
283
- },
284
- {"name": "read_bytes_sum", "type": "UInt64"},
285
- {"name": "read_rows_sum", "type": "UInt64"},
286
- {"name": "avg_result_rows_state", "type": "AggregateFunction(avg, Float32)"},
287
- {"name": "avg_result_bytes_state", "type": "AggregateFunction(avg, Float32)"},
288
- ],
289
- },
290
247
  {
291
248
  "name": "tinybird.sinks_ops_log",
292
249
  "description": "Contains information about your Sink pipes.",
@@ -483,6 +440,7 @@ def get_tinybird_service_datasources() -> List[Dict[str, Any]]:
483
440
  {"name": "error_code", "type": "Int16"},
484
441
  {"name": "error", "type": "String"},
485
442
  {"name": "fix_suggestion", "type": "String"},
443
+ {"name": "fix_suggestion_ai", "type": "String"},
486
444
  {"name": "run_validation", "type": "DateTime"},
487
445
  ],
488
446
  },
@@ -798,51 +756,6 @@ def get_organization_service_datasources() -> List[Dict[str, Any]]:
798
756
  {"name": "token_name", "type": "String"},
799
757
  ],
800
758
  },
801
- {
802
- "name": "organization.bi_stats_rt",
803
- "description": "Contains information about all requests to the BI Connector interface for the whole Organization in real time.",
804
- "dateColumn": "start_datetime",
805
- "engine": {
806
- "engine": "MergeTree",
807
- "sorting_key": "cityHash64(query_normalized), start_datetime",
808
- "ttl": "start_datetime + toIntervalDay(7)",
809
- },
810
- "columns": [
811
- {"name": "database", "type": "String"},
812
- {"name": "start_datetime", "type": "DateTime"},
813
- {"name": "query", "type": "String"},
814
- {"name": "query_normalized", "type": "String"},
815
- {"name": "error_code", "type": "Int32"},
816
- {"name": "error", "type": "Nullable(String)"},
817
- {"name": "duration", "type": "UInt64"},
818
- {"name": "read_rows", "type": "UInt64"},
819
- {"name": "read_bytes", "type": "UInt64"},
820
- {"name": "result_rows", "type": "UInt64"},
821
- {"name": "result_bytes", "type": "UInt64"},
822
- ],
823
- },
824
- {
825
- "name": "organization.bi_stats",
826
- "description": "Aggregates the stats in organization.bi_stats_rt by day.",
827
- "dateColumn": "date",
828
- "engine": {"engine": "MergeTree", "sorting_key": "database, cityHash64(query_normalized), date"},
829
- "columns": [
830
- {"name": "database", "type": "String"},
831
- {"name": "date", "type": "Date"},
832
- {"name": "query_normalized", "type": "String"},
833
- {"name": "view_count", "type": "UInt64"},
834
- {"name": "error_count", "type": "UInt64"},
835
- {"name": "avg_duration_state", "type": "AggregateFunction(avg, Float32)"},
836
- {
837
- "name": "quantile_timing_state",
838
- "type": "AggregateFunction(quantilesTiming(0.9, 0.95, 0.99), Float64)",
839
- },
840
- {"name": "read_bytes_sum", "type": "UInt64"},
841
- {"name": "read_rows_sum", "type": "UInt64"},
842
- {"name": "avg_result_rows_state", "type": "AggregateFunction(avg, Float32)"},
843
- {"name": "avg_result_bytes_state", "type": "AggregateFunction(avg, Float32)"},
844
- ],
845
- },
846
759
  {
847
760
  "name": "organization.metrics_logs",
848
761
  "description": "Metrics of your organization's dedicated clusters",
@@ -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.6.10.dev0'
8
- __revision__ = 'fa1549d'
7
+ __version__ = '4.6.11'
8
+ __revision__ = '7bdea3d'
@@ -546,20 +546,36 @@ class TinyB:
546
546
  def datasource_sync(self, datasource_id: str):
547
547
  return self._req(f"/v0/datasources/{datasource_id}/scheduling/runs", method="POST", data="")
548
548
 
549
- def datasource_sample(self, datasource_name: str, max_files: int = 1) -> Dict[str, Any]:
550
- """Start a sample import job for an S3/GCS connected datasource.
549
+ def datasource_sample(
550
+ self,
551
+ datasource_name: str,
552
+ max_files: int = 1,
553
+ rows: Optional[int] = None,
554
+ max_bytes: Optional[str] = None,
555
+ full_export: bool = False,
556
+ ) -> Dict[str, Any]:
557
+ """Start a sample import job for an S3/GCS/DynamoDB connected datasource.
551
558
 
552
559
  Args:
553
560
  datasource_name: Name of the datasource to import sample data into
554
- max_files: Maximum number of files to import (default 1, max 10)
561
+ max_files: Maximum number of files to import for blob storage connectors (default 1, max 10)
562
+ rows: For DynamoDB, the maximum number of rows to scan and import (mutually exclusive with max_bytes)
563
+ max_bytes: For DynamoDB, the maximum approximate JSONEachRow bytes to import, capped by the server's
564
+ workspace limit (mutually exclusive with rows)
565
+ full_export: For DynamoDB, trigger a full PITR export instead of a bounded scan
555
566
 
556
567
  Returns:
557
568
  dict with job info including id, job_id, job_url, job, status
558
569
  """
570
+ payload: Dict[str, Any] = {"max_files": max_files, "full_export": full_export}
571
+ if rows is not None:
572
+ payload["rows"] = rows
573
+ if max_bytes is not None:
574
+ payload["max_bytes"] = max_bytes
559
575
  return self._req(
560
576
  f"/v0/datasources/{datasource_name}/sample",
561
577
  method="POST",
562
- data=json.dumps({"max_files": max_files}),
578
+ data=json.dumps(payload),
563
579
  )
564
580
 
565
581
  def datasource_scheduling_state(self, datasource_id: str):
@@ -1614,6 +1614,7 @@ def run_aws_iamrole_connection_flow(
1614
1614
  connection_name: str,
1615
1615
  policy: str,
1616
1616
  local_unavailable: bool = False,
1617
+ env: str = "local",
1617
1618
  ) -> Tuple[str, str, Optional[TinyB], Optional[TinyB]]:
1618
1619
  """
1619
1620
  Run the interactive AWS IAM Role connection flow for S3 or DynamoDB.
@@ -1628,6 +1629,9 @@ def run_aws_iamrole_connection_flow(
1628
1629
  connection_name: The name for the connection being created.
1629
1630
  policy: The access policy type ('read' or 'write').
1630
1631
  local_unavailable: If True, local environment is unavailable (e.g., missing AWS credentials).
1632
+ env: The active target environment ('local' or 'cloud'). When not local, the
1633
+ passed-in `client` is reused as the cloud client so secrets land in the
1634
+ workspace the command targets (including branches).
1631
1635
 
1632
1636
  Returns:
1633
1637
  A tuple containing:
@@ -1736,12 +1740,15 @@ def run_aws_iamrole_connection_flow(
1736
1740
 
1737
1741
  if use_cloud:
1738
1742
  try:
1739
- cloud_client = TinyB(
1740
- token=config.get("token", ""),
1741
- host=config.get("host", ""),
1742
- staging=False,
1743
- request_from=getattr(client, "request_from", None),
1744
- )
1743
+ if env != "local":
1744
+ cloud_client = client
1745
+ else:
1746
+ cloud_client = TinyB(
1747
+ token=config.get("token", ""),
1748
+ host=config.get("host", ""),
1749
+ staging=False,
1750
+ request_from=getattr(client, "request_from", None),
1751
+ )
1745
1752
  except Exception as e:
1746
1753
  click.echo(FeedbackManager.warning(message=f"Failed to initialize cloud client: {e}"))
1747
1754
  click.echo(FeedbackManager.warning(message="Continuing without cloud environment."))
@@ -158,6 +158,7 @@ def connection_create_dynamodb(
158
158
  connection_name=connection_name,
159
159
  policy="read",
160
160
  local_unavailable=local_aws_unavailable,
161
+ env=env,
161
162
  )
162
163
 
163
164
  unique_suffix = uuid.uuid4().hex[:8]
@@ -363,6 +363,7 @@ def connection_create_s3(
363
363
  connection_name=connection_name,
364
364
  policy=access_type.lower(),
365
365
  local_unavailable=local_aws_unavailable,
366
+ env=env,
366
367
  )
367
368
  unique_suffix = uuid.uuid4().hex[:8] # Use first 8 chars of a UUID for brevity
368
369
  secret_name = f"s3_role_arn_{connection_name}_{unique_suffix}"
@@ -862,20 +862,50 @@ def datasource_sync(ctx: Context, datasource_name: str, yes: bool):
862
862
  default=False,
863
863
  help="Wait for the import job to finish",
864
864
  )
865
+ @click.option(
866
+ "--rows",
867
+ default=None,
868
+ type=int,
869
+ help="For DynamoDB, the maximum number of rows to scan and import (default 1500; mutually exclusive with --max-bytes)",
870
+ )
871
+ @click.option(
872
+ "--max-bytes",
873
+ default=None,
874
+ type=str,
875
+ help="For DynamoDB, the maximum approximate JSONEachRow bytes to import, e.g. 500MB (capped at 10GB by default; mutually exclusive with --rows)",
876
+ )
877
+ @click.option(
878
+ "--full-export",
879
+ is_flag=True,
880
+ default=False,
881
+ help="For DynamoDB, trigger a full PITR export instead of a bounded sample (mutually exclusive with --rows and --max-bytes)",
882
+ )
865
883
  @click.pass_context
866
- def datasource_sample(ctx: Context, datasource_name: str, max_files: int, wait: bool) -> None:
867
- """Import sample data from a datasource connected to an S3 or GCS bucket.
868
-
869
- This command only works with datasources that have IMPORT_CONNECTION_NAME and
870
- IMPORT_BUCKET_URI configured (i.e., datasources ingesting from S3 or GCS).
871
- It imports a limited number of files from the bucket URI pattern, useful for
872
- testing data pipelines in branches without importing the entire dataset.
884
+ def datasource_sample(
885
+ ctx: Context,
886
+ datasource_name: str,
887
+ max_files: int,
888
+ wait: bool,
889
+ rows: Optional[int],
890
+ max_bytes: Optional[str],
891
+ full_export: bool,
892
+ ) -> None:
893
+ """Import sample data from a datasource connected to S3, GCS, or DynamoDB.
894
+
895
+ For S3 and GCS, this imports a limited number of files from the bucket URI
896
+ pattern. For DynamoDB, this scans and imports a bounded sample limited by
897
+ either --rows or --max-bytes (defaulting to 1500 rows), or --full-export to
898
+ trigger a PITR export of the whole table.
873
899
 
874
900
  By default, returns immediately with job info. Use --wait to block until complete.
875
901
 
876
902
  Examples:
877
903
  tb --branch=my_branch datasource sample my_s3_ds
878
904
  tb --branch=my_branch datasource sample my_s3_ds --max-files 3 --wait
905
+ tb --branch=my_branch datasource sample my_dynamodb_ds --wait
906
+ tb --branch=my_branch datasource sample my_dynamodb_ds --rows 100000 --wait
907
+ tb --branch=my_branch datasource sample my_dynamodb_ds --max-bytes 1GB --wait
908
+ tb --branch=my_branch datasource sample my_dynamodb_ds --full-export --wait
879
909
  """
880
910
  from tinybird.tb.modules.common import wait_job
881
911
  from tinybird.tb.modules.job_common import echo_job_url
@@ -884,10 +914,32 @@ def datasource_sample(ctx: Context, datasource_name: str, max_files: int, wait:
884
914
  client: TinyB = ctx.obj["client"]
885
915
  config = ctx.obj.get("config", {})
886
916
 
917
+ if rows is not None and max_bytes is not None:
918
+ raise CLIDatasourceException(
919
+ FeedbackManager.error(message="--rows and --max-bytes are mutually exclusive; pass only one.")
920
+ )
921
+
922
+ if full_export and (rows is not None or max_bytes is not None):
923
+ raise CLIDatasourceException(
924
+ FeedbackManager.error(message="--full-export cannot be combined with --rows or --max-bytes.")
925
+ )
926
+
927
+ if full_export:
928
+ click.echo(
929
+ FeedbackManager.warning(
930
+ message=(
931
+ "DynamoDB full export samples will import the whole table. "
932
+ "Use --rows or --max-bytes without --full-export for a bounded sample."
933
+ )
934
+ )
935
+ )
936
+
887
937
  click.echo(FeedbackManager.info(message=f"Starting sample import for {datasource_name}..."))
888
938
 
889
939
  # Start the job
890
- result = client.datasource_sample(datasource_name, max_files=max_files)
940
+ result = client.datasource_sample(
941
+ datasource_name, max_files=max_files, rows=rows, max_bytes=max_bytes, full_export=full_export
942
+ )
891
943
 
892
944
  job_id = result.get("job_id") or result.get("id")
893
945
  if not job_id:
@@ -21,7 +21,6 @@ from tinybird.tb.modules.feedback_manager import FeedbackManager
21
21
 
22
22
  LOG_SOURCES: Tuple[str, ...] = (
23
23
  "tinybird.pipe_stats_rt",
24
- "tinybird.bi_stats_rt",
25
24
  "tinybird.block_log",
26
25
  "tinybird.datasources_ops_log",
27
26
  "tinybird.endpoint_errors",
@@ -39,7 +38,6 @@ DEFAULT_LOG_SOURCES: Tuple[str, ...] = (
39
38
 
40
39
  TIMESTAMP_COLUMNS: Dict[str, str] = {
41
40
  "tinybird.pipe_stats_rt": "start_datetime",
42
- "tinybird.bi_stats_rt": "start_datetime",
43
41
  "tinybird.block_log": "timestamp",
44
42
  "tinybird.datasources_ops_log": "timestamp",
45
43
  "tinybird.endpoint_errors": "start_datetime",
@@ -61,16 +59,6 @@ RELEVANT_DETAIL_FIELDS: Dict[str, Tuple[str, ...]] = {
61
59
  "read_bytes",
62
60
  "result_rows",
63
61
  ),
64
- "tinybird.bi_stats_rt": (
65
- "query_normalized",
66
- "error_code",
67
- "error",
68
- "duration",
69
- "read_rows",
70
- "read_bytes",
71
- "result_rows",
72
- "result_bytes",
73
- ),
74
62
  "tinybird.block_log": (
75
63
  "datasource_name",
76
64
  "status",
@@ -207,7 +195,7 @@ _TEMPORAL_DETAIL_FIELDS = {
207
195
  _DURATION_DETAIL_FIELDS = {"duration", "elapsed_time", "processing_time"}
208
196
  _ROW_COUNT_DETAIL_FIELDS = {"rows", "read_rows", "written_rows", "result_rows", "quarantine_lines"}
209
197
  _BYTE_COUNT_DETAIL_FIELDS = {"bytes", "read_bytes", "result_bytes", "written_bytes"}
210
- _MILLISECOND_DURATION_SOURCES = {"tinybird.bi_stats_rt"}
198
+ _MILLISECOND_DURATION_SOURCES: Set[str] = set()
211
199
 
212
200
 
213
201
  def _to_iso_utc(dt: datetime) -> str:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: tinybird
3
- Version: 4.6.10.dev0
3
+ Version: 4.6.11
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,16 @@ The Tinybird command-line tool allows you to use all the Tinybird functionality
52
52
  Changelog
53
53
  ----------
54
54
 
55
+ 4.6.11
56
+ ********
57
+
58
+ - `Added` `tb datasource sample` support for DynamoDB connectors.
59
+
60
+ 4.6.10
61
+ ********
62
+
63
+ - `Removed` `tinybird.bi_stats_rt` from `tb logs` sources. The BI Connector `bi_stats` / `bi_stats_rt` service datasources are deprecated.
64
+
55
65
  4.6.9
56
66
  *******
57
67
 
File without changes