tinybird 0.0.1.dev254__tar.gz → 0.0.1.dev256__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 (141) hide show
  1. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/PKG-INFO +1 -1
  2. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/prompts.py +1 -2
  3. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb/__cli__.py +2 -2
  4. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb/modules/agent/agent.py +104 -23
  5. tinybird-0.0.1.dev256/tinybird/tb/modules/agent/memory.py +103 -0
  6. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb/modules/agent/prompts.py +138 -28
  7. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb/modules/agent/tools/append.py +27 -4
  8. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb/modules/agent/tools/deploy.py +0 -2
  9. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb/modules/agent/tools/deploy_check.py +0 -3
  10. tinybird-0.0.1.dev256/tinybird/tb/modules/agent/tools/diff_resource.py +51 -0
  11. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb/modules/agent/tools/execute_query.py +5 -4
  12. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb/modules/agent/tools/get_endpoint_stats.py +1 -1
  13. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb/modules/agent/tools/mock.py +1 -1
  14. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb/modules/agent/tools/preview_datafile.py +1 -1
  15. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb/modules/agent/tools/request_endpoint.py +4 -4
  16. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb/modules/agent/utils.py +8 -2
  17. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb/modules/common.py +17 -0
  18. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird.egg-info/PKG-INFO +1 -1
  19. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird.egg-info/SOURCES.txt +1 -0
  20. tinybird-0.0.1.dev254/tinybird/tb/modules/agent/memory.py +0 -41
  21. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/setup.cfg +0 -0
  22. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/__cli__.py +0 -0
  23. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/ch_utils/constants.py +0 -0
  24. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/ch_utils/engine.py +0 -0
  25. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/check_pypi.py +0 -0
  26. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/client.py +0 -0
  27. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/config.py +0 -0
  28. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/connectors.py +0 -0
  29. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/context.py +0 -0
  30. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/datafile/common.py +0 -0
  31. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/datafile/exceptions.py +0 -0
  32. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/datafile/parse_connection.py +0 -0
  33. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/datafile/parse_datasource.py +0 -0
  34. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/datafile/parse_pipe.py +0 -0
  35. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/datatypes.py +0 -0
  36. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/feedback_manager.py +0 -0
  37. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/git_settings.py +0 -0
  38. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/sql.py +0 -0
  39. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/sql_template.py +0 -0
  40. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/sql_template_fmt.py +0 -0
  41. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/sql_toolset.py +0 -0
  42. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/syncasync.py +0 -0
  43. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb/check_pypi.py +0 -0
  44. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb/cli.py +0 -0
  45. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb/client.py +0 -0
  46. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb/config.py +0 -0
  47. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb/modules/agent/__init__.py +0 -0
  48. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb/modules/agent/animations.py +0 -0
  49. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb/modules/agent/banner.py +0 -0
  50. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb/modules/agent/models.py +0 -0
  51. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb/modules/agent/tools/__init__.py +0 -0
  52. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb/modules/agent/tools/analyze.py +0 -0
  53. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb/modules/agent/tools/build.py +0 -0
  54. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb/modules/agent/tools/create_datafile.py +0 -0
  55. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb/modules/agent/tools/explore.py +0 -0
  56. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb/modules/agent/tools/get_openapi_definition.py +0 -0
  57. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb/modules/agent/tools/plan.py +0 -0
  58. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb/modules/build.py +0 -0
  59. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb/modules/build_common.py +0 -0
  60. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb/modules/cicd.py +0 -0
  61. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb/modules/cli.py +0 -0
  62. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb/modules/config.py +0 -0
  63. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb/modules/connection.py +0 -0
  64. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb/modules/copy.py +0 -0
  65. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb/modules/create.py +0 -0
  66. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb/modules/datafile/build.py +0 -0
  67. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb/modules/datafile/build_common.py +0 -0
  68. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb/modules/datafile/build_datasource.py +0 -0
  69. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb/modules/datafile/build_pipe.py +0 -0
  70. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb/modules/datafile/diff.py +0 -0
  71. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb/modules/datafile/fixture.py +0 -0
  72. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb/modules/datafile/format_common.py +0 -0
  73. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb/modules/datafile/format_datasource.py +0 -0
  74. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb/modules/datafile/format_pipe.py +0 -0
  75. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb/modules/datafile/pipe_checker.py +0 -0
  76. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb/modules/datafile/playground.py +0 -0
  77. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb/modules/datafile/pull.py +0 -0
  78. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb/modules/datasource.py +0 -0
  79. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb/modules/deployment.py +0 -0
  80. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb/modules/deployment_common.py +0 -0
  81. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb/modules/deprecations.py +0 -0
  82. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb/modules/dev_server.py +0 -0
  83. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb/modules/endpoint.py +0 -0
  84. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb/modules/exceptions.py +0 -0
  85. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb/modules/feedback_manager.py +0 -0
  86. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb/modules/info.py +0 -0
  87. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb/modules/infra.py +0 -0
  88. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb/modules/job.py +0 -0
  89. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb/modules/llm.py +0 -0
  90. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb/modules/llm_utils.py +0 -0
  91. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb/modules/local.py +0 -0
  92. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb/modules/local_common.py +0 -0
  93. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb/modules/login.py +0 -0
  94. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb/modules/login_common.py +0 -0
  95. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb/modules/logout.py +0 -0
  96. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb/modules/materialization.py +0 -0
  97. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb/modules/mock.py +0 -0
  98. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb/modules/mock_common.py +0 -0
  99. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb/modules/open.py +0 -0
  100. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb/modules/pipe.py +0 -0
  101. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb/modules/project.py +0 -0
  102. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb/modules/regions.py +0 -0
  103. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb/modules/secret.py +0 -0
  104. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb/modules/secret_common.py +0 -0
  105. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb/modules/shell.py +0 -0
  106. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb/modules/sink.py +0 -0
  107. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb/modules/table.py +0 -0
  108. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb/modules/telemetry.py +0 -0
  109. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb/modules/test.py +0 -0
  110. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb/modules/tinyunit/tinyunit.py +0 -0
  111. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb/modules/tinyunit/tinyunit_lib.py +0 -0
  112. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb/modules/token.py +0 -0
  113. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb/modules/watch.py +0 -0
  114. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb/modules/workspace.py +0 -0
  115. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb/modules/workspace_members.py +0 -0
  116. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb_cli.py +0 -0
  117. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb_cli_modules/auth.py +0 -0
  118. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb_cli_modules/branch.py +0 -0
  119. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb_cli_modules/cicd.py +0 -0
  120. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb_cli_modules/cli.py +0 -0
  121. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb_cli_modules/common.py +0 -0
  122. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb_cli_modules/config.py +0 -0
  123. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb_cli_modules/connection.py +0 -0
  124. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb_cli_modules/datasource.py +0 -0
  125. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb_cli_modules/exceptions.py +0 -0
  126. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb_cli_modules/fmt.py +0 -0
  127. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb_cli_modules/job.py +0 -0
  128. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb_cli_modules/pipe.py +0 -0
  129. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb_cli_modules/regions.py +0 -0
  130. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb_cli_modules/tag.py +0 -0
  131. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb_cli_modules/telemetry.py +0 -0
  132. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb_cli_modules/test.py +0 -0
  133. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb_cli_modules/tinyunit/tinyunit.py +0 -0
  134. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb_cli_modules/tinyunit/tinyunit_lib.py +0 -0
  135. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb_cli_modules/workspace.py +0 -0
  136. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tb_cli_modules/workspace_members.py +0 -0
  137. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird/tornado_template.py +0 -0
  138. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird.egg-info/dependency_links.txt +0 -0
  139. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird.egg-info/entry_points.txt +0 -0
  140. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/tinybird.egg-info/requires.txt +0 -0
  141. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev256}/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.dev254
3
+ Version: 0.0.1.dev256
4
4
  Summary: Tinybird Command Line Tool
5
5
  Home-page: https://www.tinybird.co/docs/forward/commands
6
6
  Author: Tinybird
@@ -689,7 +689,6 @@ materialized_pipe_instructions = """
689
689
  - TYPE MATERIALIZED is the type of the pipe and it is mandatory for materialized pipes.
690
690
  - The content of the .pipe file must follow the materialized_pipe_content format.
691
691
  - Use State modifier for the aggregated columns in the pipe.
692
- - Keep the SQL query simple and avoid using complex queries with joins, subqueries, etc.
693
692
  </materialized_pipe_instructions>
694
693
  <materialized_pipe_content>
695
694
  NODE daily_sales
@@ -812,11 +811,11 @@ TYPE endpoint
812
811
  """
813
812
 
814
813
  pipe_instructions = """
814
+ Follow these instructions when creating or updating any type of .pipe file:
815
815
  <pipe_file_instructions>
816
816
  - The pipe names must be unique.
817
817
  - Nodes do NOT use the same name as the Pipe they belong to. So if the pipe name is "my_pipe", the nodes must be named different like "my_pipe_node_1", "my_pipe_node_2", etc.
818
818
  - Node names MUST be different from the resource names in the project.
819
- - Avoid more than one node per pipe unless it is really necessary or requested by the user.
820
819
  - No indentation is allowed for property names: DESCRIPTION, NODE, SQL, TYPE, etc.
821
820
  - Allowed TYPE values are: endpoint, copy, materialized, sink.
822
821
  - Add always the output node in the TYPE section or in the last node of the pipe.
@@ -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.dev254'
8
- __revision__ = '269e345'
7
+ __version__ = '0.0.1.dev256'
8
+ __revision__ = '78e1011'
@@ -26,13 +26,14 @@ from tinybird.prompts import (
26
26
  from tinybird.tb.client import TinyB
27
27
  from tinybird.tb.modules.agent.animations import ThinkingAnimation
28
28
  from tinybird.tb.modules.agent.banner import display_banner
29
- from tinybird.tb.modules.agent.memory import clear_history
29
+ from tinybird.tb.modules.agent.memory import clear_history, clear_messages, load_messages, save_messages
30
30
  from tinybird.tb.modules.agent.models import create_model, model_costs
31
31
  from tinybird.tb.modules.agent.prompts import (
32
32
  datafile_instructions,
33
33
  endpoint_optimization_instructions,
34
34
  plan_instructions,
35
35
  resources_prompt,
36
+ sql_agent_instructions,
36
37
  sql_instructions,
37
38
  )
38
39
  from tinybird.tb.modules.agent.tools.analyze import analyze_file, analyze_url
@@ -41,6 +42,7 @@ from tinybird.tb.modules.agent.tools.build import build
41
42
  from tinybird.tb.modules.agent.tools.create_datafile import create_datafile
42
43
  from tinybird.tb.modules.agent.tools.deploy import deploy
43
44
  from tinybird.tb.modules.agent.tools.deploy_check import deploy_check
45
+ from tinybird.tb.modules.agent.tools.diff_resource import diff_resource
44
46
  from tinybird.tb.modules.agent.tools.execute_query import execute_query
45
47
  from tinybird.tb.modules.agent.tools.get_endpoint_stats import get_endpoint_stats
46
48
  from tinybird.tb.modules.agent.tools.get_openapi_definition import get_openapi_definition
@@ -53,7 +55,7 @@ from tinybird.tb.modules.build_common import process as build_process
53
55
  from tinybird.tb.modules.common import _analyze, _get_tb_client
54
56
  from tinybird.tb.modules.config import CLIConfig
55
57
  from tinybird.tb.modules.deployment_common import create_deployment
56
- from tinybird.tb.modules.exceptions import CLIBuildException, CLIMockException
58
+ from tinybird.tb.modules.exceptions import CLIBuildException, CLIDeploymentException, CLIMockException
57
59
  from tinybird.tb.modules.feedback_manager import FeedbackManager
58
60
  from tinybird.tb.modules.local_common import get_tinybird_local_client
59
61
  from tinybird.tb.modules.login_common import login
@@ -76,7 +78,8 @@ class TinybirdAgent:
76
78
  self.host = host
77
79
  self.dangerously_skip_permissions = dangerously_skip_permissions
78
80
  self.project = project
79
- self.messages: list[ModelMessage] = []
81
+ # we load the last 5 messages to manage token usage
82
+ self.messages: list[ModelMessage] = load_messages()[-5:]
80
83
  self.agent = Agent(
81
84
  model=create_model(user_token, host, workspace_id),
82
85
  deps_type=TinybirdAgentContext,
@@ -121,6 +124,7 @@ You have access to the following tools:
121
124
  12. `get_openapi_definition` - Get the OpenAPI definition for all endpoints that are built/deployed to Tinybird Cloud or Local.
122
125
  13. `execute_query` - Execute a query against Tinybird Cloud or Local.
123
126
  13. `request_endpoint` - Request an endpoint against Tinybird Cloud or Local.
127
+ 14. `diff_resource` - Diff the content of a resource in Tinybird Cloud vs Tinybird Local vs Project local file.
124
128
 
125
129
  # When creating or updating datafiles:
126
130
  1. Use `plan` tool to plan the creation or update of resources.
@@ -172,6 +176,7 @@ IMPORTANT: Every time you finish a plan and start a new resource creation or upd
172
176
  {copy_pipe_instructions}
173
177
 
174
178
  # Working with SQL queries:
179
+ {sql_agent_instructions}
175
180
  {sql_instructions}
176
181
 
177
182
  # Working with connections files:
@@ -182,6 +187,23 @@ Kafka: {kafka_connection_example}
182
187
  S3: {s3_connection_example}
183
188
  GCS: {gcs_connection_example}
184
189
 
190
+ # When executing a query or requesting/testing an endpoint:
191
+ - You need to be sure that the selected resource is updated to the last version in the environment you are working on.
192
+ - Use `diff_resource` tool to compare the content of the resource to compare the differences between environments.
193
+ - Project local file is the source of truth.
194
+ - If the resource is not present or updated to the last version in Tinybird Local, it means you need to build the project.
195
+ - If the resource is not present or updated to the last version in Tinybird Cloud, it means you need to deploy the project.
196
+
197
+ # How to use apppend tools:
198
+ - Use append as part of the creation of a new landing datasource if the user provided a file or an external url
199
+ - Use append if user explicitly asks for it
200
+ - Do not append data if user requests to test an endpoint
201
+
202
+ # How to use `mock` tool:
203
+ - 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
204
+ - Use `mock` tool if user explicitly asks for it
205
+ - Do not use `mock` tool if user requests to test an endpoint.
206
+
185
207
  # Info
186
208
  Today is {datetime.now().strftime("%Y-%m-%d")}
187
209
  """,
@@ -208,6 +230,7 @@ Today is {datetime.now().strftime("%Y-%m-%d")}
208
230
  ),
209
231
  Tool(execute_query, docstring_format="google", require_parameter_descriptions=True, takes_ctx=True),
210
232
  Tool(request_endpoint, docstring_format="google", require_parameter_descriptions=True, takes_ctx=True),
233
+ Tool(diff_resource, docstring_format="google", require_parameter_descriptions=True, takes_ctx=True),
211
234
  ],
212
235
  )
213
236
 
@@ -233,10 +256,16 @@ Today is {datetime.now().strftime("%Y-%m-%d")}
233
256
  mock_data=partial(mock_data, project=project, config=config),
234
257
  append_data=partial(append_data, config=config),
235
258
  analyze_fixture=partial(analyze_fixture, config=config),
236
- execute_cloud_query=partial(execute_cloud_query, config=config),
237
- execute_local_query=partial(execute_local_query, config=config),
259
+ execute_query_cloud=partial(execute_query_cloud, config=config),
260
+ execute_query_local=partial(execute_query_local, config=config),
238
261
  request_endpoint_cloud=partial(request_endpoint_cloud, config=config),
239
262
  request_endpoint_local=partial(request_endpoint_local, config=config),
263
+ get_datasource_datafile_cloud=partial(get_datasource_datafile_cloud, config=config),
264
+ get_datasource_datafile_local=partial(get_datasource_datafile_local, config=config),
265
+ get_pipe_datafile_cloud=partial(get_pipe_datafile_cloud, config=config),
266
+ get_pipe_datafile_local=partial(get_pipe_datafile_local, config=config),
267
+ get_connection_datafile_cloud=partial(get_connection_datafile_cloud, config=config),
268
+ get_connection_datafile_local=partial(get_connection_datafile_local, config=config),
240
269
  get_project_files=project.get_project_files,
241
270
  folder=folder,
242
271
  thinking_animation=thinking_animation,
@@ -250,6 +279,7 @@ Today is {datetime.now().strftime("%Y-%m-%d")}
250
279
  )
251
280
  new_messages = result.new_messages()
252
281
  self.messages.extend(new_messages)
282
+ save_messages(new_messages)
253
283
  thinking_animation.stop()
254
284
  usage = result.usage()
255
285
  request_tokens = usage.request_tokens or 0
@@ -293,9 +323,12 @@ def run_agent(
293
323
  login(host, auth_host="https://cloud.tinybird.co", workspace=None, interactive=False, method="browser")
294
324
  click.echo()
295
325
  cli_config = CLIConfig.get_project_config()
326
+ config = {**config, **cli_config.to_dict()}
296
327
  token = cli_config.get_token()
297
328
  user_token = cli_config.get_user_token()
298
329
  host = cli_config.get_host()
330
+ workspace_id = cli_config.get("id", "")
331
+ workspace_name = cli_config.get("name", "")
299
332
 
300
333
  if not token or not host or not user_token:
301
334
  click.echo(
@@ -339,6 +372,7 @@ def run_agent(
339
372
  break
340
373
  elif user_input.lower() == "/clear":
341
374
  clear_history()
375
+ clear_messages()
342
376
  continue
343
377
  elif user_input.lower() == "/login":
344
378
  click.echo()
@@ -381,26 +415,25 @@ def build_project(config: dict[str, Any], project: Project, silent: bool = True,
381
415
 
382
416
  def deploy_project(config: dict[str, Any], project: Project) -> None:
383
417
  client = _get_tb_client(config["token"], config["host"])
384
- create_deployment(
385
- project=project,
386
- client=client,
387
- config=config,
388
- wait=True,
389
- auto=True,
390
- allow_destructive_operations=False,
391
- )
418
+ try:
419
+ create_deployment(
420
+ project=project,
421
+ client=client,
422
+ config=config,
423
+ wait=True,
424
+ auto=True,
425
+ allow_destructive_operations=False,
426
+ )
427
+ except SystemExit as e:
428
+ raise CLIDeploymentException(e.args[0])
392
429
 
393
430
 
394
431
  def deploy_check_project(config: dict[str, Any], project: Project) -> None:
395
432
  client = _get_tb_client(config["token"], config["host"])
396
- create_deployment(
397
- project=project,
398
- client=client,
399
- config=config,
400
- check=True,
401
- wait=True,
402
- auto=True,
403
- )
433
+ try:
434
+ create_deployment(project=project, client=client, config=config, check=True, wait=True, auto=True)
435
+ except SystemExit as e:
436
+ raise CLIDeploymentException(e.args[0])
404
437
 
405
438
 
406
439
  def append_data(config: dict[str, Any], datasource_name: str, path: str) -> None:
@@ -444,12 +477,12 @@ def analyze_fixture(config: dict[str, Any], fixture_path: str, format: str = "js
444
477
  return meta
445
478
 
446
479
 
447
- def execute_cloud_query(config: dict[str, Any], query: str, pipe_name: Optional[str] = None) -> dict[str, Any]:
480
+ def execute_query_cloud(config: dict[str, Any], query: str, pipe_name: Optional[str] = None) -> dict[str, Any]:
448
481
  client = _get_tb_client(config["token"], config["host"])
449
482
  return client.query(sql=query, pipeline=pipe_name)
450
483
 
451
484
 
452
- def execute_local_query(config: dict[str, Any], query: str, pipe_name: Optional[str] = None) -> dict[str, Any]:
485
+ def execute_query_local(config: dict[str, Any], query: str, pipe_name: Optional[str] = None) -> dict[str, Any]:
453
486
  local_client = get_tinybird_local_client(config, test=False, silent=True)
454
487
  return local_client.query(sql=query, pipeline=pipe_name)
455
488
 
@@ -466,3 +499,51 @@ def request_endpoint_local(
466
499
  ) -> dict[str, Any]:
467
500
  local_client = get_tinybird_local_client(config, test=False, silent=True)
468
501
  return local_client.pipe_data(endpoint_name, format="json", params=params)
502
+
503
+
504
+ def get_datasource_datafile_cloud(config: dict[str, Any], datasource_name: str) -> str:
505
+ try:
506
+ client = _get_tb_client(config["token"], config["host"])
507
+ return client.datasource_file(datasource_name)
508
+ except Exception:
509
+ return "Datasource not found"
510
+
511
+
512
+ def get_datasource_datafile_local(config: dict[str, Any], datasource_name: str) -> str:
513
+ try:
514
+ local_client = get_tinybird_local_client(config, test=False, silent=True)
515
+ return local_client.datasource_file(datasource_name)
516
+ except Exception:
517
+ return "Datasource not found"
518
+
519
+
520
+ def get_pipe_datafile_cloud(config: dict[str, Any], pipe_name: str) -> str:
521
+ try:
522
+ client = _get_tb_client(config["token"], config["host"])
523
+ return client.pipe_file(pipe_name)
524
+ except Exception:
525
+ return "Pipe not found"
526
+
527
+
528
+ def get_pipe_datafile_local(config: dict[str, Any], pipe_name: str) -> str:
529
+ try:
530
+ local_client = get_tinybird_local_client(config, test=False, silent=True)
531
+ return local_client.pipe_file(pipe_name)
532
+ except Exception:
533
+ return "Pipe not found"
534
+
535
+
536
+ def get_connection_datafile_cloud(config: dict[str, Any], connection_name: str) -> str:
537
+ try:
538
+ client = _get_tb_client(config["token"], config["host"])
539
+ return client.connection_file(connection_name)
540
+ except Exception:
541
+ return "Connection not found"
542
+
543
+
544
+ def get_connection_datafile_local(config: dict[str, Any], connection_name: str) -> str:
545
+ try:
546
+ local_client = get_tinybird_local_client(config, test=False, silent=True)
547
+ return local_client.connection_file(connection_name)
548
+ except Exception:
549
+ return "Connection not found"
@@ -0,0 +1,103 @@
1
+ import json
2
+ from pathlib import Path
3
+ from typing import Optional
4
+
5
+ import click
6
+ from prompt_toolkit.history import FileHistory
7
+ from pydantic_ai.messages import ModelMessage, ModelMessagesTypeAdapter
8
+ from pydantic_core import to_jsonable_python
9
+
10
+ from tinybird.tb.modules.feedback_manager import FeedbackManager
11
+
12
+
13
+ def get_history_file_path():
14
+ """Get the history file path based on current working directory"""
15
+ # Get current working directory
16
+ cwd = Path.cwd()
17
+
18
+ # Get user's home directory
19
+ home = Path.home()
20
+
21
+ # Calculate relative path from home to current directory
22
+ try:
23
+ relative_path = cwd.relative_to(home)
24
+ except ValueError:
25
+ # If current directory is not under home, use absolute path components
26
+ relative_path = Path(*cwd.parts[1:]) if cwd.is_absolute() else cwd
27
+
28
+ # Create history directory structure
29
+ history_dir = home / ".tinybird" / "projects" / relative_path
30
+ history_dir.mkdir(parents=True, exist_ok=True)
31
+
32
+ # Return history file path
33
+ return history_dir / "history.txt"
34
+
35
+
36
+ def load_history() -> Optional[FileHistory]:
37
+ try:
38
+ history_file = get_history_file_path()
39
+ return FileHistory(str(history_file))
40
+ except Exception:
41
+ return None
42
+
43
+
44
+ def clear_history():
45
+ """Clear the history file"""
46
+ history_file = get_history_file_path()
47
+ history_file.unlink(missing_ok=True)
48
+
49
+
50
+ def clear_messages():
51
+ """Clear the messages file"""
52
+ messages_file = get_messages_file_path()
53
+ messages_file.unlink(missing_ok=True)
54
+
55
+
56
+ def get_messages_file_path():
57
+ """Get the history file path based on current working directory"""
58
+ # Get current working directory
59
+ cwd = Path.cwd()
60
+
61
+ # Get user's home directory
62
+ home = Path.home()
63
+
64
+ # Calculate relative path from home to current directory
65
+ try:
66
+ relative_path = cwd.relative_to(home)
67
+ except ValueError:
68
+ # If current directory is not under home, use absolute path components
69
+ relative_path = Path(*cwd.parts[1:]) if cwd.is_absolute() else cwd
70
+
71
+ # Create history directory structure
72
+ history_dir = home / ".tinybird" / "projects" / relative_path
73
+ history_dir.mkdir(parents=True, exist_ok=True)
74
+
75
+ # Return history file path
76
+ return history_dir / "messages.json"
77
+
78
+
79
+ def load_messages() -> list[ModelMessage]:
80
+ try:
81
+ messages_file = get_messages_file_path()
82
+ messages_file.touch()
83
+ if not messages_file.exists():
84
+ messages_file.touch(exist_ok=True)
85
+ messages_file.write_text("[]")
86
+ return []
87
+ with open(messages_file, "r") as f:
88
+ messages_json = json.loads(f.read() or "[]")
89
+ return ModelMessagesTypeAdapter.validate_python(messages_json)
90
+ except Exception as e:
91
+ click.echo(FeedbackManager.error(message=f"Could not load previous messages: {e}"))
92
+ messages_file.unlink(missing_ok=True)
93
+ return []
94
+
95
+
96
+ def save_messages(new_messages: list[ModelMessage]):
97
+ messages_file = get_messages_file_path()
98
+ messages_file.touch(exist_ok=True)
99
+ messages = load_messages()
100
+ messages.extend(new_messages)
101
+ messages_json = to_jsonable_python(messages)
102
+ with open(messages_file, "w") as f:
103
+ f.write(json.dumps(messages_json))
@@ -1,4 +1,7 @@
1
1
  from pathlib import Path
2
+ from typing import Any
3
+
4
+ from pydantic_ai import format_as_xml
2
5
 
3
6
  from tinybird.tb.modules.project import Project
4
7
 
@@ -73,9 +76,10 @@ sql_instructions = """
73
76
  - Use node names as table names only when nodes are present in the same file.
74
77
  - Do not reference the current node name in the SQL.
75
78
  - SQL queries only accept SELECT statements with conditions, aggregations, joins, etc.
76
- - Do NOT use CREATE TABLE, INSERT INTO, CREATE DATABASE, etc.
79
+ - Do NOT use CREATE TABLE, INSERT INTO, CREATE DATABASE, SHOW TABLES, etc.
77
80
  - Use ONLY SELECT statements in the SQL section.
78
81
  - INSERT INTO is not supported in SQL section.
82
+ - Do NOT query system.<table_name> tables.
79
83
  - When using functions try always ClickHouse functions first, then SQL functions.
80
84
  - Parameters are never quoted in any case.
81
85
  - Use the following syntax in the SQL section for the iceberg table function: iceberg('s3://bucket/path/to/table', {{tb_secret('aws_access_key_id')}}, {{tb_secret('aws_secret_access_key')}})
@@ -101,38 +105,32 @@ def resources_prompt(project: Project) -> str:
101
105
 
102
106
  resources_content = "# Existing resources in the project:\n"
103
107
  if files:
104
- paths = [Path(file_path) for file_path in files]
105
-
106
- resources_content += "\n".join(
107
- [
108
- f"""
109
- <resource>
110
- <path>{file_path.relative_to(project.folder)}</path>
111
- <type>{get_resource_type(file_path)}</type>
112
- <name>{file_path.stem}</name>
113
- <content>{file_path.read_text()}</content>
114
- </resource>
115
- """
116
- for file_path in paths
117
- ]
118
- )
108
+ resources: list[dict[str, Any]] = []
109
+ for filename in files:
110
+ file_path = Path(filename)
111
+ resource = {
112
+ "path": str(file_path.relative_to(project.folder)),
113
+ "type": get_resource_type(file_path),
114
+ "name": file_path.stem,
115
+ "content": file_path.read_text(),
116
+ }
117
+ resources.append(resource)
118
+ resources_content = format_as_xml(resources, root_tag="resources", item_tag="resource")
119
119
  else:
120
120
  resources_content += "No resources found"
121
121
 
122
122
  fixture_content = "# Fixture files in the project:\n"
123
123
  if fixture_files:
124
- paths = [Path(file_path) for file_path in fixture_files]
125
- fixture_content += "\n".join(
126
- [
127
- f"""
128
- <fixture>
129
- <path>{file_path.relative_to(project.folder)}</path>
130
- <name>{file_path.stem}</name>
131
- </fixture>
132
- """
133
- for file_path in paths
134
- ]
135
- )
124
+ fixtures: list[dict[str, Any]] = []
125
+ for filename in fixture_files:
126
+ file_path = Path(filename)
127
+ fixture = {
128
+ "path": str(file_path.relative_to(project.folder)),
129
+ "name": file_path.stem,
130
+ }
131
+ fixtures.append(fixture)
132
+ fixture_content = format_as_xml(fixtures, root_tag="fixtures", item_tag="fixture")
133
+
136
134
  else:
137
135
  fixture_content += "No fixture files found"
138
136
 
@@ -384,3 +382,115 @@ SQL >
384
382
  5. **JOIN carefully** - Consider alternatives and optimize when necessary
385
383
  </endpoint_optimization_instructions>
386
384
  """
385
+
386
+
387
+ sql_agent_instructions = """
388
+ # SQL Best Practices Rules
389
+
390
+ ## Core Principles
391
+ 1. **The best data is the data you don't write** - Don't save unnecessary data
392
+ 2. **The second best data is the one you don't read** - Filter as early as possible
393
+ 3. **Sequential reads are much faster** - Use proper indexes and sorting keys
394
+ 4. **The less data you process after read, the better** - Select only needed columns
395
+ 5. **Perform complex operations later in the processing pipeline** - Filter before joins/aggregations
396
+
397
+ ## SQL Query Rules
398
+
399
+ ### 1. Filter Placement Rules
400
+ - **ALWAYS** apply WHERE filters before ORDER BY clauses
401
+ - **ALWAYS** apply WHERE filters before GROUP BY operations
402
+ - **ALWAYS** filter data at the earliest possible point in the query
403
+ - **NEVER** sort data before filtering it
404
+
405
+ ### 2. Column Selection Rules
406
+ - **NEVER** use SELECT * in production queries
407
+ - **ALWAYS** specify only the columns you need
408
+ - **ALWAYS** minimize the number of columns retrieved to reduce memory usage
409
+
410
+ ### 3. Sorting and Index Rules
411
+ - **ALWAYS** filter by ENGINE_SORTING_KEY columns first (typically date/time columns)
412
+ - **ALWAYS** order filtering conditions from most to least selective
413
+ - **ALWAYS** use columns in ENGINE_SORTING_KEY for WHERE clauses when possible
414
+ - **NEVER** use functions on indexed columns in WHERE clauses (e.g., avoid DATE_FORMAT, EXTRACT)
415
+
416
+ ### 4. Join Optimization Rules
417
+ - **ALWAYS** pre-filter data before JOIN operations
418
+ - **NEVER** join tables with more than 1 million rows without filtering
419
+ - **ALWAYS** filter the right-side table in joins using subqueries
420
+ - **PREFERRED** pattern for large joins:
421
+ ```sql
422
+ -- Good: Pre-filter right table
423
+ FROM left_table AS left
424
+ INNER JOIN (
425
+ SELECT id, column FROM right_table
426
+ WHERE id IN (SELECT id FROM left_table)
427
+ ) AS right ON left.id = right.id
428
+ ```
429
+
430
+ ### 5. Aggregation Rules
431
+ - **NEVER** use nested aggregate functions (e.g., MAX(AVG(column)))
432
+ - **ALWAYS** use subqueries instead of nested aggregates
433
+ - **ALWAYS** filter data before GROUP BY operations
434
+ - **ALWAYS** perform aggregations as late as possible in the query
435
+
436
+ ### 6. Complex Operations Order
437
+ - **ALWAYS** follow this operation order:
438
+ 1. Filter (WHERE)
439
+ 2. Select only needed columns
440
+ 3. Join (if necessary)
441
+ 4. Group/Aggregate (if necessary)
442
+ 5. Sort (ORDER BY)
443
+ 6. Limit
444
+
445
+ ### 7. Aggregate Function Rules
446
+ - **ALWAYS** use -Merge combinators (countMerge, avgMerge, etc.) when querying AggregateFunction columns
447
+ - **ALWAYS** apply -Merge functions as late as possible in the pipeline
448
+ - **NEVER** select AggregateFunction columns without the appropriate -Merge combinator
449
+
450
+ ### 8. Performance Rules
451
+ - **AVOID** full table scans - always include WHERE clauses
452
+ - **AVOID** reading more than 1GB of data in a single query
453
+ - **AVOID** operations that load large datasets into memory
454
+ - **MINIMIZE** the number of rows processed at each step
455
+
456
+ ### 9. Memory Optimization Rules
457
+ - **REDUCE** column count when hitting memory limits
458
+ - **AVOID** cross JOINs that generate excessive rows
459
+ - **FILTER** before massive GROUP BY operations
460
+ - **CHUNK** large populate operations (they run in 1M row chunks)
461
+
462
+ ### 10. Query Pattern Examples
463
+
464
+ **BAD Pattern - Filtering after sorting:**
465
+ ```sql
466
+ SELECT * FROM table ORDER BY date WHERE condition = true
467
+ ```
468
+
469
+ **GOOD Pattern - Filtering before sorting:**
470
+ ```sql
471
+ SELECT column1, column2 FROM table WHERE condition = true ORDER BY date
472
+ ```
473
+
474
+ **BAD Pattern - Nested aggregates:**
475
+ ```sql
476
+ SELECT MAX(AVG(amount)) FROM table
477
+ ```
478
+
479
+ **GOOD Pattern - Using subquery:**
480
+ ```sql
481
+ SELECT MAX(avg_amount) FROM (SELECT AVG(amount) as avg_amount FROM table)
482
+ ```
483
+
484
+ **BAD Pattern - Unfiltered join:**
485
+ ```sql
486
+ SELECT * FROM small_table JOIN huge_table ON small_table.id = huge_table.id
487
+ ```
488
+
489
+ **GOOD Pattern - Pre-filtered join:**
490
+ ```sql
491
+ SELECT needed_columns
492
+ FROM small_table
493
+ JOIN (SELECT id, col FROM huge_table WHERE id IN (SELECT id FROM small_table)) filtered
494
+ ON small_table.id = filtered.id
495
+ ```
496
+ """
@@ -41,10 +41,12 @@ def append_file(ctx: RunContext[TinybirdAgentContext], datasource_name: str, fix
41
41
  ctx.deps.thinking_animation.start()
42
42
  return f"Data appended to {datasource_name}"
43
43
  except Exception as e:
44
+ error_message = str(e)
44
45
  ctx.deps.thinking_animation.stop()
45
- click.echo(FeedbackManager.error(message=e))
46
+ click.echo(FeedbackManager.error(message=error_message))
47
+ error_message = handle_quarantine_error(ctx, error_message, datasource_name)
46
48
  ctx.deps.thinking_animation.start()
47
- return f"Error appending fixture {fixture_pathname} to {datasource_name}: {e}"
49
+ return f"Error appending fixture {fixture_pathname} to {datasource_name}: {error_message}"
48
50
 
49
51
 
50
52
  def append_url(ctx: RunContext[TinybirdAgentContext], datasource_name: str, fixture_url: str) -> str:
@@ -81,7 +83,28 @@ def append_url(ctx: RunContext[TinybirdAgentContext], datasource_name: str, fixt
81
83
  ctx.deps.thinking_animation.start()
82
84
  return f"Data appended to {datasource_name}"
83
85
  except Exception as e:
86
+ error_message = str(e)
84
87
  ctx.deps.thinking_animation.stop()
85
- click.echo(FeedbackManager.error(message=e))
88
+ click.echo(FeedbackManager.error(message=error_message))
89
+ error_message = handle_quarantine_error(ctx, error_message, datasource_name)
86
90
  ctx.deps.thinking_animation.start()
87
- return f"Error appending URL {fixture_url} to {datasource_name}: {e}"
91
+ return f"Error appending URL {fixture_url} to {datasource_name}: {error_message}"
92
+
93
+
94
+ def handle_quarantine_error(ctx: RunContext[TinybirdAgentContext], error_message: str, datasource_name: str) -> str:
95
+ try:
96
+ if "in quarantine" in error_message:
97
+ click.echo(FeedbackManager.highlight(message=f"\n» Looking for errors in {datasource_name}_quarantine..."))
98
+ query = (
99
+ f"select * from {datasource_name}_quarantine order by insertion_date desc limit 5 FORMAT CSVWithNames"
100
+ )
101
+ quarantine_data = ctx.deps.execute_query_local(query=query)
102
+ error_message = (
103
+ error_message
104
+ + f"\nThese are the first 5 rows of the quarantine table for datasource '{datasource_name}':\n{quarantine_data}. Use again `mock` tool but add this issue to the context."
105
+ )
106
+
107
+ except Exception as quarantine_error:
108
+ error_message = error_message + f"\nError accessing to {datasource_name}_quarantine: {quarantine_error}"
109
+
110
+ return error_message
@@ -30,7 +30,5 @@ def deploy(ctx: RunContext[TinybirdAgentContext]) -> str:
30
30
  ctx.deps.thinking_animation.start()
31
31
  return "Project deployed successfully"
32
32
  except Exception as e:
33
- ctx.deps.thinking_animation.stop()
34
- click.echo(FeedbackManager.error(message=e))
35
33
  ctx.deps.thinking_animation.start()
36
34
  return f"Error depoying project: {e}"
@@ -2,7 +2,6 @@ import click
2
2
  from pydantic_ai import RunContext
3
3
 
4
4
  from tinybird.tb.modules.agent.utils import TinybirdAgentContext, show_confirmation, show_input
5
- from tinybird.tb.modules.feedback_manager import FeedbackManager
6
5
 
7
6
 
8
7
  def deploy_check(ctx: RunContext[TinybirdAgentContext]) -> str:
@@ -28,7 +27,5 @@ def deploy_check(ctx: RunContext[TinybirdAgentContext]) -> str:
28
27
  ctx.deps.thinking_animation.start()
29
28
  return "Project can be deployed"
30
29
  except Exception as e:
31
- ctx.deps.thinking_animation.stop()
32
- click.echo(FeedbackManager.error(message=e))
33
30
  ctx.deps.thinking_animation.start()
34
31
  return f"Project cannot be deployed: {e}"