tinybird 0.0.1.dev104__py3-none-any.whl → 0.0.1.dev106__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 +16 -14
- {tinybird-0.0.1.dev104.dist-info → tinybird-0.0.1.dev106.dist-info}/METADATA +1 -1
- {tinybird-0.0.1.dev104.dist-info → tinybird-0.0.1.dev106.dist-info}/RECORD +7 -7
- {tinybird-0.0.1.dev104.dist-info → tinybird-0.0.1.dev106.dist-info}/WHEEL +0 -0
- {tinybird-0.0.1.dev104.dist-info → tinybird-0.0.1.dev106.dist-info}/entry_points.txt +0 -0
- {tinybird-0.0.1.dev104.dist-info → tinybird-0.0.1.dev106.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.dev106'
|
|
8
|
+
__revision__ = 'b74e464'
|
|
@@ -40,7 +40,7 @@ def api_post(
|
|
|
40
40
|
params: Optional[dict] = None,
|
|
41
41
|
) -> dict:
|
|
42
42
|
r = requests.post(url, headers=headers, files=files, params=params)
|
|
43
|
-
if r.status_code
|
|
43
|
+
if r.status_code < 300:
|
|
44
44
|
logging.debug(json.dumps(r.json(), indent=2))
|
|
45
45
|
return r.json()
|
|
46
46
|
# Try to parse and print the error from the response
|
|
@@ -48,8 +48,10 @@ def api_post(
|
|
|
48
48
|
result = r.json()
|
|
49
49
|
logging.debug(json.dumps(result, indent=2))
|
|
50
50
|
error = result.get("error")
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
if error:
|
|
52
|
+
click.echo(FeedbackManager.error(message=f"Error: {error}"))
|
|
53
|
+
sys.exit(1)
|
|
54
|
+
return result
|
|
53
55
|
except Exception:
|
|
54
56
|
click.echo(FeedbackManager.error(message="Error parsing response from API"))
|
|
55
57
|
sys.exit(1)
|
|
@@ -112,9 +114,9 @@ def promote_deployment(host: Optional[str], headers: dict, wait: bool) -> None:
|
|
|
112
114
|
time.sleep(5)
|
|
113
115
|
|
|
114
116
|
|
|
115
|
-
# TODO(eclbg): This logic should be in the server, and there should be a dedicated endpoint for
|
|
117
|
+
# TODO(eclbg): This logic should be in the server, and there should be a dedicated endpoint for discarding a
|
|
116
118
|
# deployment
|
|
117
|
-
def
|
|
119
|
+
def discard_deployment(host: Optional[str], headers: dict, wait: bool) -> None:
|
|
118
120
|
TINYBIRD_API_URL = f"{host}/v1/deployments"
|
|
119
121
|
result = api_fetch(TINYBIRD_API_URL, headers=headers)
|
|
120
122
|
|
|
@@ -154,7 +156,7 @@ def rollback_deployment(host: Optional[str], headers: dict, wait: bool) -> None:
|
|
|
154
156
|
click.echo(FeedbackManager.error(message=result.get("error")))
|
|
155
157
|
sys.exit(1)
|
|
156
158
|
|
|
157
|
-
click.echo(FeedbackManager.success(message="
|
|
159
|
+
click.echo(FeedbackManager.success(message="Discard process successfully started"))
|
|
158
160
|
|
|
159
161
|
if wait:
|
|
160
162
|
while True:
|
|
@@ -163,7 +165,7 @@ def rollback_deployment(host: Optional[str], headers: dict, wait: bool) -> None:
|
|
|
163
165
|
|
|
164
166
|
current_deployment = result.get("deployment")
|
|
165
167
|
if current_deployment.get("status") == "deleted":
|
|
166
|
-
click.echo(FeedbackManager.success(message="
|
|
168
|
+
click.echo(FeedbackManager.success(message="Discard process successfully completed"))
|
|
167
169
|
break
|
|
168
170
|
time.sleep(5)
|
|
169
171
|
|
|
@@ -264,7 +266,7 @@ def deployment_promote(ctx: click.Context, wait: bool) -> None:
|
|
|
264
266
|
promote_deployment(client.host, HEADERS, wait=wait)
|
|
265
267
|
|
|
266
268
|
|
|
267
|
-
@deployment_group.command(name="
|
|
269
|
+
@deployment_group.command(name="discard")
|
|
268
270
|
@click.pass_context
|
|
269
271
|
@click.option(
|
|
270
272
|
"--wait/--no-wait",
|
|
@@ -272,16 +274,16 @@ def deployment_promote(ctx: click.Context, wait: bool) -> None:
|
|
|
272
274
|
default=False,
|
|
273
275
|
help="Wait for deploy to finish. Disabled by default.",
|
|
274
276
|
)
|
|
275
|
-
def
|
|
277
|
+
def deployment_discard(ctx: click.Context, wait: bool) -> None:
|
|
276
278
|
"""
|
|
277
|
-
|
|
279
|
+
Discard the current deployment.
|
|
278
280
|
"""
|
|
279
281
|
client = ctx.ensure_object(dict)["client"]
|
|
280
282
|
|
|
281
283
|
TINYBIRD_API_KEY = client.token
|
|
282
284
|
HEADERS = {"Authorization": f"Bearer {TINYBIRD_API_KEY}"}
|
|
283
285
|
|
|
284
|
-
|
|
286
|
+
discard_deployment(client.host, HEADERS, wait=wait)
|
|
285
287
|
|
|
286
288
|
|
|
287
289
|
@cli.command(name="deploy", hidden=True)
|
|
@@ -295,7 +297,7 @@ def deployment_rollback(ctx: click.Context, wait: bool) -> None:
|
|
|
295
297
|
"--auto/--no-auto",
|
|
296
298
|
is_flag=True,
|
|
297
299
|
default=True,
|
|
298
|
-
help="Auto-promote the deployment. Only works if --wait is enabled. Disabled by default.",
|
|
300
|
+
help="Auto-promote or auto-discard the deployment. Only works if --wait is enabled. Disabled by default.",
|
|
299
301
|
)
|
|
300
302
|
@click.option(
|
|
301
303
|
"--check",
|
|
@@ -384,7 +386,7 @@ def create_deployment(
|
|
|
384
386
|
)
|
|
385
387
|
else:
|
|
386
388
|
click.echo(FeedbackManager.error(message=f"{deploy_error.get('error')}"))
|
|
387
|
-
click.echo() # For spacing
|
|
389
|
+
click.echo("") # For spacing
|
|
388
390
|
|
|
389
391
|
status = result.get("result")
|
|
390
392
|
if check:
|
|
@@ -445,7 +447,7 @@ def create_deployment(
|
|
|
445
447
|
|
|
446
448
|
if auto:
|
|
447
449
|
click.echo(FeedbackManager.error(message="Rolling back deployment"))
|
|
448
|
-
|
|
450
|
+
discard_deployment(client.host, HEADERS, wait=wait)
|
|
449
451
|
sys.exit(1)
|
|
450
452
|
|
|
451
453
|
if deployment.get("status") == "data_ready":
|
|
@@ -15,7 +15,7 @@ tinybird/syncasync.py,sha256=IPnOx6lMbf9SNddN1eBtssg8vCLHMt76SuZ6YNYm-Yk,27761
|
|
|
15
15
|
tinybird/tornado_template.py,sha256=jjNVDMnkYFWXflmT8KU_Ssbo5vR8KQq3EJMk5vYgXRw,41959
|
|
16
16
|
tinybird/ch_utils/constants.py,sha256=aYvg2C_WxYWsnqPdZB1ZFoIr8ZY-XjUXYyHKE9Ansj0,3890
|
|
17
17
|
tinybird/ch_utils/engine.py,sha256=BZuPM7MFS7vaEKK5tOMR2bwSAgJudPrJt27uVEwZmTY,40512
|
|
18
|
-
tinybird/tb/__cli__.py,sha256
|
|
18
|
+
tinybird/tb/__cli__.py,sha256=-x9kfqwYfco3Vd-oAPM_DWRKixxywipjPTrGaNSIsOE,252
|
|
19
19
|
tinybird/tb/cli.py,sha256=H_HaZhkimKgkryYXpBjHfY9Qtg-ZORiONU3psDNpzDk,1135
|
|
20
20
|
tinybird/tb/modules/auth.py,sha256=L1IatO2arRSzys3t8px8xVt8uPWUL5EVD0sFzAV_uVU,9022
|
|
21
21
|
tinybird/tb/modules/build.py,sha256=h5drdmDFX8NHts9dA2Zepao7KSgMAl3DZGyFufVZP78,11085
|
|
@@ -27,7 +27,7 @@ tinybird/tb/modules/connection.py,sha256=WKeDxbTpSsQ1PUmsT730g3S5RT2PtR5mPpVEanD
|
|
|
27
27
|
tinybird/tb/modules/copy.py,sha256=MAVqKip8_QhOYq99U_XuqSO6hCLJEh5sFtbhcXtI3SI,5802
|
|
28
28
|
tinybird/tb/modules/create.py,sha256=FuJYuFqWy2kgSfxSwkQ5nExZgEYALyq_z9dc1d-FRN0,14078
|
|
29
29
|
tinybird/tb/modules/datasource.py,sha256=dNCK9iCR2xPLfwqqwg2ixyE6NuoVEiJU2mBZBmOYrVY,16906
|
|
30
|
-
tinybird/tb/modules/deployment.py,sha256=
|
|
30
|
+
tinybird/tb/modules/deployment.py,sha256=UIW3W0qKBRk2o4gE8WDjmq9-UkrNZjtkbyKvcQR203k,19515
|
|
31
31
|
tinybird/tb/modules/endpoint.py,sha256=EhVoGAXsFz-83Fiwj1gI-I73iRRvL49d0W81un7hvPE,12080
|
|
32
32
|
tinybird/tb/modules/exceptions.py,sha256=4A2sSjCEqKUMqpP3WI00zouCWW4uLaghXXLZBSw04mY,3363
|
|
33
33
|
tinybird/tb/modules/feedback_manager.py,sha256=7nNiOx7OMebiheLED1r0d75SbuXCNxyBmF4e20rCBNc,69511
|
|
@@ -81,8 +81,8 @@ tinybird/tb_cli_modules/config.py,sha256=IsgdtFRnUrkY8-Zo32lmk6O7u3bHie1QCxLwgp4
|
|
|
81
81
|
tinybird/tb_cli_modules/exceptions.py,sha256=pmucP4kTF4irIt7dXiG-FcnI-o3mvDusPmch1L8RCWk,3367
|
|
82
82
|
tinybird/tb_cli_modules/regions.py,sha256=QjsL5H6Kg-qr0aYVLrvb1STeJ5Sx_sjvbOYO0LrEGMk,166
|
|
83
83
|
tinybird/tb_cli_modules/telemetry.py,sha256=Hh2Io8ZPROSunbOLuMvuIFU4TqwWPmQTqal4WS09K1A,10449
|
|
84
|
-
tinybird-0.0.1.
|
|
85
|
-
tinybird-0.0.1.
|
|
86
|
-
tinybird-0.0.1.
|
|
87
|
-
tinybird-0.0.1.
|
|
88
|
-
tinybird-0.0.1.
|
|
84
|
+
tinybird-0.0.1.dev106.dist-info/METADATA,sha256=zlATEfmvwT16raAdYH0EMD0tTCErNZUVgDmYAQYqNd4,1612
|
|
85
|
+
tinybird-0.0.1.dev106.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
|
86
|
+
tinybird-0.0.1.dev106.dist-info/entry_points.txt,sha256=LwdHU6TfKx4Qs7BqqtaczEZbImgU7Abe9Lp920zb_fo,43
|
|
87
|
+
tinybird-0.0.1.dev106.dist-info/top_level.txt,sha256=VqqqEmkAy7UNaD8-V51FCoMMWXjLUlR0IstvK7tJYVY,54
|
|
88
|
+
tinybird-0.0.1.dev106.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|