tinybird 0.0.1.dev85__py3-none-any.whl → 0.0.1.dev86__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.dev85'
8
- __revision__ = 'd751c6c'
7
+ __version__ = '0.0.1.dev86'
8
+ __revision__ = '125dbec'
tinybird/tb/cli.py CHANGED
@@ -17,6 +17,7 @@ import tinybird.tb.modules.fmt
17
17
  import tinybird.tb.modules.job
18
18
  import tinybird.tb.modules.local
19
19
  import tinybird.tb.modules.login
20
+ import tinybird.tb.modules.logout
20
21
  import tinybird.tb.modules.materialization
21
22
  import tinybird.tb.modules.mock
22
23
  import tinybird.tb.modules.pipe
@@ -7,7 +7,6 @@ import json
7
7
  import logging
8
8
  import os
9
9
  import sys
10
- from os import getcwd
11
10
  from typing import Any, Callable, Dict, List, Optional, Tuple, Union
12
11
 
13
12
  import click
@@ -146,9 +145,9 @@ async def pull(ctx: Context, force: bool, fmt: bool) -> None:
146
145
  """Retrieve latest versions for project files from Tinybird."""
147
146
 
148
147
  client = ctx.ensure_object(dict)["client"]
149
- folder = getcwd()
148
+ project = ctx.ensure_object(dict)["project"]
150
149
 
151
- return await folder_pull(client, folder, force, fmt=fmt)
150
+ return await folder_pull(client, project.path, force, fmt=fmt)
152
151
 
153
152
 
154
153
  @cli.command(hidden=True)
@@ -394,7 +393,7 @@ def __unpatch_click_output():
394
393
 
395
394
 
396
395
  async def create_ctx_client(ctx: Context, config: Dict[str, Any], cloud: bool, build: bool, staging: bool):
397
- commands_without_ctx_client = ["auth", "check", "login", "local", "update", "upgrade"]
396
+ commands_without_ctx_client = ["auth", "check", "login", "local", "update", "upgrade", "logout"]
398
397
  command = ctx.invoked_subcommand
399
398
  if command in commands_without_ctx_client:
400
399
  return None
@@ -0,0 +1,30 @@
1
+ import click
2
+
3
+ from tinybird.tb.modules.cli import cli
4
+ from tinybird.tb.modules.config import CLIConfig
5
+ from tinybird.tb.modules.feedback_manager import FeedbackManager
6
+
7
+
8
+ @cli.command(name="logout", hidden=True)
9
+ def logout() -> None:
10
+ """
11
+ Remove authentication from Tinybird.
12
+
13
+ This command will remove the authentication credentials from the CLI configuration.
14
+ """
15
+ conf = CLIConfig.get_project_config()
16
+ if workspace_name := conf.get("name", ""):
17
+ click.echo(FeedbackManager.highlight(message=f"» Logging out from {workspace_name}..."))
18
+ else:
19
+ click.echo(FeedbackManager.highlight(message="» Logging out..."))
20
+ conf.set_user_token("")
21
+ conf.set_token("")
22
+ conf.set_workspace_token(conf.get("id", ""), "")
23
+ conf.set_token_for_host("", conf.get("host", ""))
24
+ conf["tokens"] = {}
25
+ conf["name"] = ""
26
+ conf["id"] = ""
27
+ conf["user_id"] = ""
28
+ conf["user_email"] = ""
29
+ conf.persist_to_file()
30
+ click.echo(FeedbackManager.success(message="✓ Logged out!"))
@@ -74,7 +74,7 @@ async def mock(ctx: click.Context, datasource: str, rows: int, prompt: str) -> N
74
74
  sql = extract_xml(response, "sql")
75
75
  result = await tb_client.query(f"{sql} FORMAT JSON")
76
76
  data = result.get("data", [])[:rows]
77
- if env == "build":
77
+ if env in ("build", "local"):
78
78
  persist_fixture_sql(datasource_name, sql, folder)
79
79
 
80
80
  fixture_path = persist_fixture(datasource_name, data, folder)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: tinybird
3
- Version: 0.0.1.dev85
3
+ Version: 0.0.1.dev86
4
4
  Summary: Tinybird Command Line Tool
5
5
  Home-page: https://www.tinybird.co/docs/cli/introduction.html
6
6
  Author: Tinybird
@@ -15,12 +15,12 @@ tinybird/syncasync.py,sha256=IPnOx6lMbf9SNddN1eBtssg8vCLHMt76SuZ6YNYm-Yk,27761
15
15
  tinybird/tornado_template.py,sha256=KmW_VD7y-NVqrc8YZKwIaxoJB0XpCcB2izdmxmtmApM,41944
16
16
  tinybird/ch_utils/constants.py,sha256=aYvg2C_WxYWsnqPdZB1ZFoIr8ZY-XjUXYyHKE9Ansj0,3890
17
17
  tinybird/ch_utils/engine.py,sha256=AUAww-KjGOZg9h0IBlKA3FeacJYB4rOtqcTGJhFM-g8,40392
18
- tinybird/tb/__cli__.py,sha256=fmMvEpRU9NZ5mPO3UcdGwK4LO7Z1fNenvNHcaiN2NWI,251
19
- tinybird/tb/cli.py,sha256=KpJ_-V6xVEzcdPRPnHhEdh2EgRPCyhZnfJVqeqMsftI,964
18
+ tinybird/tb/__cli__.py,sha256=g7_DbCeC7bCOKoEiJkKaQ89W0974t4itgPG1YR0nK8k,251
19
+ tinybird/tb/cli.py,sha256=qon0Lim-v5hHWWRW7TXaOoGo3p2kc5Xwgg3feI4mbMQ,998
20
20
  tinybird/tb/modules/auth.py,sha256=L1IatO2arRSzys3t8px8xVt8uPWUL5EVD0sFzAV_uVU,9022
21
21
  tinybird/tb/modules/build.py,sha256=46ZTxubughaq8QDV6yq9thatSVVY4yNqyzbfxRBcgDA,10446
22
22
  tinybird/tb/modules/cicd.py,sha256=T0lb9u_bDdTUVe8TwNNb1qQ5KnSPHMVjqPfKF4BBNBw,5347
23
- tinybird/tb/modules/cli.py,sha256=Vwppm05Y9fKLY_Yo5pleMkcd8q7e-bqgXWGtNQmLan0,16447
23
+ tinybird/tb/modules/cli.py,sha256=rE-0PtttuXvigKP1BkdgolP833pEhe-daK6l86bnaEw,16468
24
24
  tinybird/tb/modules/common.py,sha256=f5yKjb1dgUzR-SrC4UHnpHXYIu6INcTHwNO96jW8A9w,73201
25
25
  tinybird/tb/modules/config.py,sha256=wIsoIf2yMCT2JQ5f6nZr-WzB7Uuah9EqXf6Glxe_p-Q,11353
26
26
  tinybird/tb/modules/copy.py,sha256=MAVqKip8_QhOYq99U_XuqSO6hCLJEh5sFtbhcXtI3SI,5802
@@ -37,8 +37,9 @@ tinybird/tb/modules/llm_utils.py,sha256=nS9r4FAElJw8yXtmdYrx-rtI2zXR8qXfi1QqUDCf
37
37
  tinybird/tb/modules/local.py,sha256=revEEYP-Oq5nqURgmZmc0kt1_tEjM31dyUtcH5YbOuc,5842
38
38
  tinybird/tb/modules/local_common.py,sha256=jWNyoMBxamjEWLqyIhF50t3vz75CuZThekhDmP4cgQ4,3055
39
39
  tinybird/tb/modules/login.py,sha256=NB-evr7b00ChKPulX7c8YLN3EX6cr0CwALN0wroAq3o,6147
40
+ tinybird/tb/modules/logout.py,sha256=ULooy1cDBD02-r7voZmhV7udA0ML5tVuflJyShrh56Y,1022
40
41
  tinybird/tb/modules/materialization.py,sha256=r8Q9HXcYEmfrEzP4WpiasCKDJdSkTPaAKJtZMoJKhi8,5749
41
- tinybird/tb/modules/mock.py,sha256=ASJTm4p11vkevGXCvU0h57aw7Inx03CTdxd5o2uzd8k,3870
42
+ tinybird/tb/modules/mock.py,sha256=3q4i6CXKcS-zsgevbN_zpAP4AnB9_WIVxmVSJV3FNPQ,3881
42
43
  tinybird/tb/modules/pipe.py,sha256=gcLz0qHgwKDLsWFY3yFLO9a0ETAV1dFbI8YeLHi9460,2429
43
44
  tinybird/tb/modules/playground.py,sha256=CQaz2JqFDdReK2fJY1yZsSwiSY24_jeTb9PKw1WUigA,4848
44
45
  tinybird/tb/modules/project.py,sha256=vxNEsc5gIQJM7ybXklnT7wna2M-GfbUybj4nKckrZM8,2949
@@ -76,8 +77,8 @@ tinybird/tb_cli_modules/config.py,sha256=IsgdtFRnUrkY8-Zo32lmk6O7u3bHie1QCxLwgp4
76
77
  tinybird/tb_cli_modules/exceptions.py,sha256=pmucP4kTF4irIt7dXiG-FcnI-o3mvDusPmch1L8RCWk,3367
77
78
  tinybird/tb_cli_modules/regions.py,sha256=QjsL5H6Kg-qr0aYVLrvb1STeJ5Sx_sjvbOYO0LrEGMk,166
78
79
  tinybird/tb_cli_modules/telemetry.py,sha256=Hh2Io8ZPROSunbOLuMvuIFU4TqwWPmQTqal4WS09K1A,10449
79
- tinybird-0.0.1.dev85.dist-info/METADATA,sha256=Pi6jcS_5h9NY_EEyOI82gkHnVqqkSMWbR1bVMV23Ew0,2585
80
- tinybird-0.0.1.dev85.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
81
- tinybird-0.0.1.dev85.dist-info/entry_points.txt,sha256=LwdHU6TfKx4Qs7BqqtaczEZbImgU7Abe9Lp920zb_fo,43
82
- tinybird-0.0.1.dev85.dist-info/top_level.txt,sha256=VqqqEmkAy7UNaD8-V51FCoMMWXjLUlR0IstvK7tJYVY,54
83
- tinybird-0.0.1.dev85.dist-info/RECORD,,
80
+ tinybird-0.0.1.dev86.dist-info/METADATA,sha256=b7pdCP3rGeK8dWWdfbN-eicQl2u38KD4g1KWUnnLAlA,2585
81
+ tinybird-0.0.1.dev86.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
82
+ tinybird-0.0.1.dev86.dist-info/entry_points.txt,sha256=LwdHU6TfKx4Qs7BqqtaczEZbImgU7Abe9Lp920zb_fo,43
83
+ tinybird-0.0.1.dev86.dist-info/top_level.txt,sha256=VqqqEmkAy7UNaD8-V51FCoMMWXjLUlR0IstvK7tJYVY,54
84
+ tinybird-0.0.1.dev86.dist-info/RECORD,,