tinybird-cli 2.1.0.dev15__py3-none-any.whl → 2.1.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__ = '2.1.0.dev15'
8
- __revision__ = 'd517c9c'
7
+ __version__ = '2.1.1.dev2'
8
+ __revision__ = '0a4a8e6'
@@ -1,9 +1,5 @@
1
- from __future__ import annotations
2
-
3
1
  from enum import Enum
4
- from typing import List, Optional
5
-
6
- from pydantic import BaseModel
2
+ from typing import List
7
3
 
8
4
 
9
5
  class DataConnectorType(str, Enum):
@@ -19,69 +15,34 @@ class DataConnectorType(str, Enum):
19
15
  return self.value
20
16
 
21
17
 
22
- class DataConnectorSetting(BaseModel):
23
- ...
24
-
25
-
26
- class KafkaConnectorSetting(DataConnectorSetting):
27
- kafka_bootstrap_servers: str
28
- kafka_sasl_plain_username: str
29
- kafka_sasl_plain_password: str
30
- cli_version: Optional[str] = None
31
- tb_endpoint: Optional[str] = None
32
- kafka_security_protocol: Optional[str] = None
33
- kafka_sasl_mechanism: Optional[str] = None
34
- kafka_schema_registry_url: Optional[str] = None
35
-
36
-
37
- class S3ConnectorSetting(DataConnectorSetting):
38
- s3_access_key_id: str
39
- s3_secret_access_key: str
40
- s3_region: str
41
-
42
-
43
- class SnowflakeConnectorSetting(DataConnectorSetting):
44
- account: str
45
- username: str
46
- password: str
47
- role: str
48
- warehouse: str
49
- warehouse_size: Optional[str] = None
50
- stage: Optional[str] = None
51
- integration: Optional[str] = None
52
-
53
-
54
- class GCSchedulerConnectorSetting(DataConnectorSetting):
55
- gcscheduler_region: Optional[str] = None
56
-
57
-
58
- class BigQueryConnectorSetting(DataConnectorSetting):
59
- account: Optional[str] = None
60
-
61
-
62
- class GCSHmacConnectorSetting(DataConnectorSetting):
63
- gcs_hmac_access_id: str
64
- gcs_hmac_secret: str
65
-
66
-
67
- class GCSConnectorSetting(DataConnectorSetting):
68
- gcs_private_key_id: str
69
- gcs_client_x509_cert_url: str
70
- gcs_project_id: str
71
- gcs_client_id: str
72
- gcs_client_email: str
73
- gcs_private_key: str
74
-
75
-
76
- DATA_CONNECTOR_SETTINGS: dict[DataConnectorType, type[DataConnectorSetting]] = {
77
- DataConnectorType.KAFKA: KafkaConnectorSetting,
78
- DataConnectorType.GCLOUD_SCHEDULER: GCSchedulerConnectorSetting,
79
- DataConnectorType.SNOWFLAKE: SnowflakeConnectorSetting,
80
- DataConnectorType.BIGQUERY: BigQueryConnectorSetting,
81
- DataConnectorType.GCLOUD_STORAGE: GCSConnectorSetting,
82
- DataConnectorType.GCLOUD_STORAGE_HMAC: GCSHmacConnectorSetting,
83
- DataConnectorType.AMAZON_S3: S3ConnectorSetting,
84
- }
18
+ class DataConnectorSettings:
19
+ kafka = [
20
+ "cli_version",
21
+ "tb_endpoint",
22
+ "kafka_bootstrap_servers",
23
+ "kafka_sasl_plain_username",
24
+ "kafka_sasl_plain_password",
25
+ "kafka_security_protocol",
26
+ "kafka_sasl_mechanism",
27
+ "kafka_schema_registry_url",
28
+ ]
29
+ gcscheduler = ["gcscheduler_region"]
30
+ bigquery = ["account"]
31
+ snowflake = ["account", "username", "password", "warehouse", "warehouse_size", "role", "stage", "integration"]
32
+ gcs_hmac = ["gcs_hmac_access_id", "gcs_hmac_secret"]
33
+ s3 = [
34
+ "s3_access_key_id",
35
+ "s3_secret_access_key",
36
+ "s3_region",
37
+ ]
38
+ gcs = [
39
+ "gcs_private_key_id",
40
+ "gcs_client_x509_cert_url",
41
+ "gcs_project_id",
42
+ "gcs_client_id",
43
+ "gcs_client_email",
44
+ "gcs_private_key",
45
+ ]
85
46
 
86
47
 
87
48
  class DataLinkerSettings:
@@ -97,14 +58,7 @@ class DataLinkerSettings:
97
58
 
98
59
 
99
60
  class DataSinkSettings:
100
- gcscheduler = [
101
- "cron",
102
- "timezone",
103
- "status",
104
- "gcscheduler_target_url",
105
- "gcscheduler_job_name",
106
- "gcscheduler_region",
107
- ]
61
+ gcscheduler = ["cron", "timezone", "status", "gcscheduler_target_url", "gcscheduler_job_name", "gcscheduler_region"]
108
62
  gcs_hmac = [
109
63
  "bucket_path",
110
64
  "file_template",
tinybird/datafile.py CHANGED
@@ -1781,11 +1781,18 @@ class PipeChecker(unittest.TestCase):
1781
1781
  for x in current_data_e.keys():
1782
1782
  if isinstance(current_data_e[x], float):
1783
1783
  d = abs(current_data_e[x] - check_fixtures_data_e[x])
1784
- self.assertLessEqual(
1785
- d / current_data_e[x],
1786
- 0.01,
1787
- f"key {x}. old value: {current_data_e[x]}, new value {check_fixtures_data_e[x]}\n{self.diff(current_data_e, check_fixtures_data_e)}",
1788
- )
1784
+ try:
1785
+ self.assertLessEqual(
1786
+ d / current_data_e[x],
1787
+ 0.01,
1788
+ f"key {x}. old value: {current_data_e[x]}, new value: {check_fixtures_data_e[x]}\n{self.diff(current_data_e, check_fixtures_data_e)}",
1789
+ )
1790
+ except ZeroDivisionError:
1791
+ self.assertEqual(
1792
+ d,
1793
+ 0,
1794
+ f"key {x}. old value: {current_data_e[x]}, new value: {check_fixtures_data_e[x]}\n{self.diff(current_data_e, check_fixtures_data_e)}",
1795
+ )
1789
1796
  elif (
1790
1797
  not isinstance(current_data_e[x], (str, bytes))
1791
1798
  and isinstance(current_data_e[x], Iterable)
@@ -2027,6 +2034,13 @@ class PipeCheckerRunner:
2027
2034
 
2028
2035
  current_read_bytes.append(test.current_read_bytes)
2029
2036
  checker_read_bytes.append(test.checker_read_bytes)
2037
+ else:
2038
+ # if we do not have any successful execution, let's just return a table with dummy metrics https://gitlab.com/tinybird/analytics/-/issues/10875
2039
+ current_response_times = [0]
2040
+ checker_response_times = [0]
2041
+
2042
+ current_read_bytes = [0]
2043
+ checker_read_bytes = [0]
2030
2044
 
2031
2045
  metrics_summary = {
2032
2046
  "run": result.testsRun,
@@ -12,7 +12,6 @@ import click
12
12
  from click import Context
13
13
 
14
14
  from tinybird.client import DoesNotExistException, TinyB
15
- from tinybird.connector_settings import DATA_CONNECTOR_SETTINGS, DataConnectorType, DataSensitiveSettings
16
15
  from tinybird.feedback_manager import FeedbackManager
17
16
  from tinybird.tb_cli_modules.cli import cli
18
17
  from tinybird.tb_cli_modules.common import (
@@ -340,8 +339,11 @@ async def connection_rm(ctx: Context, connection_id: str, force: bool) -> None:
340
339
  @click.option("--connector", help="Filter by connector")
341
340
  @click.pass_context
342
341
  @coro
343
- async def connection_ls(ctx: Context, connector: Optional[DataConnectorType] = None) -> None:
342
+ async def connection_ls(ctx: Context, connector: str) -> None:
344
343
  """List connections."""
344
+
345
+ from tinybird.connector_settings import DataConnectorSettings, DataSensitiveSettings
346
+
345
347
  obj: Dict[str, Any] = ctx.ensure_object(dict)
346
348
  client: TinyB = obj["client"]
347
349
 
@@ -356,9 +358,9 @@ async def connection_ls(ctx: Context, connector: Optional[DataConnectorType] = N
356
358
  columns = ["service", "name", "id", "connected_datasources"]
357
359
  else:
358
360
  sensitive_settings = getattr(DataSensitiveSettings, connector)
359
- columns = ["service", "name", "id", "connected_datasources"]
360
- if connector_settings := DATA_CONNECTOR_SETTINGS.get(connector):
361
- columns += [setting.replace("tb_", "") for setting in connector_settings.model_fields.keys()]
361
+ columns = ["service", "name", "id", "connected_datasources"] + [
362
+ setting.replace("tb_", "") for setting in getattr(DataConnectorSettings, connector)
363
+ ]
362
364
 
363
365
  for connection in connections:
364
366
  row = [_get_setting_value(connection, setting, sensitive_settings) for setting in columns]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: tinybird-cli
3
- Version: 2.1.0.dev15
3
+ Version: 2.1.1.dev2
4
4
  Summary: Tinybird Command Line Tool
5
5
  Home-page: https://docs.tinybird.co/cli.html
6
6
  Author: Tinybird
@@ -14,7 +14,6 @@ Requires-Dist: cryptography (>=3.4.8)
14
14
  Requires-Dist: croniter (==1.3.8)
15
15
  Requires-Dist: GitPython (==3.1.29)
16
16
  Requires-Dist: humanfriendly (==8.2)
17
- Requires-Dist: pydantic (==2.5.2)
18
17
  Requires-Dist: pyperclip (==1.8.2)
19
18
  Requires-Dist: pyyaml (<6.1,>=6.0)
20
19
  Requires-Dist: requests (<3,>=2.28.1)
@@ -52,6 +51,31 @@ Changelog
52
51
 
53
52
  ---------
54
53
 
54
+ 2.1.1.dev2
55
+ ************
56
+
57
+ - `Fixed` command `tb pipe regression-tests` to handle the edge case when all the requests to the endpoint that we want to check fails as the value returned is no what we expect.
58
+
59
+ 2.1.0
60
+ ************
61
+
62
+ - `Changed` `exec_test.sh` now runs with `parallel -j 4` to speed up CI cycles
63
+ - `Changed` `tb release rollback` now requires double confirmation
64
+ - `Fixed` Ignore .diff_tmp/ on `tb deploy`
65
+ - `Changed` Regression tests select faster the requests used for the checks.
66
+ - `Improve` peformance when using the option `--only-change` in the `tb push` command. This was a regression introduced in the version 2.0.0
67
+ - `Added` Add option `c` or `--concurrency` to `tb run test` to run tests in parallel
68
+ - `Removed` hidden option `--only-changes` from `tb deploy` as it's no longer required.
69
+ - `Changed` Speed-up CLI startup by lazy-importing some dependencies.
70
+ - `Added` `tb auth` shows and uses the new AWS regions
71
+ - `Added` Add `--auto-promote` to `tb deploy` to automatically promote the Release created. It automatically applies to Environments created by CI.
72
+ - `Added` Support `TAGS "backfil_column=<column_name>"` in .datasource definition to do backfill operations when running a populate job
73
+ - `Changed` Regression tests now also use Pipe requests done with the POST HTTP method.
74
+ - `Changed` `tb env` commands to use the new `CLIConfig` class to manage the authentication and the configuration of the CLI. This change allows us to have a better control of the configuration and the authentication of the CLI. This should be transparent for the users.
75
+ - `Changed` Internal changes in `tb deploy`
76
+ - `Added` `tb deploy` removes resources from datafiles deleted
77
+
78
+
55
79
  2.1.0.dev15
56
80
  ************
57
81
 
@@ -1,11 +1,11 @@
1
- tinybird/__cli__.py,sha256=TdlfeOyW4KUWEo8ZniJTkDVv3N47bV1aQF72Daz5PaU,238
1
+ tinybird/__cli__.py,sha256=h9wVe6T7fEpVFmu47vNZnRw75UTb_S2hVm5AjTTQUKk,237
2
2
  tinybird/check_pypi.py,sha256=_4NkharLyR_ELrAdit-ftqIWvOf7jZNPt3i76frlo9g,975
3
3
  tinybird/client.py,sha256=scmQ6bLSRDkunN5hdNHIp8Yn66RPXVpEqzs-S8YrWYs,45733
4
4
  tinybird/config.py,sha256=ckNiJhDbRm1IGNz_0V712fgiv2XBhDxujUH0EvwYVm4,1962
5
- tinybird/connector_settings.py,sha256=wQ3ZbgGwXeaKLVluvzIaVX8bFHLOo4JvzUe1nLZdEPs,3299
5
+ tinybird/connector_settings.py,sha256=hXCL94KbvTwlZ9fJH4nl5J9Tf2HX6esws4AsyYdeA7M,2178
6
6
  tinybird/connectors.py,sha256=lkpVSUmSuViEZBa4QjTK7YmPHUop0a5UFoTrSmlVq6k,15244
7
7
  tinybird/context.py,sha256=Wp2vcP_qN2PYQh6hYnTwI_XcqUCt_3pZORjSTRnpZz4,802
8
- tinybird/datafile.py,sha256=pUmL0UcbU8rHDa6B5Hyr9fxsIAoSO1NUnwIIvIM15RU,187509
8
+ tinybird/datafile.py,sha256=PPvxoXpD8Y-flXoXWpkUOOc_0_IGSClmdm7l7mFg42o,188245
9
9
  tinybird/datatypes.py,sha256=adYOQBTyfeBGVINIlaRex_81gTQQuqF2M9VTQpzq1H0,7060
10
10
  tinybird/feedback_manager.py,sha256=WNxS1OcKkD5G2W9vqFKr6OVXLxLozb9w04b1CwR3tcI,51785
11
11
  tinybird/sql.py,sha256=et404SRqcOt-l4ULZhLs8ozVxaI1vOtCFSqIWLeEqXg,36460
@@ -23,7 +23,7 @@ tinybird/tb_cli_modules/cicd.py,sha256=yVyzUa6ZLgidoSY9_nNWJFjdbg6rP9IWegjzplYOR
23
23
  tinybird/tb_cli_modules/cli.py,sha256=GZFEUgp_wFU9a0o87VrzXTxudHHqafVT_WBTs-sltmg,59600
24
24
  tinybird/tb_cli_modules/common.py,sha256=R0_SXxkLWhbM7jXW6bvy7zthV-295qhBWFPbkh16SDg,70874
25
25
  tinybird/tb_cli_modules/config.py,sha256=6NTgIdwf0X132A1j6G_YrdPep87ymZ9b5pABabKLzh4,11484
26
- tinybird/tb_cli_modules/connection.py,sha256=0rU6bmY5FLalRu9zWmE_tHrXf2JUc0yRVZi9xaPqaw8,22121
26
+ tinybird/tb_cli_modules/connection.py,sha256=shBGvOWR6Qo8o19PxZhp7Oa5TCf4DGLWL0WTryY7abs,22006
27
27
  tinybird/tb_cli_modules/datasource.py,sha256=tkQxwzHfDbKoXbiyUqQRYJBSvlE7dQYi4WUy-Kva6n8,31530
28
28
  tinybird/tb_cli_modules/exceptions.py,sha256=pmucP4kTF4irIt7dXiG-FcnI-o3mvDusPmch1L8RCWk,3367
29
29
  tinybird/tb_cli_modules/job.py,sha256=AG69LPb9MbobA1awwJFZJvxqarDKfRlsBjw2V1zvYqc,2964
@@ -36,8 +36,8 @@ tinybird/tb_cli_modules/workspace.py,sha256=NDHINzW3SBo8FcWH8Bx-DCeUXQ8YUJX6FW8c
36
36
  tinybird/tb_cli_modules/workspace_members.py,sha256=6oZM7oJQPxDMycL95TPtALriL5WRI2DhNlQWD8MP8JU,8205
37
37
  tinybird/tb_cli_modules/tinyunit/tinyunit.py,sha256=ywTyKnkpowYf5M66_lIxvsOBahycg__s7AirL7DnVaY,11596
38
38
  tinybird/tb_cli_modules/tinyunit/tinyunit_lib.py,sha256=j92za8QbXrv4eIPjKBZPn9ghR-nYQ2wZZ88MeXyMWXE,1868
39
- tinybird_cli-2.1.0.dev15.dist-info/METADATA,sha256=rlm9IvXfq80PzTlR2vRiI6FmT3H0yPCTzMTbadmZ9dI,68220
40
- tinybird_cli-2.1.0.dev15.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
41
- tinybird_cli-2.1.0.dev15.dist-info/entry_points.txt,sha256=PKPKuPmA4IfJYnCFHHUiw-aAWZuBomFvwCklv1OyCjE,43
42
- tinybird_cli-2.1.0.dev15.dist-info/top_level.txt,sha256=8TRt5snq9vZpx4rBBc9EWpj76Er6IAdfnx_Eq6cNBk8,45
43
- tinybird_cli-2.1.0.dev15.dist-info/RECORD,,
39
+ tinybird_cli-2.1.1.dev2.dist-info/METADATA,sha256=h4ydv_X22Vlp18NgOBGkpaT2QFW8VRFBQ0LJj-WG2qA,69869
40
+ tinybird_cli-2.1.1.dev2.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
41
+ tinybird_cli-2.1.1.dev2.dist-info/entry_points.txt,sha256=PKPKuPmA4IfJYnCFHHUiw-aAWZuBomFvwCklv1OyCjE,43
42
+ tinybird_cli-2.1.1.dev2.dist-info/top_level.txt,sha256=8TRt5snq9vZpx4rBBc9EWpj76Er6IAdfnx_Eq6cNBk8,45
43
+ tinybird_cli-2.1.1.dev2.dist-info/RECORD,,