tinybird-cli 5.11.1.dev1__tar.gz → 5.11.1.dev3__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.11.1.dev1 → tinybird-cli-5.11.1.dev3}/PKG-INFO +18 -1
  2. {tinybird-cli-5.11.1.dev1 → tinybird-cli-5.11.1.dev3}/tinybird/__cli__.py +2 -2
  3. {tinybird-cli-5.11.1.dev1 → tinybird-cli-5.11.1.dev3}/tinybird/datafile.py +24 -24
  4. {tinybird-cli-5.11.1.dev1 → tinybird-cli-5.11.1.dev3}/tinybird/sql.py +1 -1
  5. {tinybird-cli-5.11.1.dev1 → tinybird-cli-5.11.1.dev3}/tinybird/tb_cli_modules/common.py +17 -21
  6. {tinybird-cli-5.11.1.dev1 → tinybird-cli-5.11.1.dev3}/tinybird/tb_cli_modules/connection.py +3 -4
  7. {tinybird-cli-5.11.1.dev1 → tinybird-cli-5.11.1.dev3}/tinybird/tb_cli_modules/datasource.py +5 -4
  8. {tinybird-cli-5.11.1.dev1 → tinybird-cli-5.11.1.dev3}/tinybird/tb_cli_modules/telemetry.py +2 -5
  9. {tinybird-cli-5.11.1.dev1 → tinybird-cli-5.11.1.dev3}/tinybird/tb_cli_modules/workspace.py +2 -3
  10. {tinybird-cli-5.11.1.dev1 → tinybird-cli-5.11.1.dev3}/tinybird_cli.egg-info/PKG-INFO +18 -1
  11. {tinybird-cli-5.11.1.dev1 → tinybird-cli-5.11.1.dev3}/tinybird_cli.egg-info/requires.txt +7 -7
  12. {tinybird-cli-5.11.1.dev1 → tinybird-cli-5.11.1.dev3}/setup.cfg +0 -0
  13. {tinybird-cli-5.11.1.dev1 → tinybird-cli-5.11.1.dev3}/tinybird/ch_utils/constants.py +0 -0
  14. {tinybird-cli-5.11.1.dev1 → tinybird-cli-5.11.1.dev3}/tinybird/ch_utils/engine.py +0 -0
  15. {tinybird-cli-5.11.1.dev1 → tinybird-cli-5.11.1.dev3}/tinybird/check_pypi.py +0 -0
  16. {tinybird-cli-5.11.1.dev1 → tinybird-cli-5.11.1.dev3}/tinybird/client.py +0 -0
  17. {tinybird-cli-5.11.1.dev1 → tinybird-cli-5.11.1.dev3}/tinybird/config.py +0 -0
  18. {tinybird-cli-5.11.1.dev1 → tinybird-cli-5.11.1.dev3}/tinybird/connectors.py +0 -0
  19. {tinybird-cli-5.11.1.dev1 → tinybird-cli-5.11.1.dev3}/tinybird/context.py +0 -0
  20. {tinybird-cli-5.11.1.dev1 → tinybird-cli-5.11.1.dev3}/tinybird/datatypes.py +0 -0
  21. {tinybird-cli-5.11.1.dev1 → tinybird-cli-5.11.1.dev3}/tinybird/feedback_manager.py +0 -0
  22. {tinybird-cli-5.11.1.dev1 → tinybird-cli-5.11.1.dev3}/tinybird/git_settings.py +0 -0
  23. {tinybird-cli-5.11.1.dev1 → tinybird-cli-5.11.1.dev3}/tinybird/sql_template.py +0 -0
  24. {tinybird-cli-5.11.1.dev1 → tinybird-cli-5.11.1.dev3}/tinybird/sql_template_fmt.py +0 -0
  25. {tinybird-cli-5.11.1.dev1 → tinybird-cli-5.11.1.dev3}/tinybird/sql_toolset.py +0 -0
  26. {tinybird-cli-5.11.1.dev1 → tinybird-cli-5.11.1.dev3}/tinybird/syncasync.py +0 -0
  27. {tinybird-cli-5.11.1.dev1 → tinybird-cli-5.11.1.dev3}/tinybird/tb_cli.py +0 -0
  28. {tinybird-cli-5.11.1.dev1 → tinybird-cli-5.11.1.dev3}/tinybird/tb_cli_modules/auth.py +0 -0
  29. {tinybird-cli-5.11.1.dev1 → tinybird-cli-5.11.1.dev3}/tinybird/tb_cli_modules/branch.py +0 -0
  30. {tinybird-cli-5.11.1.dev1 → tinybird-cli-5.11.1.dev3}/tinybird/tb_cli_modules/cicd.py +0 -0
  31. {tinybird-cli-5.11.1.dev1 → tinybird-cli-5.11.1.dev3}/tinybird/tb_cli_modules/cli.py +0 -0
  32. {tinybird-cli-5.11.1.dev1 → tinybird-cli-5.11.1.dev3}/tinybird/tb_cli_modules/config.py +0 -0
  33. {tinybird-cli-5.11.1.dev1 → tinybird-cli-5.11.1.dev3}/tinybird/tb_cli_modules/exceptions.py +0 -0
  34. {tinybird-cli-5.11.1.dev1 → tinybird-cli-5.11.1.dev3}/tinybird/tb_cli_modules/fmt.py +0 -0
  35. {tinybird-cli-5.11.1.dev1 → tinybird-cli-5.11.1.dev3}/tinybird/tb_cli_modules/job.py +0 -0
  36. {tinybird-cli-5.11.1.dev1 → tinybird-cli-5.11.1.dev3}/tinybird/tb_cli_modules/pipe.py +0 -0
  37. {tinybird-cli-5.11.1.dev1 → tinybird-cli-5.11.1.dev3}/tinybird/tb_cli_modules/regions.py +0 -0
  38. {tinybird-cli-5.11.1.dev1 → tinybird-cli-5.11.1.dev3}/tinybird/tb_cli_modules/tag.py +0 -0
  39. {tinybird-cli-5.11.1.dev1 → tinybird-cli-5.11.1.dev3}/tinybird/tb_cli_modules/test.py +0 -0
  40. {tinybird-cli-5.11.1.dev1 → tinybird-cli-5.11.1.dev3}/tinybird/tb_cli_modules/tinyunit/tinyunit.py +0 -0
  41. {tinybird-cli-5.11.1.dev1 → tinybird-cli-5.11.1.dev3}/tinybird/tb_cli_modules/tinyunit/tinyunit_lib.py +0 -0
  42. {tinybird-cli-5.11.1.dev1 → tinybird-cli-5.11.1.dev3}/tinybird/tb_cli_modules/token.py +0 -0
  43. {tinybird-cli-5.11.1.dev1 → tinybird-cli-5.11.1.dev3}/tinybird/tb_cli_modules/workspace_members.py +0 -0
  44. {tinybird-cli-5.11.1.dev1 → tinybird-cli-5.11.1.dev3}/tinybird/tornado_template.py +0 -0
  45. {tinybird-cli-5.11.1.dev1 → tinybird-cli-5.11.1.dev3}/tinybird_cli.egg-info/SOURCES.txt +0 -0
  46. {tinybird-cli-5.11.1.dev1 → tinybird-cli-5.11.1.dev3}/tinybird_cli.egg-info/dependency_links.txt +0 -0
  47. {tinybird-cli-5.11.1.dev1 → tinybird-cli-5.11.1.dev3}/tinybird_cli.egg-info/entry_points.txt +0 -0
  48. {tinybird-cli-5.11.1.dev1 → tinybird-cli-5.11.1.dev3}/tinybird_cli.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: tinybird-cli
3
- Version: 5.11.1.dev1
3
+ Version: 5.11.1.dev3
4
4
  Summary: Tinybird Command Line Tool
5
5
  Home-page: https://www.tinybird.co/docs/cli/introduction.html
6
6
  Author: Tinybird
@@ -18,6 +18,23 @@ The Tinybird command-line tool allows you to use all the Tinybird functionality
18
18
  Changelog
19
19
  ----------
20
20
 
21
+ 5.11.1.dev3
22
+ ***********
23
+
24
+ - `Changed` multiple dependencies:
25
+ - cryptography: from ``>=3.4.8`` to ``>=41.0.0``
26
+ - GitPython: from ``==3.1.32`` to ``~=3.1.32``
27
+ - humanfriendly: from ``==8.2`` to ``~=8.2``
28
+ - pydantic: from ``==2.5.2`` to ``~=2.8.0``
29
+ - tornado: from ``==6.0.0`` to ``~=6.0.0``
30
+ - snowflake-connector-python: from ``==2.7.1`` to ``==3.12.3``
31
+
32
+ 5.11.1.dev2
33
+ ***********
34
+
35
+ - `Changed` Upgrade clickhouse-toolset to 0.33.dev0 to support new ClickHouse JSON type.
36
+
37
+
21
38
  5.11.1.dev1
22
39
  ***********
23
40
 
@@ -4,5 +4,5 @@ __description__ = 'Tinybird Command Line Tool'
4
4
  __url__ = 'https://www.tinybird.co/docs/cli/introduction.html'
5
5
  __author__ = 'Tinybird'
6
6
  __author_email__ = 'support@tinybird.co'
7
- __version__ = '5.11.1.dev1'
8
- __revision__ = '3642138'
7
+ __version__ = '5.11.1.dev3'
8
+ __revision__ = '452b364'
@@ -628,13 +628,17 @@ class Deployment:
628
628
  )
629
629
  found_ignored_by_format = None
630
630
  for change, type in changed.items():
631
- if type and self.cli_git_release.ChangeType(type) == self.cli_git_release.ChangeType.MODIFIED:
632
- if change in diff_command_output and diff_command_output.get(change) is None:
633
- if not found_ignored_by_format:
634
- click.echo(FeedbackManager.info_detected_changes_only_format())
635
- found_ignored_by_format = True
636
- click.echo(FeedbackManager.info_ignored_only_format(resource=change))
637
- changed[change] = None
631
+ if (
632
+ type
633
+ and self.cli_git_release.ChangeType(type) == self.cli_git_release.ChangeType.MODIFIED
634
+ and change in diff_command_output
635
+ and diff_command_output.get(change) is None
636
+ ):
637
+ if not found_ignored_by_format:
638
+ click.echo(FeedbackManager.info_detected_changes_only_format())
639
+ found_ignored_by_format = True
640
+ click.echo(FeedbackManager.info_ignored_only_format(resource=change))
641
+ changed[change] = None
638
642
 
639
643
  else:
640
644
  # only changes flow
@@ -789,11 +793,7 @@ class Datafile:
789
793
  if len(self.nodes) != len(other.nodes):
790
794
  return False
791
795
 
792
- for i, _ in enumerate(self.nodes):
793
- if self.nodes[i] != other.nodes[i]:
794
- return False
795
-
796
- return True
796
+ return all(self.nodes[i] == other.nodes[i] for i, _ in enumerate(self.nodes))
797
797
 
798
798
 
799
799
  def parse_datasource(
@@ -1075,7 +1075,8 @@ def parse(
1075
1075
  doc.tokens.append({"token_name": _unquote(args[0]), "permissions": args[1]})
1076
1076
 
1077
1077
  def test(*args: str, **kwargs: Any) -> None:
1078
- print("test", args, kwargs)
1078
+ # TODO: Should be removed?
1079
+ print("test", args, kwargs) # noqa: T201
1079
1080
 
1080
1081
  def include(*args: str, **kwargs: Any) -> None:
1081
1082
  f = _unquote(args[0])
@@ -4689,17 +4690,16 @@ async def folder_push(
4689
4690
  for group in toposort(dependencies_graph.dep_map):
4690
4691
  for f in group:
4691
4692
  name = os.path.basename(f)
4692
- if name not in processed:
4693
- if name in dependencies_graph.to_run:
4694
- await check_fixtures_data(
4695
- tb_client,
4696
- dependencies_graph.to_run[name],
4697
- debug,
4698
- folder,
4699
- force,
4700
- mode="append" if is_branch else "replace",
4701
- )
4702
- processed.add(name)
4693
+ if name not in processed and name in dependencies_graph.to_run:
4694
+ await check_fixtures_data(
4695
+ tb_client,
4696
+ dependencies_graph.to_run[name],
4697
+ debug,
4698
+ folder,
4699
+ force,
4700
+ mode="append" if is_branch else "replace",
4701
+ )
4702
+ processed.add(name)
4703
4703
  for f in dependencies_graph.to_run:
4704
4704
  if f not in processed:
4705
4705
  await check_fixtures_data(
@@ -860,7 +860,7 @@ def engine_patch_replicated_engine(engine: str, engine_full: Optional[str], new_
860
860
 
861
861
 
862
862
  if __name__ == "__main__":
863
- print(
863
+ print( # noqa: T201
864
864
  _parse_table_structure(
865
865
  """hola Int --comment\n, `materialized` String --otro comment\n MATERIALIZED upper(no_nullable_string)"""
866
866
  )
@@ -155,20 +155,18 @@ def generate_datafile(
155
155
  ds_file.write(datafile)
156
156
  click.echo(FeedbackManager.success_generated_file(file=f, stem=datasource_name, filename=filename))
157
157
 
158
- if data:
159
- # generate fixture
160
- if (base / "fixtures").exists():
161
- # Generating a fixture for Parquet files is not so trivial, since Parquet format
162
- # is column-based. We would need to add PyArrow as a dependency (which is huge)
163
- # just to analyze the whole Parquet file to extract one single row.
164
- if _format == "parquet":
165
- click.echo(FeedbackManager.warning_parquet_fixtures_not_supported())
166
- else:
167
- f = base / "fixtures" / (p.stem + f".{_format}")
168
- newline = b"\n" # TODO: guess
169
- with open(f, "wb") as fixture_file:
170
- fixture_file.write(data[: data.rfind(newline)])
171
- click.echo(FeedbackManager.success_generated_fixture(fixture=f))
158
+ if data and (base / "fixtures").exists():
159
+ # Generating a fixture for Parquet files is not so trivial, since Parquet format
160
+ # is column-based. We would need to add PyArrow as a dependency (which is huge)
161
+ # just to analyze the whole Parquet file to extract one single row.
162
+ if _format == "parquet":
163
+ click.echo(FeedbackManager.warning_parquet_fixtures_not_supported())
164
+ else:
165
+ f = base / "fixtures" / (p.stem + f".{_format}")
166
+ newline = b"\n" # TODO: guess
167
+ with open(f, "wb") as fixture_file:
168
+ fixture_file.write(data[: data.rfind(newline)])
169
+ click.echo(FeedbackManager.success_generated_fixture(fixture=f))
172
170
  else:
173
171
  click.echo(FeedbackManager.error_file_already_exists(file=f))
174
172
 
@@ -1161,9 +1159,8 @@ async def push_data(
1161
1159
  raise CLIException(FeedbackManager.error_exception(error=e))
1162
1160
  else:
1163
1161
  click.echo(FeedbackManager.success_progress_blocks())
1164
- if mode == "append":
1165
- if parser and parser != "clickhouse":
1166
- click.echo(FeedbackManager.success_appended_rows(appended_rows=appended_rows))
1162
+ if mode == "append" and parser and parser != "clickhouse":
1163
+ click.echo(FeedbackManager.success_appended_rows(appended_rows=appended_rows))
1167
1164
 
1168
1165
  click.echo(FeedbackManager.success_total_rows(datasource=datasource_name, total_rows=total_rows))
1169
1166
 
@@ -2000,10 +1997,9 @@ async def validate_aws_iamrole_connection_name(
2000
1997
  connection_name = click.prompt("Enter the name for this connection", default=None, show_default=False)
2001
1998
  assert isinstance(connection_name, str)
2002
1999
 
2003
- if no_validate is False:
2004
- if await client.get_connector(connection_name) is not None:
2005
- click.echo(FeedbackManager.info_connection_already_exists(name=connection_name))
2006
- connection_name = None
2000
+ if no_validate is False and await client.get_connector(connection_name) is not None:
2001
+ click.echo(FeedbackManager.info_connection_already_exists(name=connection_name))
2002
+ connection_name = None
2007
2003
  assert isinstance(connection_name, str)
2008
2004
  return connection_name
2009
2005
 
@@ -297,10 +297,9 @@ async def connection_create_snowflake(
297
297
  )
298
298
  assert isinstance(connection_name, str)
299
299
 
300
- if no_validate is False:
301
- if await client.get_connector(connection_name, "snowflake") is not None:
302
- click.echo(FeedbackManager.info_connection_already_exists(name=connection_name))
303
- connection_name = None
300
+ if no_validate is False and await client.get_connector(connection_name, "snowflake") is not None:
301
+ click.echo(FeedbackManager.info_connection_already_exists(name=connection_name))
302
+ connection_name = None
304
303
  assert isinstance(connection_name, str)
305
304
 
306
305
  show_instructions: bool = not is_ci_environment()
@@ -472,10 +472,11 @@ async def datasource_delete_rows(ctx, datasource_name, sql_condition, yes, wait,
472
472
  if wait:
473
473
  progress_symbols = ["-", "\\", "|", "/"]
474
474
  progress_str = "Waiting for the job to finish"
475
- print(f"\n{progress_str}", end="")
475
+ # TODO: Use click.echo instead of print and see if the behavior is the same
476
+ print(f"\n{progress_str}", end="") # noqa: T201
476
477
 
477
478
  def progress_line(n):
478
- print(f"\r{progress_str} {progress_symbols[n % len(progress_symbols)]}", end="")
479
+ print(f"\r{progress_str} {progress_symbols[n % len(progress_symbols)]}", end="") # noqa: T201
479
480
 
480
481
  i = 0
481
482
  while True:
@@ -484,7 +485,7 @@ async def datasource_delete_rows(ctx, datasource_name, sql_condition, yes, wait,
484
485
  except Exception:
485
486
  raise CLIDatasourceException(FeedbackManager.error_job_status(url=job_url))
486
487
  if res["status"] == "done":
487
- print("\n")
488
+ print("\n") # noqa: T201
488
489
  click.echo(
489
490
  FeedbackManager.success_delete_rows_datasource(
490
491
  datasource=datasource_name, delete_condition=sql_condition
@@ -492,7 +493,7 @@ async def datasource_delete_rows(ctx, datasource_name, sql_condition, yes, wait,
492
493
  )
493
494
  break
494
495
  elif res["status"] == "error":
495
- print("\n")
496
+ print("\n") # noqa: T201
496
497
  raise CLIDatasourceException(FeedbackManager.error_exception(error=res["error"]))
497
498
  await asyncio.sleep(1)
498
499
  i += 1
@@ -69,10 +69,7 @@ def _is_env_present(envs: List[str]) -> bool:
69
69
  """Checks if all of the variables passed in `envs`
70
70
  are defined (ie: not empty)
71
71
  """
72
- for env_var in envs:
73
- if os.getenv(env_var, None) is None:
74
- return False
75
- return True
72
+ return all(os.getenv(env_var, None) is not None for env_var in envs)
76
73
 
77
74
 
78
75
  def _hide_tokens(text: str) -> str:
@@ -228,7 +225,7 @@ class TelemetryHelper:
228
225
  """Internal logging function to help with development and debugging."""
229
226
  if not _is_env_true("TB_CLI_TELEMETRY_DEBUG"):
230
227
  return
231
- print(f"> Telemetry: {msg}")
228
+ print(f"> Telemetry: {msg}") # noqa: T201
232
229
 
233
230
 
234
231
  _helper_instance: Optional[TelemetryHelper] = None
@@ -198,9 +198,8 @@ async def clear_workspace(ctx: Context, yes: bool, dry_run: bool) -> None:
198
198
  async def create_workspace(
199
199
  ctx: Context, workspace_name: str, starter_kit: str, user_token: Optional[str], fork: bool
200
200
  ) -> None:
201
- if starter_kit:
202
- if not await is_valid_starterkit(ctx, starter_kit):
203
- raise CLIWorkspaceException(FeedbackManager.error_starterkit_name(starterkit_name=starter_kit))
201
+ if starter_kit and not await is_valid_starterkit(ctx, starter_kit):
202
+ raise CLIWorkspaceException(FeedbackManager.error_starterkit_name(starterkit_name=starter_kit))
204
203
 
205
204
  if not user_token:
206
205
  config = CLIConfig.get_project_config()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: tinybird-cli
3
- Version: 5.11.1.dev1
3
+ Version: 5.11.1.dev3
4
4
  Summary: Tinybird Command Line Tool
5
5
  Home-page: https://www.tinybird.co/docs/cli/introduction.html
6
6
  Author: Tinybird
@@ -18,6 +18,23 @@ The Tinybird command-line tool allows you to use all the Tinybird functionality
18
18
  Changelog
19
19
  ----------
20
20
 
21
+ 5.11.1.dev3
22
+ ***********
23
+
24
+ - `Changed` multiple dependencies:
25
+ - cryptography: from ``>=3.4.8`` to ``>=41.0.0``
26
+ - GitPython: from ``==3.1.32`` to ``~=3.1.32``
27
+ - humanfriendly: from ``==8.2`` to ``~=8.2``
28
+ - pydantic: from ``==2.5.2`` to ``~=2.8.0``
29
+ - tornado: from ``==6.0.0`` to ``~=6.0.0``
30
+ - snowflake-connector-python: from ``==2.7.1`` to ``==3.12.3``
31
+
32
+ 5.11.1.dev2
33
+ ***********
34
+
35
+ - `Changed` Upgrade clickhouse-toolset to 0.33.dev0 to support new ClickHouse JSON type.
36
+
37
+
21
38
  5.11.1.dev1
22
39
  ***********
23
40
 
@@ -1,19 +1,19 @@
1
1
  aiofiles==24.1.0
2
2
  click<8.2,>=8.1.6
3
- clickhouse-toolset==0.32.dev0
3
+ clickhouse-toolset==0.33.dev0
4
4
  colorama==0.4.6
5
- cryptography>=3.4.8
5
+ cryptography>=41.0.0
6
6
  croniter==1.3.8
7
- GitPython==3.1.32
8
- humanfriendly==8.2
9
- pydantic==2.5.2
7
+ GitPython~=3.1.32
8
+ humanfriendly~=8.2
9
+ pydantic~=2.8.0
10
10
  pyperclip==1.8.2
11
11
  pyyaml<6.1,>=6.0
12
12
  requests<3,>=2.28.1
13
13
  shandy-sqlfmt==0.11.1
14
14
  shandy-sqlfmt[jinjafmt]==0.11.1
15
15
  toposort==1.10
16
- tornado==6.0.0
16
+ tornado~=6.0.0
17
17
  urllib3<2,>=1.26.14
18
18
  wheel
19
19
  packaging<24,>=23.1
@@ -27,7 +27,7 @@ google-cloud-storage==2.4.0
27
27
  google-cloud-bigquery==2.11.0
28
28
 
29
29
  [snowflake]
30
- snowflake-connector-python==2.7.1
30
+ snowflake-connector-python==3.12.3
31
31
  gsutil==4.58
32
32
  google-api-python-client==2.0.2
33
33
  google-auth==1.27.1