tinybird 0.0.1.dev145__py3-none-any.whl → 0.0.1.dev147__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.

Potentially problematic release.


This version of tinybird might be problematic. Click here for more details.

tinybird/tb/__cli__.py CHANGED
@@ -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__ = '0.0.1.dev145'
8
- __revision__ = 'cb153c4'
7
+ __version__ = '0.0.1.dev147'
8
+ __revision__ = 'c9f089b'
@@ -120,6 +120,8 @@ tinybird_ci_workflow:
120
120
  services:
121
121
  - name: tinybirdco/tinybird-local:latest
122
122
  alias: tinybird-local
123
+ variables:
124
+ TB_LOCAL_HOST: tinybird-local
123
125
  """
124
126
 
125
127
  GITLAB_CD_YML = """
@@ -618,7 +618,7 @@ You'll be creating a Google Service Account and you will grant it access to you
618
618
  STEP 2: CREATE GCP SERVICE ACCOUNT
619
619
  ──────────────────────────────────────────────────────────────
620
620
 
621
- 1. Go to \033]8;https://console.cloud.google.com/iam-admin/serviceaccounts/create\033\\Service Accounts > + Create service account\033]8;;\033\\
621
+ 1. Go to \033]8;https://console.cloud.google.com/iam-admin/serviceaccounts/create\033\\IAM & Admin > Service Accounts > + Create Service Account\033]8;;\033\\
622
622
  2. Provide a service account name. Name the service account something meaningful (e.g., TinybirdGCS-{environment}-svc-account)
623
623
  3. Click "Create and continue"
624
624
  4. Click the "Select a role" drop down menu and select "Storage Object Viewer" (You can add IAM condition to provide access to selected buckets. More info in \033]8;;https://www.tinybird.co/docs/forward/get-data-in/connectors/gcs\033\\IAM Conditions\033]8;;\033\\)
@@ -632,7 +632,7 @@ STEP 2: CREATE GCP SERVICE ACCOUNT
632
632
  STEP 3: ADD KEY TO SERVICE ACCOUNT
633
633
  ──────────────────────────────────────────────────────────────
634
634
 
635
- 1. Go to Keys
635
+ 1. In the Service Account you just created, go to Keys
636
636
  2. Click the "Add key" drop down menu and select "Create new key"
637
637
  3. Select "JSON" and click "Create". This should have downloaded a .json file.
638
638
  4. Copy the whole json and paste it here. This will create a tinybird secret, so there is no need to have that credentials file in the project.
@@ -1,6 +1,7 @@
1
1
  import hashlib
2
2
  import logging
3
3
  import os
4
+ import re
4
5
  from typing import Any, Dict
5
6
 
6
7
  import requests
@@ -13,14 +14,15 @@ from tinybird.tb.modules.feedback_manager import FeedbackManager
13
14
  TB_IMAGE_NAME = "tinybirdco/tinybird-local:latest"
14
15
  TB_CONTAINER_NAME = "tinybird-local"
15
16
  TB_LOCAL_PORT = int(os.getenv("TB_LOCAL_PORT", 7181))
16
- TB_LOCAL_HOST = f"http://localhost:{TB_LOCAL_PORT}"
17
+ TB_LOCAL_HOST = re.sub(r"^https?://", "", os.getenv("TB_LOCAL_HOST", "localhost"))
18
+ TB_LOCAL_ADDRESS = f"http://{TB_LOCAL_HOST}:{TB_LOCAL_PORT}"
17
19
 
18
20
 
19
21
  async def get_tinybird_local_client(config_obj: Dict[str, Any], staging: bool = False) -> TinyB:
20
22
  """Get a Tinybird client connected to the local environment."""
21
23
 
22
24
  config = await get_tinybird_local_config(config_obj)
23
- return config.get_client(host=TB_LOCAL_HOST, staging=staging)
25
+ return config.get_client(host=TB_LOCAL_ADDRESS, staging=staging)
24
26
 
25
27
 
26
28
  async def get_tinybird_local_config(config_obj: Dict[str, Any]) -> CLIConfig:
@@ -33,7 +35,7 @@ async def get_tinybird_local_config(config_obj: Dict[str, Any]) -> CLIConfig:
33
35
 
34
36
  try:
35
37
  # ruff: noqa: ASYNC210
36
- tokens = requests.get(f"{TB_LOCAL_HOST}/tokens").json()
38
+ tokens = requests.get(f"{TB_LOCAL_ADDRESS}/tokens").json()
37
39
  except Exception:
38
40
  raise CLILocalException(
39
41
  FeedbackManager.error(message="Tinybird local is not running. Please run `tb local start` first.")
@@ -44,7 +46,7 @@ async def get_tinybird_local_config(config_obj: Dict[str, Any]) -> CLIConfig:
44
46
  default_token = tokens["workspace_admin_token"]
45
47
  # Create a new workspace if path is provided. This is used to isolate the build in a different workspace.
46
48
  if path:
47
- user_client = config.get_client(host=TB_LOCAL_HOST, token=user_token)
49
+ user_client = config.get_client(host=TB_LOCAL_ADDRESS, token=user_token)
48
50
  ws_name = config.get("name") or config_obj.get("name") or get_build_workspace_name(path)
49
51
  if not ws_name:
50
52
  raise AuthNoTokenException()
@@ -52,7 +54,7 @@ async def get_tinybird_local_config(config_obj: Dict[str, Any]) -> CLIConfig:
52
54
  logging.debug(f"Workspace used for build: {ws_name}")
53
55
 
54
56
  user_workspaces = requests.get(
55
- f"{TB_LOCAL_HOST}/v1/user/workspaces?with_organization=true&token={admin_token}"
57
+ f"{TB_LOCAL_ADDRESS}/v1/user/workspaces?with_organization=true&token={admin_token}"
56
58
  ).json()
57
59
  user_org_id = user_workspaces.get("organization_id", {})
58
60
  local_workspaces = user_workspaces.get("workspaces", [])
@@ -63,7 +65,7 @@ async def get_tinybird_local_config(config_obj: Dict[str, Any]) -> CLIConfig:
63
65
  await user_client.create_workspace(
64
66
  ws_name, template=None, assign_to_organization_id=user_org_id, version="v1"
65
67
  )
66
- user_workspaces = requests.get(f"{TB_LOCAL_HOST}/v1/user/workspaces?token={admin_token}").json()
68
+ user_workspaces = requests.get(f"{TB_LOCAL_ADDRESS}/v1/user/workspaces?token={admin_token}").json()
67
69
  ws = next((ws for ws in user_workspaces["workspaces"] if ws["name"] == ws_name), None)
68
70
  if not ws:
69
71
  raise AuthNoTokenException()
@@ -71,11 +73,11 @@ async def get_tinybird_local_config(config_obj: Dict[str, Any]) -> CLIConfig:
71
73
  ws_token = ws["token"]
72
74
 
73
75
  config.set_token(ws_token)
74
- config.set_token_for_host(TB_LOCAL_HOST, ws_token)
75
- config.set_host(TB_LOCAL_HOST)
76
+ config.set_token_for_host(TB_LOCAL_ADDRESS, ws_token)
77
+ config.set_host(TB_LOCAL_ADDRESS)
76
78
  else:
77
79
  config.set_token(default_token)
78
- config.set_token_for_host(TB_LOCAL_HOST, default_token)
80
+ config.set_token_for_host(TB_LOCAL_ADDRESS, default_token)
79
81
 
80
82
  config.set_user_token(user_token)
81
83
  return config
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: tinybird
3
- Version: 0.0.1.dev145
3
+ Version: 0.0.1.dev147
4
4
  Summary: Tinybird Command Line Tool
5
5
  Home-page: https://www.tinybird.co/docs/cli/introduction.html
6
6
  Author: Tinybird
@@ -12,14 +12,14 @@ tinybird/syncasync.py,sha256=IPnOx6lMbf9SNddN1eBtssg8vCLHMt76SuZ6YNYm-Yk,27761
12
12
  tinybird/tornado_template.py,sha256=jjNVDMnkYFWXflmT8KU_Ssbo5vR8KQq3EJMk5vYgXRw,41959
13
13
  tinybird/ch_utils/constants.py,sha256=aYvg2C_WxYWsnqPdZB1ZFoIr8ZY-XjUXYyHKE9Ansj0,3890
14
14
  tinybird/ch_utils/engine.py,sha256=BZuPM7MFS7vaEKK5tOMR2bwSAgJudPrJt27uVEwZmTY,40512
15
- tinybird/tb/__cli__.py,sha256=yqxot7FrTzrhmcQuDsEZa2EE0ElLIrnj1a2S9FpMrhM,252
15
+ tinybird/tb/__cli__.py,sha256=y5e2Tv-AjplQMyc8awKNZamGGJ7WtoK-0TMjVOUziXs,252
16
16
  tinybird/tb/check_pypi.py,sha256=rW4QmDRbtgKdUUwJCnBkVjmTjZSZGN-XgZhx7vMkC0w,1009
17
17
  tinybird/tb/cli.py,sha256=uPV6pvi4aYVfaiGs0DQO-eoi1g9dHlrgvhutkXkdJko,1075
18
18
  tinybird/tb/client.py,sha256=aaPKq5C77e72kR7IMv9WrvnvNki8mKMOTi9EsCp0eUc,55962
19
19
  tinybird/tb/config.py,sha256=jT9xndpeCY_g0HdB5qE2EquC0TFRRnkPnQFWZWd04jo,3998
20
20
  tinybird/tb/modules/auth.py,sha256=_OeYnmTH83lnqCgQEdS6K0bx1KBUeRmZk2M7JnRmWpk,9037
21
21
  tinybird/tb/modules/build.py,sha256=5SX59ssq0KaRrgzk21KmYUnB6xOdQ_O59n7rxFBQQ1Y,17393
22
- tinybird/tb/modules/cicd.py,sha256=Ug7LijuHDIqKR6rm8OLZispWp75Zv6TyonAme8K9jaI,7114
22
+ tinybird/tb/modules/cicd.py,sha256=Cn1DyE28w2maQgIJF4IjZU7J7ULPvMG11DjN2OH-cqE,7161
23
23
  tinybird/tb/modules/cli.py,sha256=V8fC0GLt5HWtOTk6TOZM5xUAY9PoH05kyJxE6Zu4MT4,14075
24
24
  tinybird/tb/modules/common.py,sha256=WzF_zRtAl3FKqbzK6yi_IjeeGIjQNu6SKnP-PX-o3Kk,85196
25
25
  tinybird/tb/modules/config.py,sha256=ziqW_t_mRVvWOd85VoB4vKyvgMkEfpXDf9H4v38p2xc,11422
@@ -31,13 +31,13 @@ tinybird/tb/modules/deployment.py,sha256=M3NPFQXIEsDh9-J-pzPLuHF9k4SIZVvgUnHp05K
31
31
  tinybird/tb/modules/deprecations.py,sha256=vDf9RgCM8FoSGrFMJLMdNhfvmtMw5t30W-fsOJq3FzI,3607
32
32
  tinybird/tb/modules/endpoint.py,sha256=XySDt3pk66vxOZ0egUfz4bY8bEk3BjOXkv-L0OIJ3sc,12083
33
33
  tinybird/tb/modules/exceptions.py,sha256=5jK91w1LPmtqIUfDpHe_Op5OxGz8-p1BPgtLREMIni0,5217
34
- tinybird/tb/modules/feedback_manager.py,sha256=Ncenxx48-vWJjDLPuuIPOOT_1oaAVjuMLHIfbez7v0U,77652
34
+ tinybird/tb/modules/feedback_manager.py,sha256=NjnSVKkxoEkfR1TEhLaQAxKAX7wDZvVp3c32XkXftTE,77707
35
35
  tinybird/tb/modules/infra.py,sha256=fve30Gj3mG9zbquGxS2e4ipcOYOxviWQCpNFfEzJN_Q,33195
36
36
  tinybird/tb/modules/job.py,sha256=n4dSSBgnA8NqD7srGahf2xRj6wxkmX9Vl0J-QJ_a2w0,2966
37
37
  tinybird/tb/modules/llm.py,sha256=KfsCYmKeW1VQz0iDZhGKCRkQv_Y3kTHh6JuxvofOguE,1076
38
38
  tinybird/tb/modules/llm_utils.py,sha256=nS9r4FAElJw8yXtmdYrx-rtI2zXR8qXfi1QqUDCfxvg,3469
39
39
  tinybird/tb/modules/local.py,sha256=kxdF8NXZYYwtUwlFHxHKq_PA9CpMrG-rXOg_i_hlvnY,12158
40
- tinybird/tb/modules/local_common.py,sha256=Fr3U4_xqtH4AzHPo-y75dOrXlE-kC7DeC55oKeC-PMo,3255
40
+ tinybird/tb/modules/local_common.py,sha256=3nxGcjdxA5Uq0PakhbkiPDVzd66OUwPNW4gNqyYPCe8,3381
41
41
  tinybird/tb/modules/login.py,sha256=fmXPSdvJnKPv03chptGuu3_Fm6LhP6kUsUKhrmT8rJc,8269
42
42
  tinybird/tb/modules/logout.py,sha256=ULooy1cDBD02-r7voZmhV7udA0ML5tVuflJyShrh56Y,1022
43
43
  tinybird/tb/modules/materialization.py,sha256=QJX5kCPhhm6IXBO1JsalVfbQdypCe_eOUDZ_WHJZWS8,5478
@@ -79,8 +79,8 @@ tinybird/tb_cli_modules/config.py,sha256=IsgdtFRnUrkY8-Zo32lmk6O7u3bHie1QCxLwgp4
79
79
  tinybird/tb_cli_modules/exceptions.py,sha256=pmucP4kTF4irIt7dXiG-FcnI-o3mvDusPmch1L8RCWk,3367
80
80
  tinybird/tb_cli_modules/regions.py,sha256=QjsL5H6Kg-qr0aYVLrvb1STeJ5Sx_sjvbOYO0LrEGMk,166
81
81
  tinybird/tb_cli_modules/telemetry.py,sha256=Hh2Io8ZPROSunbOLuMvuIFU4TqwWPmQTqal4WS09K1A,10449
82
- tinybird-0.0.1.dev145.dist-info/METADATA,sha256=TtePTe-OGJeC189E2LQDlYSI6jr6zBZ8ktwol-RVH6E,1612
83
- tinybird-0.0.1.dev145.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
84
- tinybird-0.0.1.dev145.dist-info/entry_points.txt,sha256=LwdHU6TfKx4Qs7BqqtaczEZbImgU7Abe9Lp920zb_fo,43
85
- tinybird-0.0.1.dev145.dist-info/top_level.txt,sha256=VqqqEmkAy7UNaD8-V51FCoMMWXjLUlR0IstvK7tJYVY,54
86
- tinybird-0.0.1.dev145.dist-info/RECORD,,
82
+ tinybird-0.0.1.dev147.dist-info/METADATA,sha256=-TJHZrxsIFnBCl47t7WdjGLoOHyNmH0Mz2zwbTR8tV4,1612
83
+ tinybird-0.0.1.dev147.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
84
+ tinybird-0.0.1.dev147.dist-info/entry_points.txt,sha256=LwdHU6TfKx4Qs7BqqtaczEZbImgU7Abe9Lp920zb_fo,43
85
+ tinybird-0.0.1.dev147.dist-info/top_level.txt,sha256=VqqqEmkAy7UNaD8-V51FCoMMWXjLUlR0IstvK7tJYVY,54
86
+ tinybird-0.0.1.dev147.dist-info/RECORD,,