tinybird-cli 5.22.1.dev0__tar.gz → 5.22.1.dev2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. {tinybird_cli-5.22.1.dev0 → tinybird_cli-5.22.1.dev2}/PKG-INFO +5 -2
  2. {tinybird_cli-5.22.1.dev0 → tinybird_cli-5.22.1.dev2}/tinybird/__cli__.py +2 -2
  3. {tinybird_cli-5.22.1.dev0 → tinybird_cli-5.22.1.dev2}/tinybird/datafile_common.py +11 -7
  4. {tinybird_cli-5.22.1.dev0 → tinybird_cli-5.22.1.dev2}/tinybird/feedback_manager.py +3 -0
  5. {tinybird_cli-5.22.1.dev0 → tinybird_cli-5.22.1.dev2}/tinybird/sql_template_fmt.py +4 -2
  6. {tinybird_cli-5.22.1.dev0 → tinybird_cli-5.22.1.dev2}/tinybird/tb_cli_modules/branch.py +10 -2
  7. {tinybird_cli-5.22.1.dev0 → tinybird_cli-5.22.1.dev2}/tinybird/tb_cli_modules/cli.py +14 -1
  8. {tinybird_cli-5.22.1.dev0 → tinybird_cli-5.22.1.dev2}/tinybird/tb_cli_modules/telemetry.py +1 -1
  9. {tinybird_cli-5.22.1.dev0 → tinybird_cli-5.22.1.dev2}/tinybird_cli.egg-info/PKG-INFO +5 -2
  10. {tinybird_cli-5.22.1.dev0 → tinybird_cli-5.22.1.dev2}/setup.cfg +0 -0
  11. {tinybird_cli-5.22.1.dev0 → tinybird_cli-5.22.1.dev2}/tinybird/ch_utils/constants.py +0 -0
  12. {tinybird_cli-5.22.1.dev0 → tinybird_cli-5.22.1.dev2}/tinybird/ch_utils/engine.py +0 -0
  13. {tinybird_cli-5.22.1.dev0 → tinybird_cli-5.22.1.dev2}/tinybird/check_pypi.py +0 -0
  14. {tinybird_cli-5.22.1.dev0 → tinybird_cli-5.22.1.dev2}/tinybird/client.py +0 -0
  15. {tinybird_cli-5.22.1.dev0 → tinybird_cli-5.22.1.dev2}/tinybird/config.py +0 -0
  16. {tinybird_cli-5.22.1.dev0 → tinybird_cli-5.22.1.dev2}/tinybird/connectors.py +0 -0
  17. {tinybird_cli-5.22.1.dev0 → tinybird_cli-5.22.1.dev2}/tinybird/context.py +0 -0
  18. {tinybird_cli-5.22.1.dev0 → tinybird_cli-5.22.1.dev2}/tinybird/datatypes.py +0 -0
  19. {tinybird_cli-5.22.1.dev0 → tinybird_cli-5.22.1.dev2}/tinybird/git_settings.py +0 -0
  20. {tinybird_cli-5.22.1.dev0 → tinybird_cli-5.22.1.dev2}/tinybird/sql.py +0 -0
  21. {tinybird_cli-5.22.1.dev0 → tinybird_cli-5.22.1.dev2}/tinybird/sql_template.py +0 -0
  22. {tinybird_cli-5.22.1.dev0 → tinybird_cli-5.22.1.dev2}/tinybird/sql_toolset.py +0 -0
  23. {tinybird_cli-5.22.1.dev0 → tinybird_cli-5.22.1.dev2}/tinybird/syncasync.py +0 -0
  24. {tinybird_cli-5.22.1.dev0 → tinybird_cli-5.22.1.dev2}/tinybird/tb_cli.py +0 -0
  25. {tinybird_cli-5.22.1.dev0 → tinybird_cli-5.22.1.dev2}/tinybird/tb_cli_modules/auth.py +0 -0
  26. {tinybird_cli-5.22.1.dev0 → tinybird_cli-5.22.1.dev2}/tinybird/tb_cli_modules/cicd.py +0 -0
  27. {tinybird_cli-5.22.1.dev0 → tinybird_cli-5.22.1.dev2}/tinybird/tb_cli_modules/common.py +0 -0
  28. {tinybird_cli-5.22.1.dev0 → tinybird_cli-5.22.1.dev2}/tinybird/tb_cli_modules/config.py +0 -0
  29. {tinybird_cli-5.22.1.dev0 → tinybird_cli-5.22.1.dev2}/tinybird/tb_cli_modules/connection.py +0 -0
  30. {tinybird_cli-5.22.1.dev0 → tinybird_cli-5.22.1.dev2}/tinybird/tb_cli_modules/datasource.py +0 -0
  31. {tinybird_cli-5.22.1.dev0 → tinybird_cli-5.22.1.dev2}/tinybird/tb_cli_modules/exceptions.py +0 -0
  32. {tinybird_cli-5.22.1.dev0 → tinybird_cli-5.22.1.dev2}/tinybird/tb_cli_modules/fmt.py +0 -0
  33. {tinybird_cli-5.22.1.dev0 → tinybird_cli-5.22.1.dev2}/tinybird/tb_cli_modules/job.py +0 -0
  34. {tinybird_cli-5.22.1.dev0 → tinybird_cli-5.22.1.dev2}/tinybird/tb_cli_modules/pipe.py +0 -0
  35. {tinybird_cli-5.22.1.dev0 → tinybird_cli-5.22.1.dev2}/tinybird/tb_cli_modules/regions.py +0 -0
  36. {tinybird_cli-5.22.1.dev0 → tinybird_cli-5.22.1.dev2}/tinybird/tb_cli_modules/tag.py +0 -0
  37. {tinybird_cli-5.22.1.dev0 → tinybird_cli-5.22.1.dev2}/tinybird/tb_cli_modules/test.py +0 -0
  38. {tinybird_cli-5.22.1.dev0 → tinybird_cli-5.22.1.dev2}/tinybird/tb_cli_modules/tinyunit/tinyunit.py +0 -0
  39. {tinybird_cli-5.22.1.dev0 → tinybird_cli-5.22.1.dev2}/tinybird/tb_cli_modules/tinyunit/tinyunit_lib.py +0 -0
  40. {tinybird_cli-5.22.1.dev0 → tinybird_cli-5.22.1.dev2}/tinybird/tb_cli_modules/token.py +0 -0
  41. {tinybird_cli-5.22.1.dev0 → tinybird_cli-5.22.1.dev2}/tinybird/tb_cli_modules/workspace.py +0 -0
  42. {tinybird_cli-5.22.1.dev0 → tinybird_cli-5.22.1.dev2}/tinybird/tb_cli_modules/workspace_members.py +0 -0
  43. {tinybird_cli-5.22.1.dev0 → tinybird_cli-5.22.1.dev2}/tinybird/tornado_template.py +0 -0
  44. {tinybird_cli-5.22.1.dev0 → tinybird_cli-5.22.1.dev2}/tinybird_cli.egg-info/SOURCES.txt +0 -0
  45. {tinybird_cli-5.22.1.dev0 → tinybird_cli-5.22.1.dev2}/tinybird_cli.egg-info/dependency_links.txt +0 -0
  46. {tinybird_cli-5.22.1.dev0 → tinybird_cli-5.22.1.dev2}/tinybird_cli.egg-info/entry_points.txt +0 -0
  47. {tinybird_cli-5.22.1.dev0 → tinybird_cli-5.22.1.dev2}/tinybird_cli.egg-info/requires.txt +0 -0
  48. {tinybird_cli-5.22.1.dev0 → tinybird_cli-5.22.1.dev2}/tinybird_cli.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: tinybird_cli
3
- Version: 5.22.1.dev0
3
+ Version: 5.22.1.dev2
4
4
  Summary: Tinybird Command Line Tool
5
5
  Home-page: https://www.tinybird.co/docs/cli
6
6
  Author: Tinybird
@@ -61,9 +61,12 @@ The Tinybird command-line tool allows you to use all the Tinybird functionality
61
61
  Changelog
62
62
  ----------
63
63
 
64
- 5.21.2
64
+ 5.22.0
65
65
  ***********
66
66
 
67
+ - `Added` `tb init --git --override-commit` now works on workspaces without an existing release, allowing you to initialize git deployments from scratch
68
+ - `Added` `tb release create --commit` option to specify a specific git commit instead of using HEAD
69
+ - `Improved` `tb fmt` now supports `{% end if %}` and `{% end for %}` tag variations in addition to the standard Tornado-style `{% end %}` tags
67
70
  - `Improved` Error message when trying to format a file using `tb fmt` or when we are running `tb init --git` to include the resource name and source (local/remote)
68
71
 
69
72
  5.21.1
@@ -4,5 +4,5 @@ __description__ = 'Tinybird Command Line Tool'
4
4
  __url__ = 'https://www.tinybird.co/docs/cli'
5
5
  __author__ = 'Tinybird'
6
6
  __author_email__ = 'support@tinybird.co'
7
- __version__ = '5.22.1.dev0'
8
- __revision__ = '1515157'
7
+ __version__ = '5.22.1.dev2'
8
+ __revision__ = '60ae688'
@@ -5606,16 +5606,20 @@ def is_datasource(resource: Optional[Dict[str, Any]]) -> bool:
5606
5606
 
5607
5607
 
5608
5608
  async def create_release(
5609
- client: TinyB, config: Union[Dict[str, Any], CLIConfig], semver: str, folder: Optional[str] = None
5609
+ client: TinyB,
5610
+ config: Union[Dict[str, Any], CLIConfig],
5611
+ semver: str,
5612
+ folder: Optional[str] = None,
5613
+ commit: Optional[str] = None,
5610
5614
  ) -> None:
5611
5615
  if not folder:
5612
5616
  folder = getcwd()
5613
- cli_git_release = None
5614
- try:
5615
- cli_git_release = CLIGitRelease(path=folder)
5616
- commit = cli_git_release.head_commit()
5617
- except CLIGitReleaseException:
5618
- raise CLIGitReleaseException(FeedbackManager.error_no_git_repo_for_init(repo_path=folder))
5617
+ if not commit:
5618
+ try:
5619
+ cli_git_release = CLIGitRelease(path=folder)
5620
+ commit = cli_git_release.head_commit()
5621
+ except CLIGitReleaseException:
5622
+ raise CLIGitReleaseException(FeedbackManager.error_no_git_repo_for_init(repo_path=folder))
5619
5623
 
5620
5624
  await client.release_new(config["id"], semver, commit)
5621
5625
  click.echo(FeedbackManager.success_deployment_release(semver=semver))
@@ -506,6 +506,9 @@ Ready? """
506
506
  prompt_init_git_release_force = prompt_message(
507
507
  "You are going to manually update workspace commit reference manually, this is just for special occasions. Do you want to update current commit reference '{current_commit}' to '{new_commit}'?"
508
508
  )
509
+ prompt_init_git_release_new = prompt_message(
510
+ "This workspace does not have any release yet. Do you want to create one with commit '{commit}'? This will enable 'tb deploy' to work."
511
+ )
509
512
 
510
513
  warning_exchange = warning_message(
511
514
  "Warning: Do you want to exchange Data Source {datasource_a} by Data Source {datasource_b}?"
@@ -203,13 +203,15 @@ class TinybirdDialect(ClickHouse):
203
203
  Rule(
204
204
  name="jinja_if_block_end",
205
205
  priority=203,
206
- pattern=group(r"\{%-?\s*end\s*-?%\}"),
206
+ # Accept both Tornado-style {% end %} and {% end if %}
207
+ pattern=group(r"\{%-?\s*end(\s+if)?\s*-?%\}"),
207
208
  action=actions.raise_sqlfmt_bracket_error,
208
209
  ),
209
210
  Rule(
210
211
  name="jinja_for_block_end",
211
212
  priority=211,
212
- pattern=group(r"\{%-?\s*end\s*-?%\}"),
213
+ # Accept both Tornado-style {% end %} and {% end for %}
214
+ pattern=group(r"\{%-?\s*end(\s+for)?\s*-?%\}"),
213
215
  action=actions.raise_sqlfmt_bracket_error,
214
216
  ),
215
217
  ],
@@ -137,15 +137,23 @@ set -euxo pipefail
137
137
  type=str,
138
138
  help="Semver of the new Release. Example: 1.0.0",
139
139
  )
140
+ @click.option(
141
+ "--commit",
142
+ is_flag=False,
143
+ required=False,
144
+ type=str,
145
+ default=None,
146
+ help="Git commit hash to use for the release. Defaults to current HEAD if not specified.",
147
+ )
140
148
  @coro
141
- async def release_create(semver: str) -> None:
149
+ async def release_create(semver: str, commit: Optional[str]) -> None:
142
150
  click.echo(FeedbackManager.warning_deprecated_releases())
143
151
  config = CLIConfig.get_project_config()
144
152
  _ = await try_update_config_with_remote(config, only_if_needed=True)
145
153
 
146
154
  client = config.get_client()
147
155
  folder = getcwd()
148
- await create_release(client, config, semver, folder)
156
+ await create_release(client, config, semver, folder, commit=commit)
149
157
 
150
158
 
151
159
  @release.command(name="promote", short_help="Promotes to live status a preview Release")
@@ -367,7 +367,20 @@ async def init(
367
367
  error = True
368
368
 
369
369
  elif override_commit:
370
- if click.confirm(
370
+ # Handle case where there's no existing release
371
+ if not current_ws.get("release"):
372
+ if click.confirm(FeedbackManager.prompt_init_git_release_new(commit=override_commit)):
373
+ try:
374
+ release = await cli_git_release.update_release(client, current_ws, override_commit)
375
+ except Exception as exc:
376
+ raise CLIGitReleaseException(FeedbackManager.error_exception(error=str(exc)))
377
+
378
+ final_response = FeedbackManager.success_init_git_release(
379
+ workspace_name=current_ws["name"], release_commit=release["commit"]
380
+ )
381
+ else:
382
+ return
383
+ elif click.confirm(
371
384
  FeedbackManager.prompt_init_git_release_force(
372
385
  current_commit=current_ws["release"]["commit"], new_commit=override_commit
373
386
  )
@@ -81,7 +81,7 @@ def _hide_tokens(text: str) -> str:
81
81
 
82
82
  class TelemetryHelper:
83
83
  def __init__(self, tb_host: Optional[str] = None, max_enqueued_events: int = 5) -> None:
84
- self.tb_host = tb_host or os.getenv("TB_CLI_TELEMETRY_HOST", "https://api.tinybird.co")
84
+ self.tb_host = tb_host or os.getenv("TB_CLI_TELEMETRY_HOST", "https://api.europe-west2.gcp.tinybird.co")
85
85
  self.max_enqueued_events: int = max_enqueued_events
86
86
 
87
87
  self.enabled: bool = True
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: tinybird_cli
3
- Version: 5.22.1.dev0
3
+ Version: 5.22.1.dev2
4
4
  Summary: Tinybird Command Line Tool
5
5
  Home-page: https://www.tinybird.co/docs/cli
6
6
  Author: Tinybird
@@ -61,9 +61,12 @@ The Tinybird command-line tool allows you to use all the Tinybird functionality
61
61
  Changelog
62
62
  ----------
63
63
 
64
- 5.21.2
64
+ 5.22.0
65
65
  ***********
66
66
 
67
+ - `Added` `tb init --git --override-commit` now works on workspaces without an existing release, allowing you to initialize git deployments from scratch
68
+ - `Added` `tb release create --commit` option to specify a specific git commit instead of using HEAD
69
+ - `Improved` `tb fmt` now supports `{% end if %}` and `{% end for %}` tag variations in addition to the standard Tornado-style `{% end %}` tags
67
70
  - `Improved` Error message when trying to format a file using `tb fmt` or when we are running `tb init --git` to include the resource name and source (local/remote)
68
71
 
69
72
  5.21.1