tinybird 4.5.11__tar.gz → 4.5.12.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.5.11 → tinybird-4.5.12.dev0}/PKG-INFO +7 -1
  2. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/tb/__cli__.py +2 -2
  3. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/tb/modules/info.py +35 -11
  4. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird.egg-info/PKG-INFO +7 -1
  5. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/setup.cfg +0 -0
  6. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/__cli__.py +0 -0
  7. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/ch_utils/constants.py +0 -0
  8. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/ch_utils/engine.py +0 -0
  9. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/check_pypi.py +0 -0
  10. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/client.py +0 -0
  11. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/config.py +0 -0
  12. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/context.py +0 -0
  13. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/datafile/common.py +0 -0
  14. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/datafile/exceptions.py +0 -0
  15. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/datafile/parse_connection.py +0 -0
  16. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/datafile/parse_datasource.py +0 -0
  17. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/datafile/parse_pipe.py +0 -0
  18. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/datatypes.py +0 -0
  19. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/feedback_manager.py +0 -0
  20. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/git_settings.py +0 -0
  21. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/prompts.py +0 -0
  22. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/service_datasources.py +0 -0
  23. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/sql.py +0 -0
  24. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/sql_template.py +0 -0
  25. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/sql_template_fmt.py +0 -0
  26. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/sql_toolset.py +0 -0
  27. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/syncasync.py +0 -0
  28. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/tb/check_pypi.py +0 -0
  29. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/tb/cli.py +0 -0
  30. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/tb/client.py +0 -0
  31. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/tb/config.py +0 -0
  32. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/tb/modules/branch.py +0 -0
  33. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/tb/modules/build.py +0 -0
  34. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/tb/modules/build_common.py +0 -0
  35. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/tb/modules/cicd.py +0 -0
  36. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/tb/modules/cli.py +0 -0
  37. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/tb/modules/common.py +0 -0
  38. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/tb/modules/config.py +0 -0
  39. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/tb/modules/connection.py +0 -0
  40. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/tb/modules/connection_kafka.py +0 -0
  41. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/tb/modules/connection_s3.py +0 -0
  42. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/tb/modules/copy.py +0 -0
  43. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/tb/modules/create.py +0 -0
  44. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/tb/modules/datafile/build.py +0 -0
  45. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/tb/modules/datafile/build_common.py +0 -0
  46. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/tb/modules/datafile/build_datasource.py +0 -0
  47. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/tb/modules/datafile/build_pipe.py +0 -0
  48. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/tb/modules/datafile/diff.py +0 -0
  49. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/tb/modules/datafile/fixture.py +0 -0
  50. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/tb/modules/datafile/format_common.py +0 -0
  51. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/tb/modules/datafile/format_connection.py +0 -0
  52. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/tb/modules/datafile/format_datasource.py +0 -0
  53. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/tb/modules/datafile/format_pipe.py +0 -0
  54. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/tb/modules/datafile/pipe_checker.py +0 -0
  55. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/tb/modules/datafile/playground.py +0 -0
  56. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/tb/modules/datafile/pull.py +0 -0
  57. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/tb/modules/datasource.py +0 -0
  58. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/tb/modules/deployment.py +0 -0
  59. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/tb/modules/deployment_common.py +0 -0
  60. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/tb/modules/deprecations.py +0 -0
  61. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/tb/modules/endpoint.py +0 -0
  62. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/tb/modules/exceptions.py +0 -0
  63. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/tb/modules/feedback_manager.py +0 -0
  64. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/tb/modules/fmt.py +0 -0
  65. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/tb/modules/infra.py +0 -0
  66. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/tb/modules/job.py +0 -0
  67. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/tb/modules/job_common.py +0 -0
  68. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/tb/modules/llm.py +0 -0
  69. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/tb/modules/llm_utils.py +0 -0
  70. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/tb/modules/local.py +0 -0
  71. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/tb/modules/local_common.py +0 -0
  72. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/tb/modules/local_logs.py +0 -0
  73. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/tb/modules/login.py +0 -0
  74. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/tb/modules/login_common.py +0 -0
  75. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/tb/modules/logout.py +0 -0
  76. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/tb/modules/logs.py +0 -0
  77. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/tb/modules/materialization.py +0 -0
  78. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/tb/modules/open.py +0 -0
  79. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/tb/modules/pipe.py +0 -0
  80. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/tb/modules/preview.py +0 -0
  81. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/tb/modules/project.py +0 -0
  82. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/tb/modules/project_commands.py +0 -0
  83. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/tb/modules/py_project.py +0 -0
  84. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/tb/modules/query_output.py +0 -0
  85. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/tb/modules/regions.py +0 -0
  86. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/tb/modules/secret.py +0 -0
  87. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/tb/modules/secret_common.py +0 -0
  88. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/tb/modules/sink.py +0 -0
  89. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/tb/modules/table.py +0 -0
  90. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/tb/modules/telemetry.py +0 -0
  91. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/tb/modules/test.py +0 -0
  92. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/tb/modules/test_common.py +0 -0
  93. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/tb/modules/tinyunit/tinyunit.py +0 -0
  94. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/tb/modules/tinyunit/tinyunit_lib.py +0 -0
  95. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/tb/modules/token.py +0 -0
  96. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/tb/modules/ts_project.py +0 -0
  97. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/tb/modules/watch.py +0 -0
  98. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/tb/modules/workspace.py +0 -0
  99. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/tb/modules/workspace_members.py +0 -0
  100. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/tb_cli.py +0 -0
  101. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/tb_cli_modules/auth.py +0 -0
  102. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/tb_cli_modules/branch.py +0 -0
  103. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/tb_cli_modules/cicd.py +0 -0
  104. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/tb_cli_modules/cli.py +0 -0
  105. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/tb_cli_modules/common.py +0 -0
  106. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/tb_cli_modules/config.py +0 -0
  107. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/tb_cli_modules/connection.py +0 -0
  108. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/tb_cli_modules/datasource.py +0 -0
  109. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/tb_cli_modules/exceptions.py +0 -0
  110. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/tb_cli_modules/fmt.py +0 -0
  111. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/tb_cli_modules/job.py +0 -0
  112. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/tb_cli_modules/pipe.py +0 -0
  113. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/tb_cli_modules/regions.py +0 -0
  114. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/tb_cli_modules/tag.py +0 -0
  115. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/tb_cli_modules/telemetry.py +0 -0
  116. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/tb_cli_modules/test.py +0 -0
  117. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/tb_cli_modules/tinyunit/tinyunit.py +0 -0
  118. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/tb_cli_modules/tinyunit/tinyunit_lib.py +0 -0
  119. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/tb_cli_modules/workspace.py +0 -0
  120. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/tb_cli_modules/workspace_members.py +0 -0
  121. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird/tornado_template.py +0 -0
  122. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird.egg-info/SOURCES.txt +0 -0
  123. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird.egg-info/dependency_links.txt +0 -0
  124. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird.egg-info/entry_points.txt +0 -0
  125. {tinybird-4.5.11 → tinybird-4.5.12.dev0}/tinybird.egg-info/requires.txt +0 -0
  126. {tinybird-4.5.11 → tinybird-4.5.12.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.5.11
3
+ Version: 4.5.12.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,12 @@ The Tinybird command-line tool allows you to use all the Tinybird functionality
52
52
  Changelog
53
53
  ----------
54
54
 
55
+ 4.5.12
56
+ *******
57
+
58
+ - `Fixed` `tb info` now lists branches and marks the current branch correctly when running on a branch.
59
+
60
+
55
61
  4.5.11
56
62
  *******
57
63
 
@@ -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.5.11'
8
- __revision__ = 'c7c08df'
7
+ __version__ = '4.5.12.dev0'
8
+ __revision__ = '6a70694'
@@ -22,6 +22,7 @@ def info(ctx: click.Context, skip_local: bool) -> None:
22
22
  ctx_config = ctx.ensure_object(dict)["config"]
23
23
  project: Project = ctx.ensure_object(dict)["project"]
24
24
  output = ctx.ensure_object(dict)["output"]
25
+ selected_branch = ctx.ensure_object(dict).get("branch")
25
26
 
26
27
  if output not in {"human", "json"}:
27
28
  force_echo(FeedbackManager.error_invalid_output_format(formats=", ".join(["human", "json"])))
@@ -43,7 +44,7 @@ def info(ctx: click.Context, skip_local: bool) -> None:
43
44
  click.echo(FeedbackManager.highlight(message="\n» Project:"))
44
45
  project_table, project_columns = get_project_info(project.folder)
45
46
 
46
- branches_summary = get_branches_summary(ctx_config)
47
+ branches_summary = get_branches_summary(ctx_config, selected_branch=selected_branch)
47
48
 
48
49
  if output == "human":
49
50
  click.echo(FeedbackManager.highlight(message="\n» Branches:"))
@@ -75,11 +76,14 @@ def info(ctx: click.Context, skip_local: bool) -> None:
75
76
  project_data = {column: project_table[0][i] for i, column in enumerate(project_columns)}
76
77
  response["project"] = project_data
77
78
 
78
- response["branches"] = {
79
+ branches_data: dict[str, Any] = {
79
80
  "current": branches_summary["current"],
80
81
  "count": branches_summary["count"],
81
82
  "items": branches_summary["items"],
82
83
  }
84
+ if branches_summary.get("error"):
85
+ branches_data["error"] = branches_summary["error"]
86
+ response["branches"] = branches_data
83
87
 
84
88
  echo_json(response)
85
89
 
@@ -216,7 +220,7 @@ def get_project_info(project_path: Optional[str] = None) -> Tuple[Iterable[Any],
216
220
  return table, columns
217
221
 
218
222
 
219
- def get_branches_summary(ctx_config: Dict[str, Any]) -> Dict[str, Any]:
223
+ def get_branches_summary(ctx_config: Dict[str, Any], selected_branch: Optional[str] = None) -> Dict[str, Any]:
220
224
  columns = ["name", "current", "token", "ui"]
221
225
 
222
226
  try:
@@ -235,30 +239,39 @@ def get_branches_summary(ctx_config: Dict[str, Any]) -> Dict[str, Any]:
235
239
  current_workspace = client.workspace_info(version="v1")
236
240
 
237
241
  main_workspace_name = current_workspace.get("name", "No workspace")
242
+ main_workspace_id = current_workspace.get("id")
243
+ main_workspace_token = current_workspace.get("token")
238
244
  if current_workspace.get("is_branch"):
239
245
  main_workspace_id = current_workspace.get("main")
240
246
  main_workspace = next((ws for ws in workspaces if ws.get("id") == main_workspace_id), None)
241
247
  if main_workspace and main_workspace.get("name"):
242
248
  main_workspace_name = main_workspace["name"]
249
+ main_workspace_token = main_workspace.get("token") or main_workspace_token
243
250
 
244
251
  branches = client.branches().get("environments", [])
252
+ if not branches and api_host and main_workspace_token:
253
+ fallback_client = TinyB(main_workspace_token, host=api_host)
254
+ branches = fallback_client.branches().get("environments", [])
245
255
 
246
- current_branch = "main"
247
- if current_workspace.get("is_branch"):
248
- current_branch = current_workspace.get("name", "main")
256
+ if main_workspace_id:
257
+ scoped_branches = [branch for branch in branches if branch.get("main") == main_workspace_id]
258
+ if scoped_branches:
259
+ branches = scoped_branches
249
260
 
250
- items = []
261
+ all_items = []
251
262
  for branch in branches:
252
263
  branch_name = branch.get("name") or "No branch name"
253
264
  branch_token = branch.get("token") or "No token found"
254
- branch_current = current_workspace.get("id") == branch.get("id")
265
+ branch_current = (
266
+ branch_name == selected_branch if selected_branch else current_workspace.get("id") == branch.get("id")
267
+ )
255
268
  branch_ui = (
256
269
  f"{ui_host}/{main_workspace_name}~{branch_name}"
257
270
  if ui_host and main_workspace_name and branch_name != "No branch name"
258
271
  else "No UI URL found"
259
272
  )
260
273
 
261
- items.append(
274
+ all_items.append(
262
275
  {
263
276
  "name": branch_name,
264
277
  "current": branch_current,
@@ -267,16 +280,27 @@ def get_branches_summary(ctx_config: Dict[str, Any]) -> Dict[str, Any]:
267
280
  }
268
281
  )
269
282
 
283
+ items = all_items
284
+ error: Optional[str] = None
285
+ if selected_branch:
286
+ items = [branch for branch in all_items if branch["name"] == selected_branch]
287
+ if not items:
288
+ error = f"Branch '{selected_branch}' not found."
289
+
290
+ current_branch = selected_branch or "main"
291
+ if not selected_branch and current_workspace.get("is_branch"):
292
+ current_branch = current_workspace.get("name", "main")
293
+
270
294
  items.sort(key=lambda branch: (not branch["current"], branch["name"]))
271
295
  table = [(branch["name"], branch["current"], branch["token"], branch["ui"]) for branch in items]
272
296
 
273
297
  return {
274
298
  "current": current_branch,
275
- "count": len(items),
299
+ "count": len(all_items),
276
300
  "items": items,
277
301
  "table": table,
278
302
  "columns": columns,
279
- "error": None,
303
+ "error": error,
280
304
  }
281
305
  except Exception:
282
306
  return {
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: tinybird
3
- Version: 4.5.11
3
+ Version: 4.5.12.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,12 @@ The Tinybird command-line tool allows you to use all the Tinybird functionality
52
52
  Changelog
53
53
  ----------
54
54
 
55
+ 4.5.12
56
+ *******
57
+
58
+ - `Fixed` `tb info` now lists branches and marks the current branch correctly when running on a branch.
59
+
60
+
55
61
  4.5.11
56
62
  *******
57
63
 
File without changes