tinybird 0.0.1.dev183__tar.gz → 0.0.1.dev185__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 (110) hide show
  1. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/PKG-INFO +1 -1
  2. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird/tb/__cli__.py +2 -2
  3. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird/tb/modules/common.py +12 -3
  4. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird/tb/modules/create.py +54 -20
  5. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird/tb_cli_modules/auth.py +2 -3
  6. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird/tb_cli_modules/branch.py +2 -3
  7. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird/tb_cli_modules/cli.py +8 -10
  8. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird/tb_cli_modules/workspace.py +11 -12
  9. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird.egg-info/PKG-INFO +1 -1
  10. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/setup.cfg +0 -0
  11. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird/__cli__.py +0 -0
  12. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird/ch_utils/constants.py +0 -0
  13. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird/ch_utils/engine.py +0 -0
  14. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird/check_pypi.py +0 -0
  15. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird/client.py +0 -0
  16. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird/config.py +0 -0
  17. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird/connectors.py +0 -0
  18. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird/context.py +0 -0
  19. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird/datafile.py +0 -0
  20. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird/datatypes.py +0 -0
  21. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird/feedback_manager.py +0 -0
  22. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird/git_settings.py +0 -0
  23. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird/prompts.py +0 -0
  24. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird/sql.py +0 -0
  25. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird/sql_template.py +0 -0
  26. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird/sql_template_fmt.py +0 -0
  27. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird/sql_toolset.py +0 -0
  28. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird/syncasync.py +0 -0
  29. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird/tb/check_pypi.py +0 -0
  30. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird/tb/cli.py +0 -0
  31. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird/tb/client.py +0 -0
  32. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird/tb/config.py +0 -0
  33. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird/tb/modules/build.py +0 -0
  34. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird/tb/modules/cicd.py +0 -0
  35. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird/tb/modules/cli.py +0 -0
  36. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird/tb/modules/config.py +0 -0
  37. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird/tb/modules/connection.py +0 -0
  38. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird/tb/modules/copy.py +0 -0
  39. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird/tb/modules/datafile/build.py +0 -0
  40. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird/tb/modules/datafile/build_common.py +0 -0
  41. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird/tb/modules/datafile/build_datasource.py +0 -0
  42. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird/tb/modules/datafile/build_pipe.py +0 -0
  43. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird/tb/modules/datafile/common.py +0 -0
  44. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird/tb/modules/datafile/diff.py +0 -0
  45. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird/tb/modules/datafile/exceptions.py +0 -0
  46. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird/tb/modules/datafile/fixture.py +0 -0
  47. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird/tb/modules/datafile/format_common.py +0 -0
  48. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird/tb/modules/datafile/format_datasource.py +0 -0
  49. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird/tb/modules/datafile/format_pipe.py +0 -0
  50. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird/tb/modules/datafile/parse_datasource.py +0 -0
  51. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird/tb/modules/datafile/parse_pipe.py +0 -0
  52. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird/tb/modules/datafile/pipe_checker.py +0 -0
  53. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird/tb/modules/datafile/playground.py +0 -0
  54. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird/tb/modules/datafile/pull.py +0 -0
  55. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird/tb/modules/datasource.py +0 -0
  56. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird/tb/modules/deployment.py +0 -0
  57. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird/tb/modules/deprecations.py +0 -0
  58. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird/tb/modules/dev_server.py +0 -0
  59. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird/tb/modules/endpoint.py +0 -0
  60. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird/tb/modules/exceptions.py +0 -0
  61. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird/tb/modules/feedback_manager.py +0 -0
  62. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird/tb/modules/info.py +0 -0
  63. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird/tb/modules/infra.py +0 -0
  64. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird/tb/modules/job.py +0 -0
  65. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird/tb/modules/llm.py +0 -0
  66. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird/tb/modules/llm_utils.py +0 -0
  67. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird/tb/modules/local.py +0 -0
  68. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird/tb/modules/local_common.py +0 -0
  69. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird/tb/modules/login.py +0 -0
  70. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird/tb/modules/logout.py +0 -0
  71. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird/tb/modules/materialization.py +0 -0
  72. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird/tb/modules/mock.py +0 -0
  73. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird/tb/modules/open.py +0 -0
  74. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird/tb/modules/pipe.py +0 -0
  75. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird/tb/modules/project.py +0 -0
  76. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird/tb/modules/regions.py +0 -0
  77. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird/tb/modules/secret.py +0 -0
  78. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird/tb/modules/shell.py +0 -0
  79. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird/tb/modules/table.py +0 -0
  80. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird/tb/modules/telemetry.py +0 -0
  81. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird/tb/modules/test.py +0 -0
  82. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird/tb/modules/tinyunit/tinyunit.py +0 -0
  83. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird/tb/modules/tinyunit/tinyunit_lib.py +0 -0
  84. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird/tb/modules/token.py +0 -0
  85. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird/tb/modules/watch.py +0 -0
  86. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird/tb/modules/workspace.py +0 -0
  87. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird/tb/modules/workspace_members.py +0 -0
  88. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird/tb_cli.py +0 -0
  89. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird/tb_cli_modules/cicd.py +0 -0
  90. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird/tb_cli_modules/common.py +0 -0
  91. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird/tb_cli_modules/config.py +0 -0
  92. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird/tb_cli_modules/connection.py +0 -0
  93. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird/tb_cli_modules/datasource.py +0 -0
  94. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird/tb_cli_modules/exceptions.py +0 -0
  95. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird/tb_cli_modules/fmt.py +0 -0
  96. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird/tb_cli_modules/job.py +0 -0
  97. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird/tb_cli_modules/pipe.py +0 -0
  98. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird/tb_cli_modules/regions.py +0 -0
  99. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird/tb_cli_modules/tag.py +0 -0
  100. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird/tb_cli_modules/telemetry.py +0 -0
  101. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird/tb_cli_modules/test.py +0 -0
  102. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird/tb_cli_modules/tinyunit/tinyunit.py +0 -0
  103. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird/tb_cli_modules/tinyunit/tinyunit_lib.py +0 -0
  104. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird/tb_cli_modules/workspace_members.py +0 -0
  105. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird/tornado_template.py +0 -0
  106. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird.egg-info/SOURCES.txt +0 -0
  107. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird.egg-info/dependency_links.txt +0 -0
  108. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird.egg-info/entry_points.txt +0 -0
  109. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/tinybird.egg-info/requires.txt +0 -0
  110. {tinybird-0.0.1.dev183 → tinybird-0.0.1.dev185}/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.dev183
3
+ Version: 0.0.1.dev185
4
4
  Summary: Tinybird Command Line Tool
5
5
  Home-page: https://www.tinybird.co/docs/forward/commands
6
6
  Author: Tinybird
@@ -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.dev183'
8
- __revision__ = '1e2d149'
7
+ __version__ = '0.0.1.dev185'
8
+ __revision__ = 'b79d3c1'
@@ -174,8 +174,12 @@ def generate_datafile(
174
174
  base = Path(folder) / base
175
175
  datasource_name = normalize_datasource_name(p.stem)
176
176
  if not base.exists():
177
- base = Path()
177
+ if folder:
178
+ base = Path(folder)
179
+ else:
180
+ base = Path()
178
181
  f = base / (datasource_name + ".datasource")
182
+
179
183
  if not f.exists() or force:
180
184
  with open(f"{f}", "w") as ds_file:
181
185
  ds_file.write(datafile)
@@ -421,13 +425,18 @@ async def _analyze(filename: str, client: TinyB, format: str, connector: Optiona
421
425
 
422
426
 
423
427
  async def _generate_datafile(
424
- filename: str, client: TinyB, format: str, connector: Optional["Connector"] = None, force: Optional[bool] = False
428
+ filename: str,
429
+ client: TinyB,
430
+ format: str,
431
+ connector: Optional["Connector"] = None,
432
+ force: Optional[bool] = False,
433
+ folder: Optional[str] = None,
425
434
  ):
426
435
  meta, data = await _analyze(filename, client, format, connector=connector)
427
436
  schema = meta["analysis"]["schema"]
428
437
  schema = schema.replace(", ", ",\n ")
429
438
  datafile = f"""DESCRIPTION >\n Generated from {filename}\n\nSCHEMA >\n {schema}"""
430
- return generate_datafile(datafile, filename, data, force, _format=format)
439
+ return generate_datafile(datafile, filename, data, force, _format=format, folder=folder)
431
440
 
432
441
 
433
442
  async def configure_connector(connector):
@@ -3,8 +3,10 @@ import os
3
3
  import re
4
4
  from pathlib import Path
5
5
  from typing import Any, Dict, List, Optional
6
+ from urllib.parse import urlparse
6
7
 
7
8
  import click
9
+ import requests
8
10
 
9
11
  from tinybird.prompts import create_prompt, readme_prompt, rules_prompt
10
12
  from tinybird.tb.client import TinyB
@@ -25,7 +27,7 @@ from tinybird.tb.modules.project import Project
25
27
  @cli.command()
26
28
  @click.option(
27
29
  "--data",
28
- type=click.Path(exists=True),
30
+ type=str,
29
31
  default=None,
30
32
  help="Initial data to be used to create the project. Tinybird Local and authentication are required.",
31
33
  )
@@ -54,9 +56,6 @@ async def create(
54
56
  config.persist_to_file()
55
57
  project.folder = folder
56
58
 
57
- if cwd := config.get("cwd"):
58
- click.echo(FeedbackManager.gray(message=f"Using '{cwd.replace(os.getcwd(), '')}' as target folder"))
59
-
60
59
  root_folder = os.getcwd()
61
60
  if config._path:
62
61
  root_folder = os.path.dirname(config._path)
@@ -76,7 +75,7 @@ async def create(
76
75
  if not user_token:
77
76
  raise Exception("This action requires authentication. Run 'tb login' first.")
78
77
 
79
- if not validate_project_structure(folder):
78
+ if not validate_project_structure(project):
80
79
  click.echo(FeedbackManager.highlight(message="\n» Creating new project structure..."))
81
80
  create_project_structure(folder)
82
81
  click.echo(FeedbackManager.success(message="✓ Scaffolding completed!\n"))
@@ -87,7 +86,10 @@ async def create(
87
86
 
88
87
  data_result: List[Path] = []
89
88
  if data:
90
- data_result = await create_resources_from_data(data, project, ctx_config)
89
+ if urlparse(data).scheme in ("http", "https"):
90
+ data_result = await create_resources_from_url(data, project, ctx_config)
91
+ else:
92
+ data_result = await create_resources_from_data(data, project, ctx_config)
91
93
  result.extend(data_result)
92
94
 
93
95
  prompt_result: List[Path] = []
@@ -134,14 +136,22 @@ async def create(
134
136
 
135
137
  if data:
136
138
  for ds_path in [ds for ds in data_result if ds.suffix == ".datasource"]:
137
- data_path = Path(data)
138
- data_content = data_path.read_text()
139
+ parsed_url = urlparse(data)
140
+ if parsed_url.scheme in ("http", "https"):
141
+ response = requests.get(data) # noqa: ASYNC210
142
+ data_content = response.text
143
+ data_format = parsed_url.path.split(".")[-1]
144
+ else:
145
+ data_path = Path(data)
146
+ data_content = data_path.read_text()
147
+ data_format = data_path.suffix.lstrip(".")
148
+
139
149
  ds_name = ds_path.stem
140
- data_format = data_path.suffix.lstrip(".")
141
150
  datasource_path = Path(folder) / "datasources" / f"{ds_name}.datasource"
142
- click.echo(FeedbackManager.info(message=f"✓ /fixtures/{ds_name}"))
151
+ click.echo(FeedbackManager.info(message=f"✓ /fixtures/{ds_name}.{data_format}"))
143
152
  persist_fixture(ds_name, data_content, folder, format=data_format)
144
153
  created_something = True
154
+
145
155
  elif prompt and prompt_result:
146
156
  ds_results = [path for path in prompt_result if path.suffix == ".datasource"]
147
157
  for datasource_path in ds_results:
@@ -175,14 +185,13 @@ async def create(
175
185
  PROJECT_PATHS = ("datasources", "endpoints", "materializations", "copies", "pipes", "fixtures", "tests", "connections")
176
186
 
177
187
 
178
- def validate_project_structure(folder: str) -> bool:
179
- some_folder_created = any((Path(folder) / path).exists() for path in PROJECT_PATHS)
188
+ def validate_project_structure(project: Project) -> bool:
189
+ some_folder_created = any((Path(project.folder) / path).exists() for path in PROJECT_PATHS)
180
190
  if some_folder_created:
181
191
  return True
182
192
 
183
- folder_path = Path(folder)
184
- datasources = list(folder_path.glob("**/*.datasource"))
185
- pipes = list(folder_path.glob("**/*.pipe"))
193
+ datasources = project.get_datasource_files()
194
+ pipes = project.get_pipe_files()
186
195
 
187
196
  return len(datasources) > 0 or len(pipes) > 0
188
197
 
@@ -452,12 +461,37 @@ async def create_resources_from_data(
452
461
  project: Project,
453
462
  config: Dict[str, Any],
454
463
  ) -> List[Path]:
455
- folder_path = project.path
456
464
  local_client = await get_tinybird_local_client(config)
465
+ folder_path = project.path
457
466
  path = folder_path / data
467
+ if not path.exists():
468
+ path = Path(data)
458
469
  result: List[Path] = []
459
470
  format = path.suffix.lstrip(".")
460
- ds_file = await _generate_datafile(str(path), local_client, format=format, force=True)
471
+ ds_file = await _generate_datafile(str(path), local_client, format=format, force=True, folder=project.folder)
472
+ result.append(ds_file)
473
+ name = ds_file.stem
474
+ no_pipes = len(project.get_pipe_files()) == 0
475
+ if no_pipes:
476
+ pipe_file = generate_pipe_file(
477
+ f"{name}_endpoint",
478
+ f"""
479
+ NODE endpoint
480
+ SQL >
481
+ SELECT * from {name}
482
+ TYPE ENDPOINT
483
+ """,
484
+ project.folder,
485
+ )
486
+ result.append(pipe_file)
487
+ return result
488
+
489
+
490
+ async def create_resources_from_url(url: str, project: Project, config: Dict[str, Any]) -> List[Path]:
491
+ result: List[Path] = []
492
+ local_client = await get_tinybird_local_client(config)
493
+ format = url.split(".")[-1]
494
+ ds_file = await _generate_datafile(url, local_client, format=format, force=True, folder=project.folder)
461
495
  result.append(ds_file)
462
496
  name = ds_file.stem
463
497
  no_pipes = len(project.get_pipe_files()) == 0
@@ -465,10 +499,10 @@ async def create_resources_from_data(
465
499
  pipe_file = generate_pipe_file(
466
500
  f"{name}_endpoint",
467
501
  f"""
468
- NODE endpoint
469
- SQL >
502
+ NODE endpoint
503
+ SQL >
470
504
  SELECT * from {name}
471
- TYPE ENDPOINT
505
+ TYPE ENDPOINT
472
506
  """,
473
507
  project.folder,
474
508
  )
@@ -74,9 +74,8 @@ async def auth(ctx: click.Context, token: str, host: str, region: str, connector
74
74
  # do a clean auth
75
75
  if not token and not ctx.parent.params.get("token") and not env_token:
76
76
  config.set_token(None)
77
- else:
78
- if env_token and not token:
79
- click.echo(FeedbackManager.info_reading_from_env(value="token", envvar="TB_TOKEN"))
77
+ elif env_token and not token:
78
+ click.echo(FeedbackManager.info_reading_from_env(value="token", envvar="TB_TOKEN"))
80
79
 
81
80
  regions: Optional[List[Region]] = None
82
81
  try_all_regions = True
@@ -597,9 +597,8 @@ async def regression_tests(
597
597
  await print_branch_regression_tests_summary(client, job_id, config["host"])
598
598
  except Exception as e:
599
599
  raise CLIBranchException(FeedbackManager.error_exception(error=str(e)))
600
- else:
601
- if not ctx.invoked_subcommand:
602
- await _run_regression(type="coverage", wait=wait, run_in_main=main)
600
+ elif not ctx.invoked_subcommand:
601
+ await _run_regression(type="coverage", wait=wait, run_in_main=main)
603
602
 
604
603
 
605
604
  async def _run_regression(
@@ -431,10 +431,9 @@ async def init(
431
431
  error = True
432
432
  else:
433
433
  click.echo(FeedbackManager.info_cicd_already_exists(provider=cicd_provider.name))
434
- else:
435
- if cicd:
436
- data_project_dir = os.path.relpath(folder, cli_git_release.working_dir())
437
- await init_cicd(client, path=cli_git_release.working_dir(), data_project_dir=data_project_dir)
434
+ elif cicd:
435
+ data_project_dir = os.path.relpath(folder, cli_git_release.working_dir())
436
+ await init_cicd(client, path=cli_git_release.working_dir(), data_project_dir=data_project_dir)
438
437
 
439
438
  if final_response:
440
439
  if error:
@@ -1463,12 +1462,11 @@ async def deploy(
1463
1462
  )
1464
1463
  else:
1465
1464
  click.echo(FeedbackManager.info_minor_patch_release_with_autopromote(version=new_version))
1466
- else:
1467
- if show_feedback:
1468
- if dry_run:
1469
- click.echo(FeedbackManager.info_dry_minor_patch_release_no_autopromote(version=new_version))
1470
- else:
1471
- click.echo(FeedbackManager.info_minor_patch_release_no_autopromote(version=new_version))
1465
+ elif show_feedback:
1466
+ if dry_run:
1467
+ click.echo(FeedbackManager.info_dry_minor_patch_release_no_autopromote(version=new_version))
1468
+ else:
1469
+ click.echo(FeedbackManager.info_minor_patch_release_no_autopromote(version=new_version))
1472
1470
  new_release = True
1473
1471
 
1474
1472
  if new_release:
@@ -234,20 +234,19 @@ async def create_workspace(
234
234
  if not organization:
235
235
  raise CLIWorkspaceException(FeedbackManager.error_organization_not_found(organization_id=organization_id))
236
236
  organization_name = organization.get("name")
237
+ elif len(organizations) == 0:
238
+ click.echo(FeedbackManager.warning_none_organization(ui_host=ui_host))
239
+ elif len(organizations) == 1:
240
+ organization_id = organizations[0].get("id")
241
+ organization_name = organizations[0].get("name")
237
242
  else:
238
- if len(organizations) == 0:
239
- click.echo(FeedbackManager.warning_none_organization(ui_host=ui_host))
240
- elif len(organizations) == 1:
241
- organization_id = organizations[0].get("id")
242
- organization_name = organizations[0].get("name")
243
+ sorted_organizations = sort_organizations_by_user(organizations, user_email=config.get_user_email())
244
+ current_organization = await ask_for_organization_interactively(sorted_organizations)
245
+ if current_organization:
246
+ organization_id = current_organization.get("id")
247
+ organization_name = current_organization.get("name")
243
248
  else:
244
- sorted_organizations = sort_organizations_by_user(organizations, user_email=config.get_user_email())
245
- current_organization = await ask_for_organization_interactively(sorted_organizations)
246
- if current_organization:
247
- organization_id = current_organization.get("id")
248
- organization_name = current_organization.get("name")
249
- else:
250
- return
249
+ return
251
250
 
252
251
  # If we have at least workspace_name, we start the non interactive
253
252
  # process, creating an empty workspace
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: tinybird
3
- Version: 0.0.1.dev183
3
+ Version: 0.0.1.dev185
4
4
  Summary: Tinybird Command Line Tool
5
5
  Home-page: https://www.tinybird.co/docs/forward/commands
6
6
  Author: Tinybird