tinybird 0.0.1.dev261__py3-none-any.whl → 0.0.1.dev262__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/sql_template.py CHANGED
@@ -74,7 +74,7 @@ class SQLTemplateException(ValueError):
74
74
  # replace_vars_smart(t)
75
75
  # print(generate(t, **{x: '' for x in names}))
76
76
 
77
-
77
+ JOB_TIMESTAMP_PARAM = "job_timestamp"
78
78
  DEFAULT_PARAM_NAMES = ["format", "q"]
79
79
  RESERVED_PARAM_NAMES = [
80
80
  "__tb__semver",
@@ -93,6 +93,7 @@ RESERVED_PARAM_NAMES = [
93
93
  "tag",
94
94
  "template_parameters",
95
95
  "token",
96
+ JOB_TIMESTAMP_PARAM,
96
97
  ]
97
98
 
98
99
  parameter_types = [
@@ -2002,6 +2003,7 @@ def format_SQLTemplateException_message(e: SQLTemplateException, vars_and_types:
2002
2003
  item.get("default") is None
2003
2004
  and item.get("used_in", None) is None
2004
2005
  and item.get("name") not in vars_with_default_none
2006
+ and item.get("name") is not JOB_TIMESTAMP_PARAM
2005
2007
  ):
2006
2008
  vars_with_default_none.append(item["name"])
2007
2009
 
@@ -2294,6 +2296,11 @@ def render_sql_template(
2294
2296
  processed_variables = preprocess_variables(variables, template_variables_with_types)
2295
2297
  variables.update(processed_variables)
2296
2298
 
2299
+ # Handle job_timestamp special case providing the default value if not provided
2300
+ if any(var["name"] == JOB_TIMESTAMP_PARAM for var in template_variables_with_types):
2301
+ variables = variables or {}
2302
+ variables.setdefault(JOB_TIMESTAMP_PARAM, datetime.now().strftime("%Y-%m-%d %H:%M:%S"))
2303
+
2297
2304
  if test_mode:
2298
2305
 
2299
2306
  def dummy(*args, **kwargs):
tinybird/tb/__cli__.py CHANGED
@@ -4,5 +4,5 @@ __description__ = 'Tinybird Command Line Tool'
4
4
  __url__ = 'https://www.tinybird.co/docs/forward/commands'
5
5
  __author__ = 'Tinybird'
6
6
  __author_email__ = 'support@tinybird.co'
7
- __version__ = '0.0.1.dev261'
8
- __revision__ = '80be54a'
7
+ __version__ = '0.0.1.dev262'
8
+ __revision__ = 'b28ec2c'
@@ -188,14 +188,27 @@ def deployment_group() -> None:
188
188
  default=None,
189
189
  help="URL of the template to use for the deployment. Example: https://github.com/tinybirdco/web-analytics-starter-kit/tree/main/tinybird",
190
190
  )
191
+ @click.option(
192
+ "-v",
193
+ "--verbose",
194
+ is_flag=True,
195
+ default=False,
196
+ help="Show verbose output. Disabled by default.",
197
+ )
191
198
  @click.pass_context
192
199
  def deployment_create(
193
- ctx: click.Context, wait: bool, auto: bool, check: bool, allow_destructive_operations: bool, template: Optional[str]
200
+ ctx: click.Context,
201
+ wait: bool,
202
+ auto: bool,
203
+ check: bool,
204
+ allow_destructive_operations: bool,
205
+ template: Optional[str],
206
+ verbose: bool,
194
207
  ) -> None:
195
208
  """
196
209
  Validate and deploy the project server side.
197
210
  """
198
- create_deployment_cmd(ctx, wait, auto, check, allow_destructive_operations, template)
211
+ create_deployment_cmd(ctx, wait, auto, check, allow_destructive_operations, template, verbose)
199
212
 
200
213
 
201
214
  @deployment_group.command(name="ls")
@@ -337,14 +350,27 @@ def deployment_discard(ctx: click.Context, wait: bool) -> None:
337
350
  default=None,
338
351
  help="URL of the template to use for the deployment. Example: https://github.com/tinybirdco/web-analytics-starter-kit/tree/main/tinybird",
339
352
  )
353
+ @click.option(
354
+ "-v",
355
+ "--verbose",
356
+ is_flag=True,
357
+ default=False,
358
+ help="Show verbose output. Disabled by default.",
359
+ )
340
360
  @click.pass_context
341
361
  def deploy(
342
- ctx: click.Context, wait: bool, auto: bool, check: bool, allow_destructive_operations: bool, template: Optional[str]
362
+ ctx: click.Context,
363
+ wait: bool,
364
+ auto: bool,
365
+ check: bool,
366
+ allow_destructive_operations: bool,
367
+ template: Optional[str],
368
+ verbose: bool,
343
369
  ) -> None:
344
370
  """
345
371
  Deploy the project.
346
372
  """
347
- create_deployment_cmd(ctx, wait, auto, check, allow_destructive_operations, template)
373
+ create_deployment_cmd(ctx, wait, auto, check, allow_destructive_operations, template, verbose)
348
374
 
349
375
 
350
376
  def create_deployment_cmd(
@@ -354,6 +380,7 @@ def create_deployment_cmd(
354
380
  check: Optional[bool] = None,
355
381
  allow_destructive_operations: Optional[bool] = None,
356
382
  template: Optional[str] = None,
383
+ verbose: bool = False,
357
384
  ) -> None:
358
385
  project: Project = ctx.ensure_object(dict)["project"]
359
386
  if template:
@@ -378,4 +405,4 @@ def create_deployment_cmd(
378
405
  click.echo(FeedbackManager.success(message="Template downloaded successfully"))
379
406
  client = ctx.ensure_object(dict)["client"]
380
407
  config: Dict[str, Any] = ctx.ensure_object(dict)["config"]
381
- create_deployment(project, client, config, wait, auto, check, allow_destructive_operations)
408
+ create_deployment(project, client, config, wait, auto, verbose, check, allow_destructive_operations)
@@ -194,6 +194,7 @@ def create_deployment(
194
194
  config: Dict[str, Any],
195
195
  wait: bool,
196
196
  auto: bool,
197
+ verbose: bool = False,
197
198
  check: Optional[bool] = None,
198
199
  allow_destructive_operations: Optional[bool] = None,
199
200
  ) -> None:
@@ -247,9 +248,12 @@ def create_deployment(
247
248
  if f.get("level", "").upper() == "ERROR":
248
249
  feedback_func = FeedbackManager.error
249
250
  feedback_icon = ""
250
- else:
251
+ elif f.get("level", "").upper() == "WARNING":
251
252
  feedback_func = FeedbackManager.warning
252
253
  feedback_icon = "△ "
254
+ elif verbose and f.get("level", "").upper() == "INFO":
255
+ feedback_func = FeedbackManager.info
256
+ feedback_icon = ""
253
257
  resource = f.get("resource")
254
258
  resource_bit = f"{resource}: " if resource else ""
255
259
  click.echo(feedback_func(message=f"{feedback_icon}{f.get('level')}: {resource_bit}{f.get('message')}"))
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: tinybird
3
- Version: 0.0.1.dev261
3
+ Version: 0.0.1.dev262
4
4
  Summary: Tinybird Command Line Tool
5
5
  Home-page: https://www.tinybird.co/docs/forward/commands
6
6
  Author: Tinybird
@@ -5,7 +5,7 @@ tinybird/feedback_manager.py,sha256=1INQFfRfuMCb9lfB8KNf4r6qC2khW568hoHjtk-wshI,
5
5
  tinybird/git_settings.py,sha256=Sw_8rGmribEFJ4Z_6idrVytxpFYk7ez8ei0qHULzs3E,3934
6
6
  tinybird/prompts.py,sha256=HoDv9TxPiP8v2XoGTWYxP133dK9CEbXVv4XE5IT339c,45483
7
7
  tinybird/sql.py,sha256=BufnOgclQokDyihtuXesOwHBsebN6wRXIxO5wKRkOwE,48299
8
- tinybird/sql_template.py,sha256=AezE1o6_BzbHFi0J9OIqTrXQ5WvoX5eNVq4QCbFjGcs,100338
8
+ tinybird/sql_template.py,sha256=OTsBBtGnVL4oUrEEFK19Mi5GHm-BP7v-zViXfPvYqJs,100774
9
9
  tinybird/sql_template_fmt.py,sha256=KUHdj5rYCYm_rKKdXYSJAE9vIyXUQLB0YSZnUXHeBlY,10196
10
10
  tinybird/sql_toolset.py,sha256=19WPr4S3SR--Iw-VPgmDnLmhOZyHhTxnj3-_Yq3OgEU,19767
11
11
  tinybird/syncasync.py,sha256=IPnOx6lMbf9SNddN1eBtssg8vCLHMt76SuZ6YNYm-Yk,27761
@@ -17,7 +17,7 @@ tinybird/datafile/exceptions.py,sha256=8rw2umdZjtby85QbuRKFO5ETz_eRHwUY5l7eHsy1w
17
17
  tinybird/datafile/parse_connection.py,sha256=tRyn2Rpr1TeWet5BXmMoQgaotbGdYep1qiTak_OqC5E,1825
18
18
  tinybird/datafile/parse_datasource.py,sha256=ssW8QeFSgglVFi3sDZj_HgkJiTJ2069v2JgqnH3CkDE,1825
19
19
  tinybird/datafile/parse_pipe.py,sha256=xf4m0Tw44QWJzHzAm7Z7FwUoUUtr7noMYjU1NiWnX0k,3880
20
- tinybird/tb/__cli__.py,sha256=BEE_KvpSGXwAuGW52ybkT6HEEg736Uvf4PF1IWfSQ2Y,247
20
+ tinybird/tb/__cli__.py,sha256=0prVU9s5VBR_0ep0okT2MF0GMOH7JG72BdEplvxz_Mg,247
21
21
  tinybird/tb/check_pypi.py,sha256=Gp0HkHHDFMSDL6nxKlOY51z7z1Uv-2LRexNTZSHHGmM,552
22
22
  tinybird/tb/cli.py,sha256=FdDFEIayjmsZEVsVSSvRiVYn_FHOVg_zWQzchnzfWho,1008
23
23
  tinybird/tb/client.py,sha256=pJbdkWMXGAqKseNAvdsRRnl_c7I-DCMB0dWCQnG82nU,54146
@@ -32,8 +32,8 @@ tinybird/tb/modules/connection.py,sha256=-MY56NUAai6EMC4-wpi7bT0_nz_SA8QzTmHkV7H
32
32
  tinybird/tb/modules/copy.py,sha256=dPZkcIDvxjJrlQUIvToO0vsEEEs4EYumbNV77-BzNoU,4404
33
33
  tinybird/tb/modules/create.py,sha256=pJxHXG69c9Z_21s-7VuJ3RZOF_nJU51LEwiAkvI3dZY,23251
34
34
  tinybird/tb/modules/datasource.py,sha256=cxq0VVjjidxq-v_JSIIAH7L90XNRctgNKsHRoQ_42OI,41632
35
- tinybird/tb/modules/deployment.py,sha256=c-iYgq9dgVsa3m3Oqn24CT3A1omw-p4nfVnUiUynatw,12795
36
- tinybird/tb/modules/deployment_common.py,sha256=Y0r3g-3d6AcihsVVa0OHer3ow3xHSV1VPskF1eI03KI,17644
35
+ tinybird/tb/modules/deployment.py,sha256=EDEVOqFk5fp0fvvs2jV0mT5POFd-i_8uZIUREwzAbEk,13199
36
+ tinybird/tb/modules/deployment_common.py,sha256=CswUMfp5dW0NgiuP_ZGORqvqooHFYU2ZJaxOcpRFDT0,17866
37
37
  tinybird/tb/modules/deprecations.py,sha256=rrszC1f_JJeJ8mUxGoCxckQTJFBCR8wREf4XXXN-PRc,4507
38
38
  tinybird/tb/modules/dev_server.py,sha256=57FCKuWpErwYUYgHspYDkLWEm9F4pbvVOtMrFXX1fVU,10129
39
39
  tinybird/tb/modules/endpoint.py,sha256=ksRj6mfDb9Xv63PhTkV_uKSosgysHElqagg3RTt21Do,11958
@@ -113,8 +113,8 @@ tinybird/tb_cli_modules/config.py,sha256=IsgdtFRnUrkY8-Zo32lmk6O7u3bHie1QCxLwgp4
113
113
  tinybird/tb_cli_modules/exceptions.py,sha256=pmucP4kTF4irIt7dXiG-FcnI-o3mvDusPmch1L8RCWk,3367
114
114
  tinybird/tb_cli_modules/regions.py,sha256=QjsL5H6Kg-qr0aYVLrvb1STeJ5Sx_sjvbOYO0LrEGMk,166
115
115
  tinybird/tb_cli_modules/telemetry.py,sha256=Hh2Io8ZPROSunbOLuMvuIFU4TqwWPmQTqal4WS09K1A,10449
116
- tinybird-0.0.1.dev261.dist-info/METADATA,sha256=UT0T98Tzjn1lyMQBycvZ9wJabGCNuawuklpyVQpoIhQ,1733
117
- tinybird-0.0.1.dev261.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
118
- tinybird-0.0.1.dev261.dist-info/entry_points.txt,sha256=LwdHU6TfKx4Qs7BqqtaczEZbImgU7Abe9Lp920zb_fo,43
119
- tinybird-0.0.1.dev261.dist-info/top_level.txt,sha256=VqqqEmkAy7UNaD8-V51FCoMMWXjLUlR0IstvK7tJYVY,54
120
- tinybird-0.0.1.dev261.dist-info/RECORD,,
116
+ tinybird-0.0.1.dev262.dist-info/METADATA,sha256=1iT43WWQIeJ-m391cjSMdLIL5aHzrSHDXlIs1us6bfM,1733
117
+ tinybird-0.0.1.dev262.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
118
+ tinybird-0.0.1.dev262.dist-info/entry_points.txt,sha256=LwdHU6TfKx4Qs7BqqtaczEZbImgU7Abe9Lp920zb_fo,43
119
+ tinybird-0.0.1.dev262.dist-info/top_level.txt,sha256=VqqqEmkAy7UNaD8-V51FCoMMWXjLUlR0IstvK7tJYVY,54
120
+ tinybird-0.0.1.dev262.dist-info/RECORD,,