tinybird 0.0.1.dev80__py3-none-any.whl → 0.0.1.dev81__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/client.py CHANGED
@@ -924,11 +924,12 @@ class TinyB:
924
924
  kafka_auto_offset_reset=None,
925
925
  kafka_schema_registry_url=None,
926
926
  kafka_sasl_mechanism="PLAIN",
927
+ kafka_security_protocol="SASL_SSL",
927
928
  kafka_ssl_ca_pem=None,
928
929
  ):
929
930
  params = {
930
931
  "service": "kafka",
931
- "kafka_security_protocol": "SASL_SSL",
932
+ "kafka_security_protocol": kafka_security_protocol,
932
933
  "kafka_sasl_mechanism": kafka_sasl_mechanism,
933
934
  "kafka_bootstrap_servers": kafka_bootstrap_servers,
934
935
  "kafka_sasl_plain_username": kafka_key,
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.dev80'
8
- __revision__ = 'f5f5948'
7
+ __version__ = '0.0.1.dev81'
8
+ __revision__ = 'd577324'
@@ -88,7 +88,6 @@ async def cli(
88
88
  logging.basicConfig(level=logging.DEBUG)
89
89
 
90
90
  config_temp = CLIConfig.get_project_config()
91
- project = Project(folder=config_temp.cwd)
92
91
 
93
92
  if token:
94
93
  config_temp.set_token(token)
@@ -132,6 +131,7 @@ async def cli(
132
131
  if client:
133
132
  ctx.ensure_object(dict)["client"] = client
134
133
 
134
+ project = Project(folder=config.get("cwd", os.getcwd()))
135
135
  ctx.ensure_object(dict)["project"] = project
136
136
  ctx.ensure_object(dict)["env"] = get_target_env(cloud, build)
137
137
 
@@ -146,9 +146,6 @@ class CLIConfig:
146
146
  values: Dict[str, Any] = json.loads(file.read())
147
147
  for k, v in values.items():
148
148
  self[k] = v
149
- if "cwd" in values:
150
- self.set_cwd(values["cwd"])
151
-
152
149
  return True
153
150
  except OSError:
154
151
  return False
@@ -212,7 +209,7 @@ class CLIConfig:
212
209
  self["host"] = f"{scheme}://{netloc}"
213
210
 
214
211
  def set_cwd(self, cwd: str) -> None:
215
- self.cwd = os.path.join(os.path.dirname(self._path) if self._path else os.getcwd(), cwd)
212
+ self["cwd"] = cwd
216
213
 
217
214
  def get_host(self, use_defaults_if_needed: bool = False) -> Optional[str]:
218
215
  result: Optional[str] = self.get("host", None)
@@ -1,7 +1,7 @@
1
1
  import os
2
2
  import re
3
3
  from pathlib import Path
4
- from typing import Optional
4
+ from typing import Optional, Tuple
5
5
 
6
6
  import click
7
7
 
@@ -64,7 +64,7 @@ async def create(
64
64
  try:
65
65
  tb_client = config.get_client()
66
66
  user_token: Optional[str] = None
67
- created = False
67
+ created_something = False
68
68
  if prompt:
69
69
  try:
70
70
  user_token = config.get_user_token()
@@ -83,11 +83,13 @@ async def create(
83
83
  click.echo(FeedbackManager.highlight(message="\n» Creating new project structure..."))
84
84
  create_project_structure(folder)
85
85
  click.echo(FeedbackManager.success(message="✓ Scaffolding completed!\n"))
86
- created = True
86
+ created_something = True
87
87
  result = ""
88
88
  if data or prompt:
89
89
  click.echo(FeedbackManager.highlight(message="\n» Creating resources..."))
90
- result = await create_resources(local_client, tb_client, user_token, data, prompt, folder)
90
+ result, created_something = await create_resources(
91
+ local_client, tb_client, user_token, data, prompt, folder
92
+ )
91
93
  click.echo(FeedbackManager.success(message="✓ Done!\n"))
92
94
 
93
95
  if not already_has_cicd(root_folder):
@@ -95,12 +97,14 @@ async def create(
95
97
  init_git(root_folder)
96
98
  await init_cicd(root_folder, data_project_dir=os.path.relpath(folder))
97
99
  click.echo(FeedbackManager.success(message="✓ Done!\n"))
100
+ created_something = True
98
101
 
99
102
  if not already_has_cursor_rules(root_folder):
100
103
  click.echo(FeedbackManager.highlight(message="\n» Creating .cursorrules..."))
101
104
  create_rules(root_folder, "tb", agent)
102
105
  click.echo(FeedbackManager.success(message="✓ Done!\n"))
103
- created = True
106
+ created_something = True
107
+
104
108
  if should_generate_fixtures(result):
105
109
  click.echo(FeedbackManager.highlight(message="\n» Generating fixtures..."))
106
110
 
@@ -110,7 +114,7 @@ async def create(
110
114
  datasource_path = Path(folder) / "datasources" / f"{ds_name}.datasource"
111
115
  click.echo(FeedbackManager.info(message=f"✓ /fixtures/{ds_name}"))
112
116
  persist_fixture(ds_name, data_content, folder)
113
- created = True
117
+ created_something = True
114
118
  elif prompt and user_token:
115
119
  datasource_files = [f for f in os.listdir(Path(folder) / "datasources") if f.endswith(".datasource")]
116
120
  for datasource_file in datasource_files:
@@ -129,8 +133,9 @@ async def create(
129
133
  if data:
130
134
  persist_fixture(datasource_name, data, folder)
131
135
  click.echo(FeedbackManager.info(message=f"✓ /fixtures/{datasource_name}"))
132
- created = True
133
- if not created:
136
+ created_something = True
137
+
138
+ if not created_something:
134
139
  click.echo(FeedbackManager.warning(message="△ No resources created\n"))
135
140
  except Exception as e:
136
141
  click.echo(FeedbackManager.error(message=f"Error: {str(e)}"))
@@ -185,8 +190,9 @@ async def create_resources(
185
190
  data: Optional[str],
186
191
  prompt: Optional[str],
187
192
  folder: str,
188
- ):
193
+ ) -> Tuple[str, bool]:
189
194
  result = ""
195
+ created_any_resource = False
190
196
  folder_path = Path(folder)
191
197
  if data:
192
198
  path = folder_path / data
@@ -206,6 +212,7 @@ TYPE ENDPOINT
206
212
  result = (
207
213
  f"<response><resource><type>datasource</type><name>{name}</name><content></content></resource></response>"
208
214
  )
215
+ created_any_resource = True
209
216
 
210
217
  elif prompt and user_token:
211
218
  datasource_paths = [
@@ -262,12 +269,14 @@ TYPE ENDPOINT
262
269
  force=True,
263
270
  folder=folder,
264
271
  )
272
+ created_any_resource = True
265
273
 
266
274
  for pipe in pipes:
267
275
  content = pipe["content"].replace("```", "")
268
276
  generate_pipe_file(pipe["name"], content, folder)
277
+ created_any_resource = True
269
278
 
270
- return result
279
+ return result, created_any_resource
271
280
 
272
281
 
273
282
  def init_git(folder: str):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: tinybird
3
- Version: 0.0.1.dev80
3
+ Version: 0.0.1.dev81
4
4
  Summary: Tinybird Command Line Tool
5
5
  Home-page: https://www.tinybird.co/docs/cli/introduction.html
6
6
  Author: Tinybird
@@ -1,5 +1,5 @@
1
1
  tinybird/__cli__.py,sha256=esPl5QDTzuQgHe5FuxWLm-fURFigGGwjnYLh9GuWUw4,232
2
- tinybird/client.py,sha256=ZRskFcS5Or-ELl_uaGfoTfioY_S2pwc_GyMQ6qIKqgM,52798
2
+ tinybird/client.py,sha256=s3YanJI9VBCOZ3QSu11PzWMVXt725qtTgCxBXI9g5vQ,52855
3
3
  tinybird/config.py,sha256=GQSc8v7mT79pmMANvp758i8mGVsTPd1VjJzjJmFi0LM,5885
4
4
  tinybird/connectors.py,sha256=7Gjms7b5MAaBFGi3xytsJurCylprONpFcYrzp4Fw2Rc,15241
5
5
  tinybird/context.py,sha256=VaMhyHruH-uyMypPDfxtuo4scS18b7rxCCdeUVm6ysg,1301
@@ -15,16 +15,16 @@ 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=b2UfXx5tqbCIJ_Ithif0cKrS57a1zq0eTwvY7iyFQ1g,251
18
+ tinybird/tb/__cli__.py,sha256=dU1Kn0U90zqjd2kzngJFUui0LkGht8JpNvoS74D6vfU,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
22
22
  tinybird/tb/modules/cicd.py,sha256=T0lb9u_bDdTUVe8TwNNb1qQ5KnSPHMVjqPfKF4BBNBw,5347
23
- tinybird/tb/modules/cli.py,sha256=GT1FSL700AP49g-g01Aw8SxbTn8lHftZFbk5tO0q-Nw,16296
23
+ tinybird/tb/modules/cli.py,sha256=7orwCSigoOpE2kPIjKm9xS-YmCsyn9stUxlys6ZGAcU,16311
24
24
  tinybird/tb/modules/common.py,sha256=f5yKjb1dgUzR-SrC4UHnpHXYIu6INcTHwNO96jW8A9w,73201
25
- tinybird/tb/modules/config.py,sha256=JVf2Kcafqmkid4voHecNvWdDVXmht-2zyNXkdcIyIm4,11509
25
+ tinybird/tb/modules/config.py,sha256=wIsoIf2yMCT2JQ5f6nZr-WzB7Uuah9EqXf6Glxe_p-Q,11353
26
26
  tinybird/tb/modules/copy.py,sha256=MAVqKip8_QhOYq99U_XuqSO6hCLJEh5sFtbhcXtI3SI,5802
27
- tinybird/tb/modules/create.py,sha256=bWCKND9R16vtBZHThCnx87bPtufp3pNpNr_yt5xgEn8,12795
27
+ tinybird/tb/modules/create.py,sha256=EAPI-ZsY4Nr_FBehUMpM4y1HZRoWLgdtHQtb71WnauE,13137
28
28
  tinybird/tb/modules/datasource.py,sha256=dNCK9iCR2xPLfwqqwg2ixyE6NuoVEiJU2mBZBmOYrVY,16906
29
29
  tinybird/tb/modules/deployment.py,sha256=LzxOWjI9hSIXbNxR0BmQfXWBUHhVX2LoZUeChkcmg6c,17528
30
30
  tinybird/tb/modules/endpoint.py,sha256=EhVoGAXsFz-83Fiwj1gI-I73iRRvL49d0W81un7hvPE,12080
@@ -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.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,,
79
+ tinybird-0.0.1.dev81.dist-info/METADATA,sha256=CKNK7oNqsTpA0-BuRZ9KmXPRLmYqofMTsJICygWMqUQ,2585
80
+ tinybird-0.0.1.dev81.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
81
+ tinybird-0.0.1.dev81.dist-info/entry_points.txt,sha256=LwdHU6TfKx4Qs7BqqtaczEZbImgU7Abe9Lp920zb_fo,43
82
+ tinybird-0.0.1.dev81.dist-info/top_level.txt,sha256=VqqqEmkAy7UNaD8-V51FCoMMWXjLUlR0IstvK7tJYVY,54
83
+ tinybird-0.0.1.dev81.dist-info/RECORD,,