tinybird-cli 5.22.1.dev2__py3-none-any.whl → 5.22.2.dev0__py3-none-any.whl

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.
tinybird/__cli__.py CHANGED
@@ -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.dev2'
8
- __revision__ = '60ae688'
7
+ __version__ = '5.22.2.dev0'
8
+ __revision__ = 'e1b50a6'
@@ -358,7 +358,11 @@ class EngineParam:
358
358
  self.required = required
359
359
  self.default_value = default_value
360
360
  self.is_valid = is_valid
361
- self.tb_param = tb_param if tb_param else "_".join(["engine", name])
361
+ self.tb_param = tb_param if tb_param else self.build_engine_param_name(name)
362
+
363
+ @staticmethod
364
+ def build_engine_param_name(name: str):
365
+ return "_".join(["engine", name])
362
366
 
363
367
 
364
368
  def engine_config(name: str, params: Optional[List[EngineParam]] = None, options: Optional[List[EngineOption]] = None):
@@ -495,6 +499,19 @@ ENABLED_ENGINES = [
495
499
  ]
496
500
 
497
501
 
502
+ def __get_valid_engine_params():
503
+ engine_vars = set()
504
+ for _, (params, options) in ENABLED_ENGINES:
505
+ for p in params:
506
+ engine_vars.add(p.name)
507
+ for o in options:
508
+ engine_vars.add(o.name)
509
+ return engine_vars
510
+
511
+
512
+ VALID_ENGINE_PARAMS = __get_valid_engine_params()
513
+
514
+
498
515
  def get_engine_config(engine: str):
499
516
  for name, config in ENABLED_ENGINES:
500
517
  if engine.lower() == name.lower():
@@ -2,7 +2,7 @@
2
2
  Datafile is like a Dockerfile but to describe ETL processes
3
3
  """
4
4
 
5
- from asyncio import Semaphore, gather
5
+ from asyncio import Semaphore, ensure_future, gather
6
6
  from datetime import datetime
7
7
 
8
8
  import aiofiles
@@ -340,7 +340,7 @@ class CLIGitRelease:
340
340
 
341
341
  def as_feedback_message(self, diff: Diff) -> str:
342
342
  change_type = self.name.lower().replace("_", " ")
343
- changed = f"{diff.a_path} -> {diff.b_path}" if self.value == self.RENAMED.value else f"{diff.a_path}" # type: ignore
343
+ changed = f"{diff.a_path} -> {diff.b_path}" if self.value == self.RENAMED.value else f"{diff.a_path}"
344
344
  return FeedbackManager.info_git_release_diff(change_type=change_type, datafile_changed=changed)
345
345
 
346
346
  def __init__(self, path=None):
@@ -5224,7 +5224,15 @@ async def _gather_with_concurrency(n, *tasks):
5224
5224
  async with semaphore:
5225
5225
  return await task
5226
5226
 
5227
- return await gather(*(sem_task(task) for task in tasks))
5227
+ wrapped = [ensure_future(sem_task(t)) for t in tasks]
5228
+ try:
5229
+ return await gather(*wrapped)
5230
+ except:
5231
+ for t in wrapped:
5232
+ if not t.done():
5233
+ t.cancel()
5234
+ await gather(*wrapped, return_exceptions=True)
5235
+ raise
5228
5236
 
5229
5237
 
5230
5238
  async def folder_pull(
@@ -196,7 +196,7 @@ async def cli(
196
196
  semver = os.environ.get("TB_SEMVER", "")
197
197
 
198
198
  config = await get_config(host, token, semver)
199
- client = _get_tb_client(config.get("token", None), config["host"])
199
+ client = _get_tb_client(config.get("token", None), config["host"]) # type: ignore[arg-type]
200
200
 
201
201
  # If they have passed a token or host as paramter and it's different that record in .tinyb, refresh the workspace id
202
202
  if token or host:
@@ -253,7 +253,7 @@ async def cli(
253
253
 
254
254
  logging.debug("debug enabled")
255
255
 
256
- ctx.ensure_object(dict)["client"] = _get_tb_client(config.get("token", None), config["host"], semver)
256
+ ctx.ensure_object(dict)["client"] = _get_tb_client(config.get("token", None), config["host"], semver) # type: ignore[arg-type]
257
257
 
258
258
  for connector in SUPPORTED_CONNECTORS:
259
259
  load_connector_config(ctx, connector, debug, check_uninstalled=True)
@@ -93,7 +93,7 @@ async def datasource_ls(ctx: Context, match: Optional[str], format_: str):
93
93
  shared_from,
94
94
  name,
95
95
  humanfriendly.format_number(stats.get("row_count")) if stats.get("row_count", None) else "-",
96
- humanfriendly.format_size(int(stats.get("bytes"))) if stats.get("bytes", None) else "-",
96
+ humanfriendly.format_size(int(stats.get("bytes"))) if stats.get("bytes", None) else "-", # type: ignore
97
97
  t["created_at"][:-7],
98
98
  t["updated_at"][:-7],
99
99
  t.get("service", ""),
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: tinybird_cli
3
- Version: 5.22.1.dev2
3
+ Version: 5.22.2.dev0
4
4
  Summary: Tinybird Command Line Tool
5
5
  Home-page: https://www.tinybird.co/docs/cli
6
6
  Author: Tinybird
@@ -61,6 +61,11 @@ The Tinybird command-line tool allows you to use all the Tinybird functionality
61
61
  Changelog
62
62
  ----------
63
63
 
64
+ 5.22.1
65
+ ***********
66
+
67
+ - `Fixed` RuntimeWarning for unawaited coroutines when `tb pull` encounters server errors
68
+
64
69
  5.22.0
65
70
  ***********
66
71
 
@@ -1,10 +1,10 @@
1
- tinybird/__cli__.py,sha256=sr25A-lTtjo9uf6e3bNGcr5kOdGsW6I00xcbcWHIBYA,237
1
+ tinybird/__cli__.py,sha256=8yPjAB0ZtN4MdRaekwtJPnGD2XdTS7ONkMYPXlnopoE,237
2
2
  tinybird/check_pypi.py,sha256=_4NkharLyR_ELrAdit-ftqIWvOf7jZNPt3i76frlo9g,975
3
3
  tinybird/client.py,sha256=VYKuR10NwYmvyvC5QsJPE0H4k9dLDb_TxwxYbEyP1Xs,55592
4
4
  tinybird/config.py,sha256=4URIMvEO-ysbXrd-hGbXDAeymZfdiPEGauJPaUeccXI,7493
5
5
  tinybird/connectors.py,sha256=TSux0opkG3gbzTTyRIUfNk4RJoLvTIyp42rdsmmIAYg,15083
6
6
  tinybird/context.py,sha256=QNS9yB3i3bQUZMc_Z4oBN_oMDZaBM-Q6g12jNLjNH98,1261
7
- tinybird/datafile_common.py,sha256=7aeCZ1TgdEGYXjwVJgU-FP_B5F6-gSbyfbbX56n_s-M,232837
7
+ tinybird/datafile_common.py,sha256=nnQkc-Njesx_EfMnUdI3bxkfLL7O-8Vp_MJKRY66f4A,233043
8
8
  tinybird/datatypes.py,sha256=r4WCvspmrXTJHiPjjyOTiZyZl31FO3Ynkwq4LQsYm6E,11059
9
9
  tinybird/feedback_manager.py,sha256=T370HP53XP4EJ-FCxmsuW6v-eG_xyonGr69a_BRVSVw,69978
10
10
  tinybird/git_settings.py,sha256=Sw_8rGmribEFJ4Z_6idrVytxpFYk7ez8ei0qHULzs3E,3934
@@ -16,15 +16,15 @@ tinybird/syncasync.py,sha256=IPnOx6lMbf9SNddN1eBtssg8vCLHMt76SuZ6YNYm-Yk,27761
16
16
  tinybird/tb_cli.py,sha256=q1LGAsBVVMJsjR2HK62Pu6vpVtLzNmH8wHrEVUUdVkU,744
17
17
  tinybird/tornado_template.py,sha256=p3V4ERIWPRdtQuqkaL1NVjivaFoVXZgPJUxwVPce4nc,41850
18
18
  tinybird/ch_utils/constants.py,sha256=yTNizMzgYNBzUc2EV3moBfdrDIggOe9hiuAgWF7sv2c,4333
19
- tinybird/ch_utils/engine.py,sha256=4X1B-iuhdW_mxKnX_m3iCsxgP9RPVgR75g7yH1vsJ6A,40851
19
+ tinybird/ch_utils/engine.py,sha256=UEis9pIYg9a7dpGHVYZ2D3pS4yP1MCFfmvzW7Fkrl1U,41270
20
20
  tinybird/tb_cli_modules/auth.py,sha256=urjPOQtukbQ2ooRUJmUMXS98mLfpOl64Q9NwG0DQjnw,9022
21
21
  tinybird/tb_cli_modules/branch.py,sha256=92jKpb28yZMav4w5s6HboGty8ivtgSIFh1zxvLK3mBo,39348
22
22
  tinybird/tb_cli_modules/cicd.py,sha256=0lMkb6CVOFZl5HOwgY8mK4T4mgI7O8335UngLXtCc-c,13851
23
- tinybird/tb_cli_modules/cli.py,sha256=bAUvfhW78VYUYzM5O-G_gtNTNs80rDobPGAqS2fCNvI,63342
23
+ tinybird/tb_cli_modules/cli.py,sha256=E8648ygwOMFaj1d02qYCWtnpQfei1sYBdE2r4DWg4EM,63394
24
24
  tinybird/tb_cli_modules/common.py,sha256=VQQjGmbbKR09TWn1lxd_ip4uykqaBcY6UoXB2MlWvgQ,82985
25
25
  tinybird/tb_cli_modules/config.py,sha256=IsgdtFRnUrkY8-Zo32lmk6O7u3bHie1QCxLwgp4ewgA,11546
26
26
  tinybird/tb_cli_modules/connection.py,sha256=u_H08nnAUvO0GevAT4WoHrTdtIt8BMPvRJMa-vIJaDg,29399
27
- tinybird/tb_cli_modules/datasource.py,sha256=lNnmHTE2pnphOPLmqFxrc80MeeZGYMvH1fdyW7TFY7s,35752
27
+ tinybird/tb_cli_modules/datasource.py,sha256=WM4I1XFkMOBDFglo1GSVIOVELvjjDfs3SC_9zEQUERM,35768
28
28
  tinybird/tb_cli_modules/exceptions.py,sha256=pmucP4kTF4irIt7dXiG-FcnI-o3mvDusPmch1L8RCWk,3367
29
29
  tinybird/tb_cli_modules/fmt.py,sha256=edQap4tAqWMWogSIx5zriT75naLi73XTB3NwatmcrFw,3518
30
30
  tinybird/tb_cli_modules/job.py,sha256=AG69LPb9MbobA1awwJFZJvxqarDKfRlsBjw2V1zvYqc,2964
@@ -38,8 +38,8 @@ tinybird/tb_cli_modules/workspace.py,sha256=yg3yb7_GniGJnOy2HqwEzePl47gQD-hywuQJ
38
38
  tinybird/tb_cli_modules/workspace_members.py,sha256=ksXsjd233y9-sNlz4Qb-meZbX4zn1B84e_bSm2i8rhg,8731
39
39
  tinybird/tb_cli_modules/tinyunit/tinyunit.py,sha256=4QlVoHE-O3akOBuIIJm3Mx2ewiZmPTT9vdgqIi9byTw,11267
40
40
  tinybird/tb_cli_modules/tinyunit/tinyunit_lib.py,sha256=NHoXcCHPDcKWYLzgP3NViho3Ey-6RV-ynPDzySPrTPE,1817
41
- tinybird_cli-5.22.1.dev2.dist-info/METADATA,sha256=GHOFve2xksBg2bIlIzg1csuKLV234JUHr8ZJMsQNgHw,81253
42
- tinybird_cli-5.22.1.dev2.dist-info/WHEEL,sha256=beeZ86-EfXScwlR_HKu4SllMC9wUEj_8Z_4FJ3egI2w,91
43
- tinybird_cli-5.22.1.dev2.dist-info/entry_points.txt,sha256=PKPKuPmA4IfJYnCFHHUiw-aAWZuBomFvwCklv1OyCjE,43
44
- tinybird_cli-5.22.1.dev2.dist-info/top_level.txt,sha256=VqqqEmkAy7UNaD8-V51FCoMMWXjLUlR0IstvK7tJYVY,54
45
- tinybird_cli-5.22.1.dev2.dist-info/RECORD,,
41
+ tinybird_cli-5.22.2.dev0.dist-info/METADATA,sha256=u5V8MrgPB8PIw6x1tpgmCZgutb0eG-VA-c5xklY2Hp4,81364
42
+ tinybird_cli-5.22.2.dev0.dist-info/WHEEL,sha256=beeZ86-EfXScwlR_HKu4SllMC9wUEj_8Z_4FJ3egI2w,91
43
+ tinybird_cli-5.22.2.dev0.dist-info/entry_points.txt,sha256=PKPKuPmA4IfJYnCFHHUiw-aAWZuBomFvwCklv1OyCjE,43
44
+ tinybird_cli-5.22.2.dev0.dist-info/top_level.txt,sha256=VqqqEmkAy7UNaD8-V51FCoMMWXjLUlR0IstvK7tJYVY,54
45
+ tinybird_cli-5.22.2.dev0.dist-info/RECORD,,