tinybird 0.0.1.dev86__py3-none-any.whl → 0.0.1.dev87__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
@@ -1452,6 +1452,13 @@ def generate(self, **kwargs) -> Tuple[str, TemplateExecutionResults]:
1452
1452
  template_execution_results["activate"] = feature
1453
1453
  return Expression(f"-- activate {feature}\n")
1454
1454
 
1455
+ def set_disable_feature(feature):
1456
+ valid_features = "analyzer"
1457
+ if feature not in valid_features:
1458
+ raise SQLTemplateException(f"'{feature}' is not a valid 'disable' argument")
1459
+ template_execution_results["disable"] = feature
1460
+ return Expression(f"-- disable {feature}\n")
1461
+
1455
1462
  namespace.update(_namespace)
1456
1463
  namespace.update(kwargs)
1457
1464
  namespace.update(
@@ -1466,6 +1473,7 @@ def generate(self, **kwargs) -> Tuple[str, TemplateExecutionResults]:
1466
1473
  "backend_hint": set_backend_hint,
1467
1474
  "cache_ttl": set_cache_ttl,
1468
1475
  "activate": set_activate,
1476
+ "disable": set_disable_feature,
1469
1477
  }
1470
1478
  )
1471
1479
 
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.dev86'
8
- __revision__ = '125dbec'
7
+ __version__ = '0.0.1.dev87'
8
+ __revision__ = '029c262'
@@ -57,6 +57,7 @@ def build_project(project: Project, tb_client: TinyB, file_changed: Optional[str
57
57
  DATAFILE_TYPE_TO_CONTENT_TYPE = {
58
58
  ".datasource": "text/plain",
59
59
  ".pipe": "text/plain",
60
+ ".connection": "text/plain",
60
61
  }
61
62
  TINYBIRD_API_URL = tb_client.host + "/v1/build"
62
63
  logging.debug(TINYBIRD_API_URL)
@@ -79,7 +79,6 @@ class CLIConfig:
79
79
  _projects: Dict[str, "CLIConfig"] = {}
80
80
 
81
81
  def __init__(self, path: Optional[str] = None) -> None:
82
- self.cwd = os.getcwd()
83
82
  self._path = path or self.get_tinyb_file() or os.path.join(os.getcwd(), ".tinyb")
84
83
  self._values: Dict[str, ConfigValue] = {}
85
84
  self._values["version"] = ConfigValue("version", CURRENT_VERSION, ConfigValueOrigin.DEFAULT)
@@ -51,6 +51,9 @@ async def create(
51
51
  config.persist_to_file()
52
52
  project.folder = folder
53
53
 
54
+ if cwd := config.get("cwd"):
55
+ click.echo(FeedbackManager.gray(message=f"Using '{cwd.replace(os.getcwd(), '')}' as target folder"))
56
+
54
57
  root_folder = os.getcwd()
55
58
  if config._path:
56
59
  root_folder = os.path.dirname(config._path)
@@ -168,14 +168,18 @@ class UnkownExtensionerror(Exception): ...
168
168
  class DatafileKind(Enum):
169
169
  pipe = "pipe"
170
170
  datasource = "datasource"
171
+ connection = "connection"
171
172
 
172
173
  @classmethod
173
174
  def from_extension(cls, extension: str) -> DatafileKind:
174
- if extension == ".pipe":
175
- return cls.pipe
176
- elif extension == ".datasource":
177
- return cls.datasource
178
- raise UnkownExtensionerror(f"Unknown extension {extension} for data file")
175
+ extension_map = {
176
+ ".pipe": cls.pipe,
177
+ ".datasource": cls.datasource,
178
+ ".connection": cls.connection,
179
+ }
180
+ if extension not in extension_map:
181
+ raise UnkownExtensionerror(f"Unknown extension {extension} for data file")
182
+ return extension_map[extension]
179
183
 
180
184
 
181
185
  class Datafile:
@@ -1099,9 +1103,7 @@ def parse(
1099
1103
  ) -> Datafile:
1100
1104
  """
1101
1105
  Parses `s` string into a document
1102
- >>> d = parse("MAINTAINER 'rambo' #this is me\\nNODE \\"test_01\\"\\n DESCRIPTION this is a node that does whatever\\nSQL >\\n\\n SELECT * from test_00\\n\\n\\nNODE \\"test_02\\"\\n DESCRIPTION this is a node that does whatever\\nSQL >\\n\\n SELECT * from test_01\\n WHERE a > 1\\n GROUP by a\\n")
1103
- >>> d.maintainer
1104
- 'rambo'
1106
+ >>> d = parse("NODE \\"test_01\\"\\n DESCRIPTION this is a node that does whatever\\nSQL >\\n\\n SELECT * from test_00\\n\\n\\nNODE \\"test_02\\"\\n DESCRIPTION this is a node that does whatever\\nSQL >\\n\\n SELECT * from test_01\\n WHERE a > 1\\n GROUP by a\\n")
1105
1107
  >>> len(d.nodes)
1106
1108
  2
1107
1109
  >>> d.nodes[0]
@@ -1377,7 +1379,6 @@ def parse(
1377
1379
 
1378
1380
  cmds = {
1379
1381
  "source": sources,
1380
- "maintainer": assign("maintainer"),
1381
1382
  "schema": schema,
1382
1383
  "indexes": indexes,
1383
1384
  "engine": set_engine,
@@ -1417,6 +1418,7 @@ def parse(
1417
1418
  "kafka_store_binary_headers": assign_var("kafka_store_binary_headers"),
1418
1419
  "kafka_key_avro_deserialization": assign_var("kafka_key_avro_deserialization"),
1419
1420
  "kafka_ssl_ca_pem": assign_var("kafka_ssl_ca_pem"),
1421
+ "kafka_security_protocol": assign_var("kafka_security_protocol"),
1420
1422
  "kafka_sasl_mechanism": assign_var("kafka_sasl_mechanism"),
1421
1423
  "import_service": assign_var("import_service"),
1422
1424
  "import_connection_name": assign_var("import_connection_name"),
@@ -324,6 +324,7 @@ def create_deployment(
324
324
  DATAFILE_TYPE_TO_CONTENT_TYPE = {
325
325
  ".datasource": "text/plain",
326
326
  ".pipe": "text/plain",
327
+ ".connection": "text/plain",
327
328
  }
328
329
  project: Project = ctx.ensure_object(dict)["project"]
329
330
  client = ctx.ensure_object(dict)["client"]
@@ -9,7 +9,7 @@ from tinybird.tb.modules.datafile.parse_pipe import parse_pipe
9
9
 
10
10
 
11
11
  class Project:
12
- extensions = ("datasource", "pipe")
12
+ extensions = ("datasource", "pipe", "connection")
13
13
 
14
14
  def __init__(self, folder: str):
15
15
  self.folder = folder
@@ -1042,6 +1042,7 @@ VALID_FUNCTION_NAMES = {
1042
1042
  "custom_error",
1043
1043
  "backend_hint",
1044
1044
  "activate",
1045
+ "disable",
1045
1046
  "sql_unescape",
1046
1047
  "max_threads",
1047
1048
  "tb_secret",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: tinybird
3
- Version: 0.0.1.dev86
3
+ Version: 0.0.1.dev87
4
4
  Summary: Tinybird Command Line Tool
5
5
  Home-page: https://www.tinybird.co/docs/cli/introduction.html
6
6
  Author: Tinybird
@@ -8,25 +8,25 @@ tinybird/feedback_manager.py,sha256=YSjtFDJvc8y66j2J0iIkb3SVzDdYAJbzFL-JPQ26pak,
8
8
  tinybird/git_settings.py,sha256=Sw_8rGmribEFJ4Z_6idrVytxpFYk7ez8ei0qHULzs3E,3934
9
9
  tinybird/prompts.py,sha256=rDIrkK5S1NJ0bIFjULsCYnGApv9Vc0jmR4tdRuJhM8c,32953
10
10
  tinybird/sql.py,sha256=LBi74GxhNAYTb6m2-KNGpAkguSKh7rcvBbERbE7nalA,46195
11
- tinybird/sql_template.py,sha256=hHz-EbHWlWVMS4e6hTpoieJ1qRAzzZLDq9-fnjT60dw,95732
11
+ tinybird/sql_template.py,sha256=1qO6FaEe9rdLAKIORZsNk53XklLeP6oLnMhlw0PBUcI,96091
12
12
  tinybird/sql_template_fmt.py,sha256=KUHdj5rYCYm_rKKdXYSJAE9vIyXUQLB0YSZnUXHeBlY,10196
13
13
  tinybird/sql_toolset.py,sha256=32SNvxRFKQYWTvYPMJ_u3ukcd1hKZyEqx8T2cv2412w,14697
14
14
  tinybird/syncasync.py,sha256=IPnOx6lMbf9SNddN1eBtssg8vCLHMt76SuZ6YNYm-Yk,27761
15
- tinybird/tornado_template.py,sha256=KmW_VD7y-NVqrc8YZKwIaxoJB0XpCcB2izdmxmtmApM,41944
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=AUAww-KjGOZg9h0IBlKA3FeacJYB4rOtqcTGJhFM-g8,40392
18
- tinybird/tb/__cli__.py,sha256=g7_DbCeC7bCOKoEiJkKaQ89W0974t4itgPG1YR0nK8k,251
18
+ tinybird/tb/__cli__.py,sha256=LqvlRqPpw46Nvopi4aHBuiUk4LaKNklSwNZJhp6LJWs,251
19
19
  tinybird/tb/cli.py,sha256=qon0Lim-v5hHWWRW7TXaOoGo3p2kc5Xwgg3feI4mbMQ,998
20
20
  tinybird/tb/modules/auth.py,sha256=L1IatO2arRSzys3t8px8xVt8uPWUL5EVD0sFzAV_uVU,9022
21
- tinybird/tb/modules/build.py,sha256=46ZTxubughaq8QDV6yq9thatSVVY4yNqyzbfxRBcgDA,10446
21
+ tinybird/tb/modules/build.py,sha256=-lRGBxKtuipmyl3pmiGcfp67fH1Ed-COfHAZKdgLIWo,10483
22
22
  tinybird/tb/modules/cicd.py,sha256=T0lb9u_bDdTUVe8TwNNb1qQ5KnSPHMVjqPfKF4BBNBw,5347
23
23
  tinybird/tb/modules/cli.py,sha256=rE-0PtttuXvigKP1BkdgolP833pEhe-daK6l86bnaEw,16468
24
24
  tinybird/tb/modules/common.py,sha256=f5yKjb1dgUzR-SrC4UHnpHXYIu6INcTHwNO96jW8A9w,73201
25
- tinybird/tb/modules/config.py,sha256=wIsoIf2yMCT2JQ5f6nZr-WzB7Uuah9EqXf6Glxe_p-Q,11353
25
+ tinybird/tb/modules/config.py,sha256=RWDrhH1OM9OWMixOyQfM6RVLBLb7Ul2Ar1tR8K46tOs,11322
26
26
  tinybird/tb/modules/copy.py,sha256=MAVqKip8_QhOYq99U_XuqSO6hCLJEh5sFtbhcXtI3SI,5802
27
- tinybird/tb/modules/create.py,sha256=EAPI-ZsY4Nr_FBehUMpM4y1HZRoWLgdtHQtb71WnauE,13137
27
+ tinybird/tb/modules/create.py,sha256=KjotVfIQLfcPyQBykTHnPLn4ikrm6qqeMcbRE1d-6Jo,13280
28
28
  tinybird/tb/modules/datasource.py,sha256=dNCK9iCR2xPLfwqqwg2ixyE6NuoVEiJU2mBZBmOYrVY,16906
29
- tinybird/tb/modules/deployment.py,sha256=LzxOWjI9hSIXbNxR0BmQfXWBUHhVX2LoZUeChkcmg6c,17528
29
+ tinybird/tb/modules/deployment.py,sha256=XAVt6a_vtH8sJ99Z9Ht1q5_ni7AFPRSeidfgfuJtqLw,17565
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
@@ -42,7 +42,7 @@ tinybird/tb/modules/materialization.py,sha256=r8Q9HXcYEmfrEzP4WpiasCKDJdSkTPaAKJ
42
42
  tinybird/tb/modules/mock.py,sha256=3q4i6CXKcS-zsgevbN_zpAP4AnB9_WIVxmVSJV3FNPQ,3881
43
43
  tinybird/tb/modules/pipe.py,sha256=gcLz0qHgwKDLsWFY3yFLO9a0ETAV1dFbI8YeLHi9460,2429
44
44
  tinybird/tb/modules/playground.py,sha256=CQaz2JqFDdReK2fJY1yZsSwiSY24_jeTb9PKw1WUigA,4848
45
- tinybird/tb/modules/project.py,sha256=vxNEsc5gIQJM7ybXklnT7wna2M-GfbUybj4nKckrZM8,2949
45
+ tinybird/tb/modules/project.py,sha256=ei0TIAuRksdV2g2FJqByuV4DPyivQGrZ42z_eQDNBgI,2963
46
46
  tinybird/tb/modules/regions.py,sha256=QjsL5H6Kg-qr0aYVLrvb1STeJ5Sx_sjvbOYO0LrEGMk,166
47
47
  tinybird/tb/modules/shell.py,sha256=a98W4L4gfrmxEyybtu6S4ENXrBYtgNASB5e_evuXQvI,13936
48
48
  tinybird/tb/modules/table.py,sha256=4XrtjM-N0zfNtxVkbvLDQQazno1EPXnxTyo7llivfXk,11035
@@ -57,7 +57,7 @@ tinybird/tb/modules/datafile/build.py,sha256=seGFSvmgyRrAM1-icsKBkuog3WccfGUYFTP
57
57
  tinybird/tb/modules/datafile/build_common.py,sha256=rT7VJ5mnQ68R_8US91DAtkusfvjWuG_NObOzNgtN_ko,4562
58
58
  tinybird/tb/modules/datafile/build_datasource.py,sha256=VjxaKKLZhPYt3XHOyMmfoqEAWAPI5D78T-8FOaN77MY,17355
59
59
  tinybird/tb/modules/datafile/build_pipe.py,sha256=Tf49kZmXub45qGcePFfqGO7p-FH5eYM46DtVI3AQJEc,11358
60
- tinybird/tb/modules/datafile/common.py,sha256=QhlQkYW5xLNEz_yZmMz1Dl8cnWG274Wu7QHVOIPcooM,79993
60
+ tinybird/tb/modules/datafile/common.py,sha256=J9hXDdi27Quc0AkzoS2ChlEYwDBDePcW2sZ1qruZKdY,80091
61
61
  tinybird/tb/modules/datafile/diff.py,sha256=-0J7PsBO64T7LOZSkZ4ZFHHCPvT7cKItnJkbz2PkndU,6754
62
62
  tinybird/tb/modules/datafile/exceptions.py,sha256=8rw2umdZjtby85QbuRKFO5ETz_eRHwUY5l7eHsy1wnI,556
63
63
  tinybird/tb/modules/datafile/fixture.py,sha256=si-9LB-LdKQSWDtVW82xDrHtFfko5bgBG1cvjqqrcPU,1064
@@ -77,8 +77,8 @@ tinybird/tb_cli_modules/config.py,sha256=IsgdtFRnUrkY8-Zo32lmk6O7u3bHie1QCxLwgp4
77
77
  tinybird/tb_cli_modules/exceptions.py,sha256=pmucP4kTF4irIt7dXiG-FcnI-o3mvDusPmch1L8RCWk,3367
78
78
  tinybird/tb_cli_modules/regions.py,sha256=QjsL5H6Kg-qr0aYVLrvb1STeJ5Sx_sjvbOYO0LrEGMk,166
79
79
  tinybird/tb_cli_modules/telemetry.py,sha256=Hh2Io8ZPROSunbOLuMvuIFU4TqwWPmQTqal4WS09K1A,10449
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,,
80
+ tinybird-0.0.1.dev87.dist-info/METADATA,sha256=B58e0OeSZ-M9Z70rKj58zzouvl9WpGwl7pQy9tvjzyg,2585
81
+ tinybird-0.0.1.dev87.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
82
+ tinybird-0.0.1.dev87.dist-info/entry_points.txt,sha256=LwdHU6TfKx4Qs7BqqtaczEZbImgU7Abe9Lp920zb_fo,43
83
+ tinybird-0.0.1.dev87.dist-info/top_level.txt,sha256=VqqqEmkAy7UNaD8-V51FCoMMWXjLUlR0IstvK7tJYVY,54
84
+ tinybird-0.0.1.dev87.dist-info/RECORD,,