tinybird 0.0.1.dev283__tar.gz → 0.0.1.dev285__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.

Potentially problematic release.


This version of tinybird might be problematic. Click here for more details.

Files changed (147) hide show
  1. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/PKG-INFO +1 -1
  2. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/ch_utils/constants.py +1 -0
  3. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/sql.py +1 -1
  4. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb/__cli__.py +2 -2
  5. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb/modules/agent/agent.py +10 -11
  6. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb/modules/agent/command_agent.py +7 -2
  7. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb/modules/agent/prompts.py +41 -0
  8. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird.egg-info/PKG-INFO +1 -1
  9. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/setup.cfg +0 -0
  10. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/__cli__.py +0 -0
  11. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/ch_utils/engine.py +0 -0
  12. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/check_pypi.py +0 -0
  13. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/client.py +0 -0
  14. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/config.py +0 -0
  15. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/connectors.py +0 -0
  16. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/context.py +0 -0
  17. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/datafile/common.py +0 -0
  18. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/datafile/exceptions.py +0 -0
  19. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/datafile/parse_connection.py +0 -0
  20. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/datafile/parse_datasource.py +0 -0
  21. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/datafile/parse_pipe.py +0 -0
  22. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/datatypes.py +0 -0
  23. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/feedback_manager.py +0 -0
  24. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/git_settings.py +0 -0
  25. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/prompts.py +0 -0
  26. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/sql_template.py +0 -0
  27. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/sql_template_fmt.py +0 -0
  28. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/sql_toolset.py +0 -0
  29. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/syncasync.py +0 -0
  30. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb/check_pypi.py +0 -0
  31. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb/cli.py +0 -0
  32. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb/client.py +0 -0
  33. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb/config.py +0 -0
  34. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb/modules/agent/__init__.py +0 -0
  35. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb/modules/agent/animations.py +0 -0
  36. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb/modules/agent/banner.py +0 -0
  37. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb/modules/agent/compactor.py +0 -0
  38. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb/modules/agent/explore_agent.py +0 -0
  39. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb/modules/agent/memory.py +0 -0
  40. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb/modules/agent/mock_agent.py +0 -0
  41. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb/modules/agent/models.py +0 -0
  42. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb/modules/agent/testing_agent.py +0 -0
  43. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb/modules/agent/tools/__init__.py +0 -0
  44. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb/modules/agent/tools/analyze.py +0 -0
  45. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb/modules/agent/tools/append.py +0 -0
  46. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb/modules/agent/tools/build.py +0 -0
  47. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb/modules/agent/tools/datafile.py +0 -0
  48. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb/modules/agent/tools/deploy.py +0 -0
  49. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb/modules/agent/tools/deploy_check.py +0 -0
  50. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb/modules/agent/tools/diff_resource.py +0 -0
  51. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb/modules/agent/tools/execute_query.py +0 -0
  52. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb/modules/agent/tools/get_endpoint_stats.py +0 -0
  53. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb/modules/agent/tools/get_openapi_definition.py +0 -0
  54. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb/modules/agent/tools/mock.py +0 -0
  55. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb/modules/agent/tools/plan.py +0 -0
  56. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb/modules/agent/tools/request_endpoint.py +0 -0
  57. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb/modules/agent/tools/run_command.py +0 -0
  58. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb/modules/agent/tools/secret.py +0 -0
  59. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb/modules/agent/tools/test.py +0 -0
  60. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb/modules/agent/utils.py +0 -0
  61. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb/modules/build.py +0 -0
  62. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb/modules/build_common.py +0 -0
  63. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb/modules/cicd.py +0 -0
  64. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb/modules/cli.py +0 -0
  65. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb/modules/common.py +0 -0
  66. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb/modules/config.py +0 -0
  67. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb/modules/connection.py +0 -0
  68. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb/modules/copy.py +0 -0
  69. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb/modules/create.py +0 -0
  70. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb/modules/datafile/build.py +0 -0
  71. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb/modules/datafile/build_common.py +0 -0
  72. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb/modules/datafile/build_datasource.py +0 -0
  73. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb/modules/datafile/build_pipe.py +0 -0
  74. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb/modules/datafile/diff.py +0 -0
  75. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb/modules/datafile/fixture.py +0 -0
  76. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb/modules/datafile/format_common.py +0 -0
  77. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb/modules/datafile/format_datasource.py +0 -0
  78. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb/modules/datafile/format_pipe.py +0 -0
  79. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb/modules/datafile/pipe_checker.py +0 -0
  80. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb/modules/datafile/playground.py +0 -0
  81. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb/modules/datafile/pull.py +0 -0
  82. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb/modules/datasource.py +0 -0
  83. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb/modules/deployment.py +0 -0
  84. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb/modules/deployment_common.py +0 -0
  85. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb/modules/deprecations.py +0 -0
  86. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb/modules/dev_server.py +0 -0
  87. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb/modules/endpoint.py +0 -0
  88. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb/modules/exceptions.py +0 -0
  89. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb/modules/feedback_manager.py +0 -0
  90. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb/modules/info.py +0 -0
  91. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb/modules/infra.py +0 -0
  92. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb/modules/job.py +0 -0
  93. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb/modules/llm.py +0 -0
  94. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb/modules/llm_utils.py +0 -0
  95. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb/modules/local.py +0 -0
  96. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb/modules/local_common.py +0 -0
  97. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb/modules/login.py +0 -0
  98. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb/modules/login_common.py +0 -0
  99. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb/modules/logout.py +0 -0
  100. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb/modules/materialization.py +0 -0
  101. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb/modules/mock.py +0 -0
  102. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb/modules/mock_common.py +0 -0
  103. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb/modules/open.py +0 -0
  104. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb/modules/pipe.py +0 -0
  105. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb/modules/project.py +0 -0
  106. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb/modules/regions.py +0 -0
  107. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb/modules/secret.py +0 -0
  108. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb/modules/secret_common.py +0 -0
  109. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb/modules/shell.py +0 -0
  110. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb/modules/sink.py +0 -0
  111. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb/modules/table.py +0 -0
  112. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb/modules/telemetry.py +0 -0
  113. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb/modules/test.py +0 -0
  114. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb/modules/test_common.py +0 -0
  115. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb/modules/tinyunit/tinyunit.py +0 -0
  116. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb/modules/tinyunit/tinyunit_lib.py +0 -0
  117. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb/modules/token.py +0 -0
  118. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb/modules/watch.py +0 -0
  119. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb/modules/workspace.py +0 -0
  120. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb/modules/workspace_members.py +0 -0
  121. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb_cli.py +0 -0
  122. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb_cli_modules/auth.py +0 -0
  123. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb_cli_modules/branch.py +0 -0
  124. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb_cli_modules/cicd.py +0 -0
  125. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb_cli_modules/cli.py +0 -0
  126. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb_cli_modules/common.py +0 -0
  127. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb_cli_modules/config.py +0 -0
  128. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb_cli_modules/connection.py +0 -0
  129. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb_cli_modules/datasource.py +0 -0
  130. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb_cli_modules/exceptions.py +0 -0
  131. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb_cli_modules/fmt.py +0 -0
  132. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb_cli_modules/job.py +0 -0
  133. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb_cli_modules/pipe.py +0 -0
  134. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb_cli_modules/regions.py +0 -0
  135. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb_cli_modules/tag.py +0 -0
  136. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb_cli_modules/telemetry.py +0 -0
  137. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb_cli_modules/test.py +0 -0
  138. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb_cli_modules/tinyunit/tinyunit.py +0 -0
  139. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb_cli_modules/tinyunit/tinyunit_lib.py +0 -0
  140. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb_cli_modules/workspace.py +0 -0
  141. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tb_cli_modules/workspace_members.py +0 -0
  142. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird/tornado_template.py +0 -0
  143. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird.egg-info/SOURCES.txt +0 -0
  144. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird.egg-info/dependency_links.txt +0 -0
  145. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird.egg-info/entry_points.txt +0 -0
  146. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird.egg-info/requires.txt +0 -0
  147. {tinybird-0.0.1.dev283 → tinybird-0.0.1.dev285}/tinybird.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: tinybird
3
- Version: 0.0.1.dev283
3
+ Version: 0.0.1.dev285
4
4
  Summary: Tinybird Command Line Tool
5
5
  Home-page: https://www.tinybird.co/docs/forward/commands
6
6
  Author: Tinybird
@@ -257,4 +257,5 @@ VALID_QUERY_FORMATS = (
257
257
  "Native",
258
258
  "RowBinaryWithNamesAndTypes",
259
259
  "TabSeparated",
260
+ "JSONCompactEachRowWithNamesAndTypes",
260
261
  )
@@ -907,7 +907,7 @@ def engine_patch_replicated_engine(engine: str, engine_full: Optional[str], new_
907
907
  paths = parts[2].split("/")
908
908
  paths[-1] = new_table_name
909
909
  zoo_path = "/".join(paths)
910
- return "".join(parts[:2] + [zoo_path] + parts[3:])
910
+ return "".join([*parts[:2], zoo_path, *parts[3:]])
911
911
  return engine_full
912
912
 
913
913
 
@@ -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.dev283'
8
- __revision__ = 'af675c9'
7
+ __version__ = '0.0.1.dev285'
8
+ __revision__ = '0a30a28'
@@ -383,20 +383,18 @@ class TinybirdAgent:
383
383
  workspace_id = config.get("id", "")
384
384
  workspace = client.workspace(workspace_id, with_organization=True, version="v1")
385
385
  limits_data = client.organization_limits(workspace["organization"]["id"])
386
- ai_requests_limits = limits_data.get("limits", {}).get("ai_requests", {})
387
- current_ai_requests = ai_requests_limits.get("quantity") or 0
388
- max_ai_requests = ai_requests_limits.get("max") or 0
389
- remaining_requests = max(max_ai_requests - current_ai_requests, 0)
390
- current_ai_requests = min(max_ai_requests, current_ai_requests)
391
- if not max_ai_requests:
386
+ ai_credits_limits = limits_data.get("limits", {}).get("ai_credits", {})
387
+ current_ai_credits = ai_credits_limits.get("quantity") or 0
388
+ ai_credits = ai_credits_limits.get("max") or 0
389
+ remaining_credits = max(ai_credits - current_ai_credits, 0)
390
+ current_ai_credits = min(ai_credits, current_ai_credits)
391
+ if not ai_credits:
392
392
  return
393
- warning_threshold = max_ai_requests * 0.8
394
- message_color = (
395
- FeedbackManager.warning if current_ai_requests >= warning_threshold else FeedbackManager.gray
396
- )
393
+ warning_threshold = ai_credits * 0.8
394
+ message_color = FeedbackManager.warning if current_ai_credits >= warning_threshold else FeedbackManager.gray
397
395
  click.echo(
398
396
  message_color(
399
- message=f"{remaining_requests} requests left ({current_ai_requests}/{max_ai_requests}). You can continue using Tinybird Code. Limits will be enforced soon."
397
+ message=f"{remaining_credits} credits left ({current_ai_credits}/{ai_credits}). You can continue using Tinybird Code. Limits will be enforced soon."
400
398
  )
401
399
  )
402
400
  except Exception:
@@ -577,6 +575,7 @@ def run_agent(
577
575
  break
578
576
 
579
577
  except Exception as e:
578
+ agent.thinking_animation.stop()
580
579
  click.echo(FeedbackManager.error(message=f"Error: {e}"))
581
580
  sys.exit(1)
582
581
 
@@ -43,10 +43,15 @@ You can run `-h` in every level of the command to get help. E.g. `tb -h`, `tb da
43
43
  When you need to access Tinybird Cloud, add the `--cloud` flag. E.g. `tb --cloud datasource ls`.
44
44
  Available commands:
45
45
  {available_commands}
46
- IMPORTANT: Do NOT use any command that is not in the list above.
47
- IMPORTANT: If you don't have the proper command to solve the task, just answer that you cannot solve the task.
48
46
  Token and host are not required to add to the commands.
49
47
  Always run first help commands to be sure that the commands you are running is not interactive.
48
+ IMPORTANT: Do NOT use any command that is not in the list above.
49
+ IMPORTANT: If you are asked to run a command that is not in the list above, return that you are not able to run that command and needs to use the Tinybird CLI manually and that user should run `tb --help` to get the list of available commands.
50
+ IMPORTANT: If you are not able to run a command, do not recommend any command to be run by the user. Just `tb --help` to get the list of available commands.
51
+ <example_command_not_found>
52
+ User: switch to another workspace
53
+ Assistant: I'm sorry, but I cannot switch to another workspace. You can use the Tinybird CLI to switch workspaces. Run `tb --help` to get the list of available commands.
54
+ </example_command_not_found>
50
55
  """,
51
56
  ],
52
57
  tools=[
@@ -872,6 +872,46 @@ IMPORTANT: Every time you finish a plan and start a new resource creation or upd
872
872
  {datasource_instructions}
873
873
  {datasource_example}
874
874
 
875
+ ## Updating a datasource schema already deployed in Cloud
876
+ If you make changes to a .datasource file that are incompatible with the Cloud version, you must use a forward query to transform the data from the cloud schema to the new one. Otherwise, your deployment fails due to a schema mismatch.
877
+ The `FORWARD_QUERY` instruction is a SELECT query executed on the cloud data source.
878
+ The query must include the column selection part of the query.
879
+ `FROM` and `WHERE` clauses aren't supported.
880
+
881
+ <example_datasource_file_with_forward_query>
882
+ DESCRIPTION >
883
+ Analytics events landing data source
884
+
885
+ SCHEMA >
886
+ `timestamp` DateTime `json:$.timestamp`,
887
+ `session_id` UUID `json:$.session_id`,
888
+ `action` String `json:$.action`,
889
+ `version` String `json:$.version`,
890
+ `payload` String `json:$.payload`
891
+
892
+ ENGINE "MergeTree"
893
+ ENGINE_PARTITION_KEY "toYYYYMM(timestamp)"
894
+ ENGINE_SORTING_KEY "timestamp"
895
+ ENGINE_TTL "timestamp + toIntervalDay(60)"
896
+
897
+ FORWARD_QUERY >
898
+ SELECT timestamp, CAST(session_id, 'UUID') as session_id, action, version, payload
899
+ </example_datasource_file_with_forward_query>
900
+
901
+ Tinybird runs a backfill to migrate the data to the new schema. These backfills are logged in `tinybird.datasources_ops_log` with the `event_type` set to `deployment_backfill`.
902
+ If the existing data is incompatible with the schema change, the staging deployment fails and is discarded. For example, if you change a data type from String to UUID, but the existing da
903
+ If you're willing to accept data loss or default values for incompatible records, you can make the deployment succeed by using the accurateCastOrDefault function in your forward query:
904
+
905
+ ```
906
+ FORWARD_QUERY >
907
+ SELECT timestamp, accurateCastOrDefault(session_id, 'UUID') as session_id, action, version, payload
908
+ ```
909
+ After changes have been deployed and promoted, if you want to deploy other changes that don't affect that data source, you can remove the forward query.
910
+
911
+ <dev_notes>
912
+ If after running a deployment, the error contains a recommended forward query, use it to update the .datasource file.
913
+ </dev_notes>
914
+
875
915
  # Working with any type of pipe file:
876
916
  {pipe_instructions}
877
917
  {pipe_example}
@@ -930,6 +970,7 @@ They can be run on a schedule, or executed on demand.
930
970
  - Use append if user explicitly asks for it
931
971
  - Do not append data if user requests to test an endpoint or call an endpoint.
932
972
  - Do not append data as consequence of an empty response from the endpoint or a query.
973
+ - If the external url provided is not valid or the format is not supported, tell the user to provide a valid remote file url.
933
974
 
934
975
  # How to use `mock` tool:
935
976
  - Use `mock` tool as part of the creation of a new landing datasource if the user did not provided a file or an external url
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: tinybird
3
- Version: 0.0.1.dev283
3
+ Version: 0.0.1.dev285
4
4
  Summary: Tinybird Command Line Tool
5
5
  Home-page: https://www.tinybird.co/docs/forward/commands
6
6
  Author: Tinybird