tinybird-cli 3.2.0__py3-none-any.whl → 3.2.1.dev2__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://docs.tinybird.co/cli.html'
5
5
  __author__ = 'Tinybird'
6
6
  __author_email__ = 'support@tinybird.co'
7
- __version__ = '3.2.0'
8
- __revision__ = '3067b41'
7
+ __version__ = '3.2.1.dev2'
8
+ __revision__ = '3862bf2'
@@ -4,13 +4,13 @@
4
4
  # - But please, **do not** interleave utility functions and command definitions.
5
5
 
6
6
  import glob
7
- from typing import Iterable, List, Tuple
7
+ from typing import Any, Dict, Iterable, List, Tuple
8
8
 
9
9
  import click
10
10
 
11
11
  from tinybird.feedback_manager import FeedbackManager
12
12
  from tinybird.tb_cli_modules.cli import cli
13
- from tinybird.tb_cli_modules.common import coro, create_tb_client, gather_with_concurrency
13
+ from tinybird.tb_cli_modules.common import coro, create_tb_client, gather_with_concurrency, get_config_and_hosts
14
14
  from tinybird.tb_cli_modules.exceptions import CLIException
15
15
  from tinybird.tb_cli_modules.tinyunit.tinyunit import (
16
16
  TestSummaryResults,
@@ -27,7 +27,10 @@ def test(ctx: click.Context) -> None:
27
27
  """Test commands."""
28
28
 
29
29
 
30
- @test.command(name="run", help="Run the test suite, a file, or a test.")
30
+ @test.command(
31
+ name="run",
32
+ help="Run the test suite, a file, or a test. To skip test to run in branches and CI put them in a 'skip_in_branch' folder.",
33
+ )
31
34
  @click.argument("file", nargs=-1)
32
35
  @click.option("-v", "--verbose", is_flag=True, default=False, help="Enable verbose (show results)", type=bool)
33
36
  @click.option("--fail", "only_fail", is_flag=True, default=False, help="Showy onl failed/error tests", type=bool)
@@ -39,11 +42,24 @@ async def test_run(ctx: click.Context, file: Tuple[str, ...], verbose: bool, onl
39
42
 
40
43
  try:
41
44
  tb_client = create_tb_client(ctx)
45
+ config, _, _ = await get_config_and_hosts(ctx, check_token_exists=True)
46
+ workspaces: List[Dict[str, Any]] = (await tb_client.user_workspaces_and_branches()).get("workspaces", [])
47
+ current_ws: Dict[str, Any] = next(
48
+ (workspace for workspace in workspaces if config and workspace.get("id", ".") == config.get("id", "..")), {}
49
+ )
42
50
  except Exception as e:
43
51
  raise CLIException(FeedbackManager.error_exception(error=e))
44
52
 
45
53
  file_list: Iterable[str] = file if len(file) > 0 else glob.glob("./tests/**/*.y*ml", recursive=True)
54
+ click.echo(FeedbackManager.info_skipping_resource(resource="regression.yaml"))
46
55
  file_list = [f for f in file_list if not f.endswith("regression.yaml")]
56
+ final_file_list = []
57
+ for f in file_list:
58
+ if "skip_in_branch" in f and current_ws and current_ws.get("is_branch"):
59
+ click.echo(FeedbackManager.info_skipping_resource(resource=f))
60
+ else:
61
+ final_file_list.append(f)
62
+ file_list = final_file_list
47
63
 
48
64
  async def run_test(tb_client, test_file, results):
49
65
  try:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: tinybird-cli
3
- Version: 3.2.0
3
+ Version: 3.2.1.dev2
4
4
  Summary: Tinybird Command Line Tool
5
5
  Home-page: https://docs.tinybird.co/cli.html
6
6
  Author: Tinybird
@@ -52,6 +52,11 @@ Changelog
52
52
 
53
53
  ---------
54
54
 
55
+ 3.2.1.dev2
56
+ ************
57
+
58
+ - `Added` Data quality tests inside a `skip_in_branch` folder inside the `tests` folder are skipped when running on a branch. Use this to skip tests in the CI piipeline that should only run with production data.
59
+
55
60
  3.2.0
56
61
  ************
57
62
 
@@ -1,4 +1,4 @@
1
- tinybird/__cli__.py,sha256=Bd1KK3MVWtBUFGpsAdVstPJRRprApPGKSaPqmyXUXWk,232
1
+ tinybird/__cli__.py,sha256=vb9iaZZw4lhD-bv8dBgW1ELgghqQ3DjqINM7pwjHTYk,237
2
2
  tinybird/check_pypi.py,sha256=_4NkharLyR_ELrAdit-ftqIWvOf7jZNPt3i76frlo9g,975
3
3
  tinybird/client.py,sha256=VYAsCyRhBZIuzaeB0DBX5xPAiYWvuK4poFV15GgGRpk,46002
4
4
  tinybird/config.py,sha256=ckNiJhDbRm1IGNz_0V712fgiv2XBhDxujUH0EvwYVm4,1962
@@ -31,14 +31,14 @@ tinybird/tb_cli_modules/job.py,sha256=AG69LPb9MbobA1awwJFZJvxqarDKfRlsBjw2V1zvYq
31
31
  tinybird/tb_cli_modules/pipe.py,sha256=-YuPWywuF05x8Qo2DtxUlQkLYrvSoUrVnqTKOn4nEKk,25344
32
32
  tinybird/tb_cli_modules/regions.py,sha256=tRwy7uWbTqhhhO9JpIu0fkF1n-KRQAtGy8otPQO3KsU,2010
33
33
  tinybird/tb_cli_modules/telemetry.py,sha256=YgHU-osP034xN9LZC4iaakkdfKJCWqPYDGPZFrrZfPI,10490
34
- tinybird/tb_cli_modules/test.py,sha256=l8VDUamAr0SGcDrZioI2er6yZLWEHMvxz3oShDcUTzE,3361
34
+ tinybird/tb_cli_modules/test.py,sha256=NzFWa3EqPrpNvwBggUQYI9d0LqWcCKpSpkD22cvqhOQ,4223
35
35
  tinybird/tb_cli_modules/token.py,sha256=ZGUUX8x6Qk9214L4wSmFw5FsP5ht_iuIrKDBkpaT8Bc,4383
36
36
  tinybird/tb_cli_modules/workspace.py,sha256=NDHINzW3SBo8FcWH8Bx-DCeUXQ8YUJX6FW8cGmESnLc,10081
37
37
  tinybird/tb_cli_modules/workspace_members.py,sha256=6oZM7oJQPxDMycL95TPtALriL5WRI2DhNlQWD8MP8JU,8205
38
38
  tinybird/tb_cli_modules/tinyunit/tinyunit.py,sha256=0dYYmZMMJVubxSPls2e_a-fqtUYvgLfu2B0xwLfkbHw,11667
39
39
  tinybird/tb_cli_modules/tinyunit/tinyunit_lib.py,sha256=j92za8QbXrv4eIPjKBZPn9ghR-nYQ2wZZ88MeXyMWXE,1868
40
- tinybird_cli-3.2.0.dist-info/METADATA,sha256=iCa3A45E7VBKY7UoBbbxdUnebcdYo1yIMkGaFynEXnw,64893
41
- tinybird_cli-3.2.0.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
42
- tinybird_cli-3.2.0.dist-info/entry_points.txt,sha256=PKPKuPmA4IfJYnCFHHUiw-aAWZuBomFvwCklv1OyCjE,43
43
- tinybird_cli-3.2.0.dist-info/top_level.txt,sha256=8TRt5snq9vZpx4rBBc9EWpj76Er6IAdfnx_Eq6cNBk8,45
44
- tinybird_cli-3.2.0.dist-info/RECORD,,
40
+ tinybird_cli-3.2.1.dev2.dist-info/METADATA,sha256=veYpHJvtcz4CJTllKAPNN2qEBAsN9tcOd5xx0QY24b4,65136
41
+ tinybird_cli-3.2.1.dev2.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
42
+ tinybird_cli-3.2.1.dev2.dist-info/entry_points.txt,sha256=PKPKuPmA4IfJYnCFHHUiw-aAWZuBomFvwCklv1OyCjE,43
43
+ tinybird_cli-3.2.1.dev2.dist-info/top_level.txt,sha256=8TRt5snq9vZpx4rBBc9EWpj76Er6IAdfnx_Eq6cNBk8,45
44
+ tinybird_cli-3.2.1.dev2.dist-info/RECORD,,