tinybird 0.0.1.dev254__tar.gz → 0.0.1.dev255__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 (140) hide show
  1. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/PKG-INFO +1 -1
  2. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/prompts.py +1 -2
  3. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb/__cli__.py +2 -2
  4. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb/modules/agent/agent.py +70 -4
  5. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb/modules/agent/prompts.py +138 -28
  6. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb/modules/agent/tools/append.py +27 -4
  7. tinybird-0.0.1.dev255/tinybird/tb/modules/agent/tools/diff_resource.py +51 -0
  8. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb/modules/agent/tools/execute_query.py +5 -4
  9. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb/modules/agent/tools/get_endpoint_stats.py +1 -1
  10. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb/modules/agent/tools/mock.py +1 -1
  11. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb/modules/agent/tools/preview_datafile.py +1 -1
  12. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb/modules/agent/tools/request_endpoint.py +4 -4
  13. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb/modules/agent/utils.py +8 -2
  14. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb/modules/common.py +17 -0
  15. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird.egg-info/PKG-INFO +1 -1
  16. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird.egg-info/SOURCES.txt +1 -0
  17. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/setup.cfg +0 -0
  18. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/__cli__.py +0 -0
  19. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/ch_utils/constants.py +0 -0
  20. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/ch_utils/engine.py +0 -0
  21. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/check_pypi.py +0 -0
  22. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/client.py +0 -0
  23. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/config.py +0 -0
  24. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/connectors.py +0 -0
  25. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/context.py +0 -0
  26. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/datafile/common.py +0 -0
  27. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/datafile/exceptions.py +0 -0
  28. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/datafile/parse_connection.py +0 -0
  29. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/datafile/parse_datasource.py +0 -0
  30. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/datafile/parse_pipe.py +0 -0
  31. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/datatypes.py +0 -0
  32. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/feedback_manager.py +0 -0
  33. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/git_settings.py +0 -0
  34. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/sql.py +0 -0
  35. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/sql_template.py +0 -0
  36. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/sql_template_fmt.py +0 -0
  37. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/sql_toolset.py +0 -0
  38. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/syncasync.py +0 -0
  39. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb/check_pypi.py +0 -0
  40. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb/cli.py +0 -0
  41. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb/client.py +0 -0
  42. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb/config.py +0 -0
  43. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb/modules/agent/__init__.py +0 -0
  44. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb/modules/agent/animations.py +0 -0
  45. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb/modules/agent/banner.py +0 -0
  46. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb/modules/agent/memory.py +0 -0
  47. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb/modules/agent/models.py +0 -0
  48. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb/modules/agent/tools/__init__.py +0 -0
  49. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb/modules/agent/tools/analyze.py +0 -0
  50. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb/modules/agent/tools/build.py +0 -0
  51. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb/modules/agent/tools/create_datafile.py +0 -0
  52. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb/modules/agent/tools/deploy.py +0 -0
  53. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb/modules/agent/tools/deploy_check.py +0 -0
  54. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb/modules/agent/tools/explore.py +0 -0
  55. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb/modules/agent/tools/get_openapi_definition.py +0 -0
  56. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb/modules/agent/tools/plan.py +0 -0
  57. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb/modules/build.py +0 -0
  58. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb/modules/build_common.py +0 -0
  59. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb/modules/cicd.py +0 -0
  60. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb/modules/cli.py +0 -0
  61. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb/modules/config.py +0 -0
  62. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb/modules/connection.py +0 -0
  63. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb/modules/copy.py +0 -0
  64. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb/modules/create.py +0 -0
  65. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb/modules/datafile/build.py +0 -0
  66. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb/modules/datafile/build_common.py +0 -0
  67. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb/modules/datafile/build_datasource.py +0 -0
  68. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb/modules/datafile/build_pipe.py +0 -0
  69. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb/modules/datafile/diff.py +0 -0
  70. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb/modules/datafile/fixture.py +0 -0
  71. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb/modules/datafile/format_common.py +0 -0
  72. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb/modules/datafile/format_datasource.py +0 -0
  73. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb/modules/datafile/format_pipe.py +0 -0
  74. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb/modules/datafile/pipe_checker.py +0 -0
  75. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb/modules/datafile/playground.py +0 -0
  76. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb/modules/datafile/pull.py +0 -0
  77. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb/modules/datasource.py +0 -0
  78. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb/modules/deployment.py +0 -0
  79. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb/modules/deployment_common.py +0 -0
  80. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb/modules/deprecations.py +0 -0
  81. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb/modules/dev_server.py +0 -0
  82. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb/modules/endpoint.py +0 -0
  83. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb/modules/exceptions.py +0 -0
  84. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb/modules/feedback_manager.py +0 -0
  85. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb/modules/info.py +0 -0
  86. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb/modules/infra.py +0 -0
  87. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb/modules/job.py +0 -0
  88. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb/modules/llm.py +0 -0
  89. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb/modules/llm_utils.py +0 -0
  90. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb/modules/local.py +0 -0
  91. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb/modules/local_common.py +0 -0
  92. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb/modules/login.py +0 -0
  93. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb/modules/login_common.py +0 -0
  94. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb/modules/logout.py +0 -0
  95. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb/modules/materialization.py +0 -0
  96. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb/modules/mock.py +0 -0
  97. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb/modules/mock_common.py +0 -0
  98. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb/modules/open.py +0 -0
  99. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb/modules/pipe.py +0 -0
  100. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb/modules/project.py +0 -0
  101. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb/modules/regions.py +0 -0
  102. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb/modules/secret.py +0 -0
  103. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb/modules/secret_common.py +0 -0
  104. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb/modules/shell.py +0 -0
  105. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb/modules/sink.py +0 -0
  106. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb/modules/table.py +0 -0
  107. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb/modules/telemetry.py +0 -0
  108. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb/modules/test.py +0 -0
  109. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb/modules/tinyunit/tinyunit.py +0 -0
  110. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb/modules/tinyunit/tinyunit_lib.py +0 -0
  111. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb/modules/token.py +0 -0
  112. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb/modules/watch.py +0 -0
  113. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb/modules/workspace.py +0 -0
  114. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb/modules/workspace_members.py +0 -0
  115. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb_cli.py +0 -0
  116. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb_cli_modules/auth.py +0 -0
  117. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb_cli_modules/branch.py +0 -0
  118. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb_cli_modules/cicd.py +0 -0
  119. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb_cli_modules/cli.py +0 -0
  120. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb_cli_modules/common.py +0 -0
  121. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb_cli_modules/config.py +0 -0
  122. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb_cli_modules/connection.py +0 -0
  123. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb_cli_modules/datasource.py +0 -0
  124. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb_cli_modules/exceptions.py +0 -0
  125. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb_cli_modules/fmt.py +0 -0
  126. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb_cli_modules/job.py +0 -0
  127. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb_cli_modules/pipe.py +0 -0
  128. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb_cli_modules/regions.py +0 -0
  129. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb_cli_modules/tag.py +0 -0
  130. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb_cli_modules/telemetry.py +0 -0
  131. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb_cli_modules/test.py +0 -0
  132. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb_cli_modules/tinyunit/tinyunit.py +0 -0
  133. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb_cli_modules/tinyunit/tinyunit_lib.py +0 -0
  134. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb_cli_modules/workspace.py +0 -0
  135. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tb_cli_modules/workspace_members.py +0 -0
  136. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird/tornado_template.py +0 -0
  137. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird.egg-info/dependency_links.txt +0 -0
  138. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird.egg-info/entry_points.txt +0 -0
  139. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/tinybird.egg-info/requires.txt +0 -0
  140. {tinybird-0.0.1.dev254 → tinybird-0.0.1.dev255}/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.dev255
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.dev255'
8
+ __revision__ = '208306e'
@@ -33,6 +33,7 @@ from tinybird.tb.modules.agent.prompts import (
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
@@ -121,6 +123,7 @@ You have access to the following tools:
121
123
  12. `get_openapi_definition` - Get the OpenAPI definition for all endpoints that are built/deployed to Tinybird Cloud or Local.
122
124
  13. `execute_query` - Execute a query against Tinybird Cloud or Local.
123
125
  13. `request_endpoint` - Request an endpoint against Tinybird Cloud or Local.
126
+ 14. `diff_resource` - Diff the content of a resource in Tinybird Cloud vs Tinybird Local vs Project local file.
124
127
 
125
128
  # When creating or updating datafiles:
126
129
  1. Use `plan` tool to plan the creation or update of resources.
@@ -172,6 +175,7 @@ IMPORTANT: Every time you finish a plan and start a new resource creation or upd
172
175
  {copy_pipe_instructions}
173
176
 
174
177
  # Working with SQL queries:
178
+ {sql_agent_instructions}
175
179
  {sql_instructions}
176
180
 
177
181
  # Working with connections files:
@@ -182,6 +186,13 @@ Kafka: {kafka_connection_example}
182
186
  S3: {s3_connection_example}
183
187
  GCS: {gcs_connection_example}
184
188
 
189
+ # When executing a query or requesting an endpoint:
190
+ - You need to be sure that the selected resource is updated to the last version in the environment you are working on.
191
+ - Use `diff_resource` tool to compare the content of the resource to compare the differences between environments.
192
+ - Project local file is the source of truth.
193
+ - If the resource is not present or updated to the last version in Tinybird Local, it means you need to build the project.
194
+ - If the resource is not present or updated to the last version in Tinybird Cloud, it means you need to deploy the project.
195
+
185
196
  # Info
186
197
  Today is {datetime.now().strftime("%Y-%m-%d")}
187
198
  """,
@@ -208,6 +219,7 @@ Today is {datetime.now().strftime("%Y-%m-%d")}
208
219
  ),
209
220
  Tool(execute_query, docstring_format="google", require_parameter_descriptions=True, takes_ctx=True),
210
221
  Tool(request_endpoint, docstring_format="google", require_parameter_descriptions=True, takes_ctx=True),
222
+ Tool(diff_resource, docstring_format="google", require_parameter_descriptions=True, takes_ctx=True),
211
223
  ],
212
224
  )
213
225
 
@@ -233,10 +245,16 @@ Today is {datetime.now().strftime("%Y-%m-%d")}
233
245
  mock_data=partial(mock_data, project=project, config=config),
234
246
  append_data=partial(append_data, config=config),
235
247
  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),
248
+ execute_query_cloud=partial(execute_query_cloud, config=config),
249
+ execute_query_local=partial(execute_query_local, config=config),
238
250
  request_endpoint_cloud=partial(request_endpoint_cloud, config=config),
239
251
  request_endpoint_local=partial(request_endpoint_local, config=config),
252
+ get_datasource_datafile_cloud=partial(get_datasource_datafile_cloud, config=config),
253
+ get_datasource_datafile_local=partial(get_datasource_datafile_local, config=config),
254
+ get_pipe_datafile_cloud=partial(get_pipe_datafile_cloud, config=config),
255
+ get_pipe_datafile_local=partial(get_pipe_datafile_local, config=config),
256
+ get_connection_datafile_cloud=partial(get_connection_datafile_cloud, config=config),
257
+ get_connection_datafile_local=partial(get_connection_datafile_local, config=config),
240
258
  get_project_files=project.get_project_files,
241
259
  folder=folder,
242
260
  thinking_animation=thinking_animation,
@@ -444,12 +462,12 @@ def analyze_fixture(config: dict[str, Any], fixture_path: str, format: str = "js
444
462
  return meta
445
463
 
446
464
 
447
- def execute_cloud_query(config: dict[str, Any], query: str, pipe_name: Optional[str] = None) -> dict[str, Any]:
465
+ def execute_query_cloud(config: dict[str, Any], query: str, pipe_name: Optional[str] = None) -> dict[str, Any]:
448
466
  client = _get_tb_client(config["token"], config["host"])
449
467
  return client.query(sql=query, pipeline=pipe_name)
450
468
 
451
469
 
452
- def execute_local_query(config: dict[str, Any], query: str, pipe_name: Optional[str] = None) -> dict[str, Any]:
470
+ def execute_query_local(config: dict[str, Any], query: str, pipe_name: Optional[str] = None) -> dict[str, Any]:
453
471
  local_client = get_tinybird_local_client(config, test=False, silent=True)
454
472
  return local_client.query(sql=query, pipeline=pipe_name)
455
473
 
@@ -466,3 +484,51 @@ def request_endpoint_local(
466
484
  ) -> dict[str, Any]:
467
485
  local_client = get_tinybird_local_client(config, test=False, silent=True)
468
486
  return local_client.pipe_data(endpoint_name, format="json", params=params)
487
+
488
+
489
+ def get_datasource_datafile_cloud(config: dict[str, Any], datasource_name: str) -> str:
490
+ try:
491
+ client = _get_tb_client(config["token"], config["host"])
492
+ return client.datasource_file(datasource_name)
493
+ except Exception:
494
+ return "Datasource not found"
495
+
496
+
497
+ def get_datasource_datafile_local(config: dict[str, Any], datasource_name: str) -> str:
498
+ try:
499
+ local_client = get_tinybird_local_client(config, test=False, silent=True)
500
+ return local_client.datasource_file(datasource_name)
501
+ except Exception:
502
+ return "Datasource not found"
503
+
504
+
505
+ def get_pipe_datafile_cloud(config: dict[str, Any], pipe_name: str) -> str:
506
+ try:
507
+ client = _get_tb_client(config["token"], config["host"])
508
+ return client.pipe_file(pipe_name)
509
+ except Exception:
510
+ return "Pipe not found"
511
+
512
+
513
+ def get_pipe_datafile_local(config: dict[str, Any], pipe_name: str) -> str:
514
+ try:
515
+ local_client = get_tinybird_local_client(config, test=False, silent=True)
516
+ return local_client.pipe_file(pipe_name)
517
+ except Exception:
518
+ return "Pipe not found"
519
+
520
+
521
+ def get_connection_datafile_cloud(config: dict[str, Any], connection_name: str) -> str:
522
+ try:
523
+ client = _get_tb_client(config["token"], config["host"])
524
+ return client.connection_file(connection_name)
525
+ except Exception:
526
+ return "Connection not found"
527
+
528
+
529
+ def get_connection_datafile_local(config: dict[str, Any], connection_name: str) -> str:
530
+ try:
531
+ local_client = get_tinybird_local_client(config, test=False, silent=True)
532
+ return local_client.connection_file(connection_name)
533
+ except Exception:
534
+ return "Connection not found"
@@ -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
@@ -0,0 +1,51 @@
1
+ from pathlib import Path
2
+
3
+ import click
4
+ from pydantic_ai import RunContext
5
+
6
+ from tinybird.tb.modules.agent.utils import Datafile, TinybirdAgentContext
7
+ from tinybird.tb.modules.feedback_manager import FeedbackManager
8
+
9
+
10
+ def diff_resource(ctx: RunContext[TinybirdAgentContext], resource: Datafile) -> str:
11
+ """Diff the content of a resource in Tinybird Cloud vs Tinybird Local vs Project local file
12
+
13
+ Args:
14
+ resource (Datafile): The resource to diff. Required.
15
+
16
+ Returns:
17
+ Datafile: The diff of the resource.
18
+ """
19
+ try:
20
+ ctx.deps.thinking_animation.stop()
21
+ click.echo(
22
+ FeedbackManager.highlight(message=f"\n» Comparing content of {resource.pathname} with Tinybird Cloud")
23
+ )
24
+ resource.pathname = resource.pathname.removeprefix("/")
25
+ project_file_path = Path(ctx.deps.folder) / resource.pathname
26
+ if not project_file_path.exists():
27
+ raise Exception(f"Resource {resource.pathname} not found in project")
28
+
29
+ project_file_content = project_file_path.read_text()
30
+ if resource.type == "datasource":
31
+ cloud_content = ctx.deps.get_datasource_datafile_cloud(datasource_name=resource.name)
32
+ local_content = ctx.deps.get_datasource_datafile_local(datasource_name=resource.name)
33
+ elif resource.type == "connection":
34
+ cloud_content = ctx.deps.get_connection_datafile_cloud(connection_name=resource.name)
35
+ local_content = ctx.deps.get_connection_datafile_local(connection_name=resource.name)
36
+ elif resource.type in ["endpoint", "materialized", "sink", "copy"]:
37
+ cloud_content = ctx.deps.get_pipe_datafile_cloud(pipe_name=resource.name)
38
+ local_content = ctx.deps.get_pipe_datafile_local(pipe_name=resource.name)
39
+ else:
40
+ raise Exception(f"{resource.type} is not a valid extension")
41
+
42
+ needs_to_build = project_file_content != local_content
43
+ needs_to_deploy = project_file_content != cloud_content
44
+ ctx.deps.thinking_animation.start()
45
+ diff = f"# Diff of resource {resource.name}:\n"
46
+ diff += f"## Tinybird Cloud: {'Deploy needed. Resource does not exist or needs to be updated. Run `deploy` tool to deploy the resource.' if needs_to_deploy else 'Nothing to deploy.'}\n"
47
+ diff += f"## Tinybird Local: {'Build needed. Resource does not exist or needs to be updated. Run `build` tool to build the resource.' if needs_to_build else 'Nothing to build.'}\n"
48
+ return diff
49
+ except Exception as e:
50
+ ctx.deps.thinking_animation.start()
51
+ return f"Could not diff resource {resource.pathname}: {e}"
@@ -3,7 +3,7 @@ import humanfriendly
3
3
  from pydantic_ai import RunContext
4
4
 
5
5
  from tinybird.tb.modules.agent.utils import TinybirdAgentContext
6
- from tinybird.tb.modules.common import echo_safe_humanfriendly_tables_format_smart_table
6
+ from tinybird.tb.modules.common import echo_safe_humanfriendly_tables_format_pretty_table
7
7
  from tinybird.tb.modules.feedback_manager import FeedbackManager
8
8
 
9
9
 
@@ -32,7 +32,7 @@ def execute_query(ctx: RunContext[TinybirdAgentContext], query: str, task: str,
32
32
  else:
33
33
  query = f"SELECT * FROM ({query}) {query_format}"
34
34
 
35
- execute_query = ctx.deps.execute_cloud_query if cloud else ctx.deps.execute_local_query
35
+ execute_query = ctx.deps.execute_query_cloud if cloud else ctx.deps.execute_query_local
36
36
  result = execute_query(query=query)
37
37
  stats = result["statistics"]
38
38
  seconds = stats["elapsed"]
@@ -44,9 +44,10 @@ def execute_query(ctx: RunContext[TinybirdAgentContext], query: str, task: str,
44
44
  if not result["data"]:
45
45
  click.echo(FeedbackManager.info_no_rows())
46
46
  else:
47
- echo_safe_humanfriendly_tables_format_smart_table(
48
- data=[d.values() for d in result["data"]], column_names=result["data"][0].keys()
47
+ echo_safe_humanfriendly_tables_format_pretty_table(
48
+ data=[d.values() for d in result["data"][:10]], column_names=result["data"][0].keys()
49
49
  )
50
+ click.echo("Showing first 10 results\n")
50
51
  ctx.deps.thinking_animation.start()
51
52
  result["data"] = result["data"][:10]
52
53
  return f"Result for task '{task}' in {cloud_or_local} environment: {result}. The user is being shown the full result in the console but this message only contains the first 10 rows."
@@ -42,7 +42,7 @@ def get_endpoint_stats(
42
42
  FORMAT JSON
43
43
  """
44
44
 
45
- execute_query = ctx.deps.execute_cloud_query if cloud else ctx.deps.execute_local_query
45
+ execute_query = ctx.deps.execute_query_cloud if cloud else ctx.deps.execute_query_local
46
46
 
47
47
  result = execute_query(query=query)
48
48
  click.echo(FeedbackManager.success(message="✓ Done!"))
@@ -60,7 +60,7 @@ def mock(
60
60
  FeedbackManager.highlight(message=f"\n» Looking for errors in {datasource_name}_quarantine...")
61
61
  )
62
62
  query = f"select * from {datasource_name}_quarantine order by insertion_date desc limit 5 FORMAT CSVWithNames"
63
- quarantine_data = ctx.deps.execute_local_query(query=query)
63
+ quarantine_data = ctx.deps.execute_query_local(query=query)
64
64
  error_message = (
65
65
  error_message
66
66
  + 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."
@@ -16,7 +16,7 @@ def preview_datafile(name: str, type: str, description: str, content: str, pathn
16
16
  """
17
17
 
18
18
  return Datafile(
19
- type=type,
19
+ type=type.lower(),
20
20
  name=name,
21
21
  content=content,
22
22
  description=description,
@@ -5,7 +5,7 @@ import humanfriendly
5
5
  from pydantic_ai import RunContext
6
6
 
7
7
  from tinybird.tb.modules.agent.utils import TinybirdAgentContext
8
- from tinybird.tb.modules.common import echo_safe_humanfriendly_tables_format_smart_table
8
+ from tinybird.tb.modules.common import echo_safe_humanfriendly_tables_format_pretty_table
9
9
  from tinybird.tb.modules.feedback_manager import FeedbackManager
10
10
 
11
11
 
@@ -48,10 +48,10 @@ def request_endpoint(
48
48
  if not result["data"]:
49
49
  click.echo(FeedbackManager.info_no_rows())
50
50
  else:
51
- echo_safe_humanfriendly_tables_format_smart_table(
52
- data=[d.values() for d in result["data"][:5]], column_names=result["data"][0].keys()
51
+ echo_safe_humanfriendly_tables_format_pretty_table(
52
+ data=[d.values() for d in result["data"][:10]], column_names=result["data"][0].keys()
53
53
  )
54
- click.echo("Showing first 5 results\n")
54
+ click.echo("Showing first 10 results\n")
55
55
  ctx.deps.thinking_animation.start()
56
56
  return f"Result for endpoint {endpoint_name} with params {params} in {cloud_or_local} environment: {result}. Do not show result is already shown in the console."
57
57
  except Exception as e:
@@ -41,10 +41,16 @@ class TinybirdAgentContext(BaseModel):
41
41
  mock_data: Callable[..., list[dict[str, Any]]]
42
42
  append_data: Callable[..., None]
43
43
  analyze_fixture: Callable[..., dict[str, Any]]
44
- execute_cloud_query: Callable[..., dict[str, Any]]
45
- execute_local_query: Callable[..., dict[str, Any]]
44
+ execute_query_cloud: Callable[..., dict[str, Any]]
45
+ execute_query_local: Callable[..., dict[str, Any]]
46
46
  request_endpoint_cloud: Callable[..., dict[str, Any]]
47
47
  request_endpoint_local: Callable[..., dict[str, Any]]
48
+ get_datasource_datafile_cloud: Callable[..., str]
49
+ get_datasource_datafile_local: Callable[..., str]
50
+ get_pipe_datafile_cloud: Callable[..., str]
51
+ get_pipe_datafile_local: Callable[..., str]
52
+ get_connection_datafile_cloud: Callable[..., str]
53
+ get_connection_datafile_local: Callable[..., str]
48
54
  dangerously_skip_permissions: bool
49
55
  token: str
50
56
  user_token: str
@@ -124,6 +124,23 @@ def echo_safe_humanfriendly_tables_format_smart_table(data: Iterable[Any], colum
124
124
  raise exc
125
125
 
126
126
 
127
+ def echo_safe_humanfriendly_tables_format_pretty_table(data: Iterable[Any], column_names: List[str]) -> None:
128
+ """
129
+ There is a bug in the humanfriendly library: it breaks to render the small table for small terminals
130
+ (`format_robust_table`) if we call format_smart_table with an empty dataset. This catches the error and prints
131
+ what we would call an empty "robust_table".
132
+ """
133
+ try:
134
+ click.echo(humanfriendly.tables.format_pretty_table(data, column_names=column_names))
135
+ except ValueError as exc:
136
+ if str(exc) == "max() arg is an empty sequence":
137
+ click.echo("------------")
138
+ click.echo("Empty")
139
+ click.echo("------------")
140
+ else:
141
+ raise exc
142
+
143
+
127
144
  def echo_safe_format_table(data: Iterable[Any], columns) -> None:
128
145
  """
129
146
  There is a bug in the humanfriendly library: it breaks to render the small table for small terminals
@@ -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.dev255
4
4
  Summary: Tinybird Command Line Tool
5
5
  Home-page: https://www.tinybird.co/docs/forward/commands
6
6
  Author: Tinybird
@@ -93,6 +93,7 @@ tinybird/tb/modules/agent/tools/build.py
93
93
  tinybird/tb/modules/agent/tools/create_datafile.py
94
94
  tinybird/tb/modules/agent/tools/deploy.py
95
95
  tinybird/tb/modules/agent/tools/deploy_check.py
96
+ tinybird/tb/modules/agent/tools/diff_resource.py
96
97
  tinybird/tb/modules/agent/tools/execute_query.py
97
98
  tinybird/tb/modules/agent/tools/explore.py
98
99
  tinybird/tb/modules/agent/tools/get_endpoint_stats.py