tinybird 0.0.1.dev202__py3-none-any.whl → 0.0.1.dev203__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
@@ -2018,6 +2018,7 @@ def render_sql_template(
2018
2018
  test_mode: bool = False,
2019
2019
  name: Optional[str] = None,
2020
2020
  local_variables: Optional[dict] = None,
2021
+ secrets_in_test_mode: Optional[bool] = True,
2021
2022
  ) -> Tuple[str, TemplateExecutionResults, list]:
2022
2023
  """
2023
2024
  >>> render_sql_template("select * from table where f = {{Float32(foo)}}", { 'foo': -1 })
@@ -2300,7 +2301,7 @@ def render_sql_template(
2300
2301
  if secrets:
2301
2302
  v.update({"tb_secrets": secrets})
2302
2303
 
2303
- if is_tb_secret:
2304
+ if is_tb_secret and secrets_in_test_mode:
2304
2305
  v.update({TB_SECRET_IN_TEST_MODE: None})
2305
2306
 
2306
2307
  v.update(type_fns_check)
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.dev202'
8
- __revision__ = '63a6016'
7
+ __version__ = '0.0.1.dev203'
8
+ __revision__ = 'c2f7de3'
tinybird/tb/check_pypi.py CHANGED
@@ -2,10 +2,8 @@ from typing import Optional
2
2
 
3
3
  import requests
4
4
 
5
- from tinybird.feedback_manager import FeedbackManager
6
5
  from tinybird.syncasync import sync_to_async
7
6
  from tinybird.tb.modules.common import getenv_bool
8
- from tinybird.tb.modules.exceptions import CLIException
9
7
 
10
8
  PYPY_URL = "https://pypi.org/pypi/tinybird/json"
11
9
  requests_get = sync_to_async(requests.get, thread_sensitive=False)
@@ -18,9 +16,9 @@ class CheckPypi:
18
16
  disable_ssl: bool = getenv_bool("TB_DISABLE_SSL_CHECKS", False)
19
17
  response: requests.Response = await requests_get(PYPY_URL, verify=not disable_ssl)
20
18
  if response.status_code != 200:
21
- raise CLIException(FeedbackManager.error_exception(error=response.content.decode("utf-8")))
19
+ return None
22
20
  version = response.json()["info"]["version"]
23
- except Exception as e:
24
- raise CLIException(FeedbackManager.error_exception(error=str(e)))
21
+ except Exception:
22
+ return None
25
23
 
26
24
  return version
@@ -110,19 +110,20 @@ async def cli(
110
110
 
111
111
  if not environ.get("PYTEST", None) and version_warning and not token:
112
112
  latest_version = await CheckPypi().get_latest_version()
113
+ if latest_version:
114
+ if "x.y.z" in CURRENT_VERSION:
115
+ click.echo(FeedbackManager.warning_development_cli())
113
116
 
114
- if "x.y.z" in CURRENT_VERSION:
115
- click.echo(FeedbackManager.warning_development_cli())
116
-
117
- if "x.y.z" not in CURRENT_VERSION and latest_version != CURRENT_VERSION:
118
- click.echo(
119
- FeedbackManager.warning(message=f"** New version available. {CURRENT_VERSION} -> {latest_version}")
120
- )
121
- click.echo(
122
- FeedbackManager.warning(
123
- message="** Run `tb update` to update or `export TB_VERSION_WARNING=0` to skip the check.\n"
117
+ if "x.y.z" not in CURRENT_VERSION and latest_version != CURRENT_VERSION:
118
+ click.echo(
119
+ FeedbackManager.warning(message=f"** New version available. {CURRENT_VERSION} -> {latest_version}")
124
120
  )
125
- )
121
+ click.echo(
122
+ FeedbackManager.warning(
123
+ message="** Run `tb update` to update or `export TB_VERSION_WARNING=0` to skip the check.\n"
124
+ )
125
+ )
126
+
126
127
  if debug:
127
128
  logging.basicConfig(level=logging.DEBUG)
128
129
 
@@ -52,10 +52,13 @@ def parse_pipe(
52
52
  node["type"] = node["type"].lower()
53
53
  sql = node.get("sql", "")
54
54
  if sql.strip()[0] == "%":
55
- # Note(eclbg): not sure what test_mode is for. I think it does something like using placeholder values
56
- # for the variables in the template.
55
+ # Setting test_mode=True to ignore errors on required parameters
57
56
  sql, _, variable_warnings = render_sql_template(
58
- sql[1:], test_mode=True, name=node["name"], secrets=list(secrets.keys()) if secrets else None
57
+ sql[1:],
58
+ name=node["name"],
59
+ secrets=list(secrets.keys()) if secrets else None,
60
+ test_mode=True,
61
+ secrets_in_test_mode=False,
59
62
  )
60
63
  doc.warnings = variable_warnings
61
64
  # it'll fail with a ModuleNotFoundError when the toolset is not available but it returns the parsed doc
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: tinybird
3
- Version: 0.0.1.dev202
3
+ Version: 0.0.1.dev203
4
4
  Summary: Tinybird Command Line Tool
5
5
  Home-page: https://www.tinybird.co/docs/forward/commands
6
6
  Author: Tinybird
@@ -5,21 +5,21 @@ tinybird/feedback_manager.py,sha256=1INQFfRfuMCb9lfB8KNf4r6qC2khW568hoHjtk-wshI,
5
5
  tinybird/git_settings.py,sha256=Sw_8rGmribEFJ4Z_6idrVytxpFYk7ez8ei0qHULzs3E,3934
6
6
  tinybird/prompts.py,sha256=rpgvMpR103niDnoDMSz8hRAYBdgfrorfD5-7g23BMQQ,37596
7
7
  tinybird/sql.py,sha256=C_B81wwv3BsqyXGhF5oTk9DcTUkrp7NwIFqSzd3Dmjc,47854
8
- tinybird/sql_template.py,sha256=hWW8JawSWLl9GeWPYkC_Yrxj7P0MHEVMJ0Px9bedEgM,99817
8
+ tinybird/sql_template.py,sha256=ZFW9-wfDrRlLxmOgrgynMG_gkfN9MR8zpGmXB52s0_4,99891
9
9
  tinybird/sql_template_fmt.py,sha256=KUHdj5rYCYm_rKKdXYSJAE9vIyXUQLB0YSZnUXHeBlY,10196
10
10
  tinybird/sql_toolset.py,sha256=M2rpLYkgV2W8NnYEYPC1tJdpy4uZHXVF64NBSKLQka4,19549
11
11
  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=X4tE9OrfaUy6kO9cqVEzyI9cDcmOF3IAssRRzsTsfEQ,40781
15
- tinybird/tb/__cli__.py,sha256=RoHTMy_eFgLfOsfLrQ7GJrLxsOdAManctqTsut70TNI,247
16
- tinybird/tb/check_pypi.py,sha256=rW4QmDRbtgKdUUwJCnBkVjmTjZSZGN-XgZhx7vMkC0w,1009
15
+ tinybird/tb/__cli__.py,sha256=CTFVbi0hSbynX2AhNHDVrqTnGAyLvvzZoGZt4zGHUy0,247
16
+ tinybird/tb/check_pypi.py,sha256=i3l2L8IajeB7sreikR7oPlYJki9MtS3c_M4crnmbByc,760
17
17
  tinybird/tb/cli.py,sha256=u3eGOhX0MHkuT6tiwaZ0_3twqLmqKXDAOxF7yV_Nn9Q,1075
18
18
  tinybird/tb/client.py,sha256=CO-dQw8h28X6T6IO-Z79yPBKaJQT1Rwya5b6gexvw58,56491
19
19
  tinybird/tb/config.py,sha256=jT9xndpeCY_g0HdB5qE2EquC0TFRRnkPnQFWZWd04jo,3998
20
20
  tinybird/tb/modules/build.py,sha256=96J_n8IWYPLN0JORPb6QXgT4-3JXw4JSXmAtzQcqN7E,19951
21
21
  tinybird/tb/modules/cicd.py,sha256=Njb6eZOHHbUkoJJx6KoixO9PsfA_T-3Ybkya9-50Ca8,7328
22
- tinybird/tb/modules/cli.py,sha256=qmD1tNoPXxpDuTD_Vu4YIR9egc3m1eS0NIhaQzacOYo,15605
22
+ tinybird/tb/modules/cli.py,sha256=k6Bp-lWC-ruMMB47lxwsinLQt4qJL_n84hjyxi9JYt4,15676
23
23
  tinybird/tb/modules/common.py,sha256=R675BLZTnPlCoPphCTcy3S1lsf1MF_H3U_ox9yPNCqg,84187
24
24
  tinybird/tb/modules/config.py,sha256=ziqW_t_mRVvWOd85VoB4vKyvgMkEfpXDf9H4v38p2xc,11422
25
25
  tinybird/tb/modules/connection.py,sha256=FJZHTAR6sf5VbPIotxbyMgO-6UCCbnsKj6I0EjeCa-g,17791
@@ -68,7 +68,7 @@ tinybird/tb/modules/datafile/format_common.py,sha256=1V1ZQuphp8EH2hT-IfZQEgz_0b9
68
68
  tinybird/tb/modules/datafile/format_datasource.py,sha256=iWbeXruxC7OBmjNgurWt6ymcJlYzxfKwkGnhpcoSKEo,6190
69
69
  tinybird/tb/modules/datafile/format_pipe.py,sha256=DUGdmlzI146YDqTwW-7kSIOXocz4AH-md_LFGUm9hrc,7436
70
70
  tinybird/tb/modules/datafile/parse_datasource.py,sha256=jposrAHVebgDTzlr2rzSooj05NX7jJQc8P3xvHdUiek,1847
71
- tinybird/tb/modules/datafile/parse_pipe.py,sha256=MScEFqte8A__Uc7GAUCNddpdQ-e9cETLZGwQUhAZPxY,3618
71
+ tinybird/tb/modules/datafile/parse_pipe.py,sha256=4k99-mIJK14w0E8cBU-jQ6BjFOtUaOKsAg5Rb-hK1eA,3636
72
72
  tinybird/tb/modules/datafile/pipe_checker.py,sha256=xv7vyjN5dPc2hcw9RnLBq2VkR4nte-8bhYDT10qceQY,24620
73
73
  tinybird/tb/modules/datafile/playground.py,sha256=f2b3QCF_En116XV4QzEoriHroatQKHjQ8v0GoJn8bFY,56639
74
74
  tinybird/tb/modules/datafile/pull.py,sha256=CP6-TVZ9ErrEOAFajn9HSEdq-GgYnOPHEIUAuReQGaM,4508
@@ -80,8 +80,8 @@ tinybird/tb_cli_modules/config.py,sha256=IsgdtFRnUrkY8-Zo32lmk6O7u3bHie1QCxLwgp4
80
80
  tinybird/tb_cli_modules/exceptions.py,sha256=pmucP4kTF4irIt7dXiG-FcnI-o3mvDusPmch1L8RCWk,3367
81
81
  tinybird/tb_cli_modules/regions.py,sha256=QjsL5H6Kg-qr0aYVLrvb1STeJ5Sx_sjvbOYO0LrEGMk,166
82
82
  tinybird/tb_cli_modules/telemetry.py,sha256=Hh2Io8ZPROSunbOLuMvuIFU4TqwWPmQTqal4WS09K1A,10449
83
- tinybird-0.0.1.dev202.dist-info/METADATA,sha256=tzzM6EJY5C0LWX2EB8Fqub-xCt0FWuNl2aLkJlXTfms,1682
84
- tinybird-0.0.1.dev202.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
85
- tinybird-0.0.1.dev202.dist-info/entry_points.txt,sha256=LwdHU6TfKx4Qs7BqqtaczEZbImgU7Abe9Lp920zb_fo,43
86
- tinybird-0.0.1.dev202.dist-info/top_level.txt,sha256=VqqqEmkAy7UNaD8-V51FCoMMWXjLUlR0IstvK7tJYVY,54
87
- tinybird-0.0.1.dev202.dist-info/RECORD,,
83
+ tinybird-0.0.1.dev203.dist-info/METADATA,sha256=6kEWBxEuvFX1-laxNAAB2oIT8C78OaoWXLVZWGMJHHU,1682
84
+ tinybird-0.0.1.dev203.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
85
+ tinybird-0.0.1.dev203.dist-info/entry_points.txt,sha256=LwdHU6TfKx4Qs7BqqtaczEZbImgU7Abe9Lp920zb_fo,43
86
+ tinybird-0.0.1.dev203.dist-info/top_level.txt,sha256=VqqqEmkAy7UNaD8-V51FCoMMWXjLUlR0IstvK7tJYVY,54
87
+ tinybird-0.0.1.dev203.dist-info/RECORD,,