tinybird 0.0.1.dev79__py3-none-any.whl → 0.0.1.dev80__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 +2 -2
- tinybird/tb/modules/deployment.py +26 -10
- {tinybird-0.0.1.dev79.dist-info → tinybird-0.0.1.dev80.dist-info}/METADATA +1 -1
- {tinybird-0.0.1.dev79.dist-info → tinybird-0.0.1.dev80.dist-info}/RECORD +7 -7
- {tinybird-0.0.1.dev79.dist-info → tinybird-0.0.1.dev80.dist-info}/WHEEL +0 -0
- {tinybird-0.0.1.dev79.dist-info → tinybird-0.0.1.dev80.dist-info}/entry_points.txt +0 -0
- {tinybird-0.0.1.dev79.dist-info → tinybird-0.0.1.dev80.dist-info}/top_level.txt +0 -0
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.
|
|
8
|
-
__revision__ = '
|
|
7
|
+
__version__ = '0.0.1.dev80'
|
|
8
|
+
__revision__ = 'f5f5948'
|
|
@@ -15,6 +15,23 @@ from tinybird.tb.modules.feedback_manager import FeedbackManager
|
|
|
15
15
|
from tinybird.tb.modules.project import Project
|
|
16
16
|
|
|
17
17
|
|
|
18
|
+
# TODO(eclbg): This should eventually end up in client.py, but we're not using it here yet.
|
|
19
|
+
def api_fetch(url: str, headers: dict) -> dict:
|
|
20
|
+
r = requests.get(url, headers=headers)
|
|
21
|
+
if r.status_code == 200:
|
|
22
|
+
return r.json()
|
|
23
|
+
# Try to parse and print the error from the response
|
|
24
|
+
try:
|
|
25
|
+
result = r.json()
|
|
26
|
+
error = result.get("error")
|
|
27
|
+
logging.debug(json.dumps(result, indent=2))
|
|
28
|
+
click.echo(FeedbackManager.error(message=f"Error: {error}"))
|
|
29
|
+
sys.exit(1)
|
|
30
|
+
except Exception:
|
|
31
|
+
click.echo(FeedbackManager.error(message="Error parsing response from API"))
|
|
32
|
+
sys.exit(1)
|
|
33
|
+
|
|
34
|
+
|
|
18
35
|
# TODO(eclbg): This logic should be in the server, and there should be a dedicated endpoint for promoting a deployment
|
|
19
36
|
# potato
|
|
20
37
|
def promote_deployment(host: Optional[str], headers: dict, wait: bool) -> None:
|
|
@@ -197,16 +214,15 @@ def deployment_ls(ctx: click.Context) -> None:
|
|
|
197
214
|
|
|
198
215
|
TINYBIRD_API_KEY = client.token
|
|
199
216
|
HEADERS = {"Authorization": f"Bearer {TINYBIRD_API_KEY}"}
|
|
200
|
-
|
|
217
|
+
url = f"{client.host}/v1/deployments"
|
|
201
218
|
|
|
202
|
-
|
|
203
|
-
result = r.json()
|
|
219
|
+
result = api_fetch(url, HEADERS)
|
|
204
220
|
logging.debug(json.dumps(result, indent=2))
|
|
205
221
|
|
|
206
222
|
status_map = {"data_ready": "Ready", "failed": "Failed"}
|
|
207
223
|
columns = ["ID", "Status", "Created at", "Live"]
|
|
208
224
|
table = []
|
|
209
|
-
for deployment in result.get("deployments"):
|
|
225
|
+
for deployment in result.get("deployments", []):
|
|
210
226
|
if deployment.get("id") == "0":
|
|
211
227
|
continue
|
|
212
228
|
|
|
@@ -402,12 +418,12 @@ def create_deployment(
|
|
|
402
418
|
|
|
403
419
|
if deployment and wait and not check:
|
|
404
420
|
while True:
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
421
|
+
url = f"{client.host}/v1/deployments/{deployment.get('id')}"
|
|
422
|
+
res = api_fetch(url, HEADERS)
|
|
423
|
+
deployment = res.get("deployment")
|
|
424
|
+
if not deployment:
|
|
425
|
+
click.echo(FeedbackManager.error(message="Error parsing deployment from response"))
|
|
426
|
+
sys.exit(1)
|
|
411
427
|
if deployment.get("status") == "failed":
|
|
412
428
|
click.echo(FeedbackManager.error(message="Deployment failed"))
|
|
413
429
|
deploy_errors = deployment.get("errors")
|
|
@@ -15,7 +15,7 @@ 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=
|
|
18
|
+
tinybird/tb/__cli__.py,sha256=b2UfXx5tqbCIJ_Ithif0cKrS57a1zq0eTwvY7iyFQ1g,251
|
|
19
19
|
tinybird/tb/cli.py,sha256=KpJ_-V6xVEzcdPRPnHhEdh2EgRPCyhZnfJVqeqMsftI,964
|
|
20
20
|
tinybird/tb/modules/auth.py,sha256=L1IatO2arRSzys3t8px8xVt8uPWUL5EVD0sFzAV_uVU,9022
|
|
21
21
|
tinybird/tb/modules/build.py,sha256=46ZTxubughaq8QDV6yq9thatSVVY4yNqyzbfxRBcgDA,10446
|
|
@@ -26,7 +26,7 @@ tinybird/tb/modules/config.py,sha256=JVf2Kcafqmkid4voHecNvWdDVXmht-2zyNXkdcIyIm4
|
|
|
26
26
|
tinybird/tb/modules/copy.py,sha256=MAVqKip8_QhOYq99U_XuqSO6hCLJEh5sFtbhcXtI3SI,5802
|
|
27
27
|
tinybird/tb/modules/create.py,sha256=bWCKND9R16vtBZHThCnx87bPtufp3pNpNr_yt5xgEn8,12795
|
|
28
28
|
tinybird/tb/modules/datasource.py,sha256=dNCK9iCR2xPLfwqqwg2ixyE6NuoVEiJU2mBZBmOYrVY,16906
|
|
29
|
-
tinybird/tb/modules/deployment.py,sha256=
|
|
29
|
+
tinybird/tb/modules/deployment.py,sha256=LzxOWjI9hSIXbNxR0BmQfXWBUHhVX2LoZUeChkcmg6c,17528
|
|
30
30
|
tinybird/tb/modules/endpoint.py,sha256=EhVoGAXsFz-83Fiwj1gI-I73iRRvL49d0W81un7hvPE,12080
|
|
31
31
|
tinybird/tb/modules/exceptions.py,sha256=4A2sSjCEqKUMqpP3WI00zouCWW4uLaghXXLZBSw04mY,3363
|
|
32
32
|
tinybird/tb/modules/feedback_manager.py,sha256=Lv5MBGWNbIFTIy4nNSi0c61bmiQRv5J0nHRiiXUqDuc,68478
|
|
@@ -76,8 +76,8 @@ tinybird/tb_cli_modules/config.py,sha256=IsgdtFRnUrkY8-Zo32lmk6O7u3bHie1QCxLwgp4
|
|
|
76
76
|
tinybird/tb_cli_modules/exceptions.py,sha256=pmucP4kTF4irIt7dXiG-FcnI-o3mvDusPmch1L8RCWk,3367
|
|
77
77
|
tinybird/tb_cli_modules/regions.py,sha256=QjsL5H6Kg-qr0aYVLrvb1STeJ5Sx_sjvbOYO0LrEGMk,166
|
|
78
78
|
tinybird/tb_cli_modules/telemetry.py,sha256=Hh2Io8ZPROSunbOLuMvuIFU4TqwWPmQTqal4WS09K1A,10449
|
|
79
|
-
tinybird-0.0.1.
|
|
80
|
-
tinybird-0.0.1.
|
|
81
|
-
tinybird-0.0.1.
|
|
82
|
-
tinybird-0.0.1.
|
|
83
|
-
tinybird-0.0.1.
|
|
79
|
+
tinybird-0.0.1.dev80.dist-info/METADATA,sha256=v2Pql-adOVjd0zZ1xHmW0kML7uDHf5YKWWiY1i_NzL0,2585
|
|
80
|
+
tinybird-0.0.1.dev80.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
|
81
|
+
tinybird-0.0.1.dev80.dist-info/entry_points.txt,sha256=LwdHU6TfKx4Qs7BqqtaczEZbImgU7Abe9Lp920zb_fo,43
|
|
82
|
+
tinybird-0.0.1.dev80.dist-info/top_level.txt,sha256=VqqqEmkAy7UNaD8-V51FCoMMWXjLUlR0IstvK7tJYVY,54
|
|
83
|
+
tinybird-0.0.1.dev80.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|