tinybird 0.0.1.dev108__py3-none-any.whl → 0.0.1.dev109__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.
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.dev108'
8
- __revision__ = '1909c2e'
7
+ __version__ = '0.0.1.dev109'
8
+ __revision__ = '421d6c4'
@@ -191,6 +191,14 @@ KAFKA_PARAMS = {
191
191
 
192
192
  REQUIRED_KAFKA_PARAMS = KAFKA_PARAMS
193
193
 
194
+ S3_PARAMS = {
195
+ "import_connection_name",
196
+ "import_schedule",
197
+ "import_bucket_uri",
198
+ }
199
+
200
+ REQUIRED_S3_PARAMS = S3_PARAMS
201
+
194
202
 
195
203
  class Datafile:
196
204
  def __init__(self) -> None:
@@ -261,6 +269,7 @@ class Datafile:
261
269
  # [x] Engine is present
262
270
  # [x] Token permissions are valid
263
271
  # [x] If it's a kafka datasource, all required kafka params are present
272
+ # [x] If it's an S3 datasource, all required S3 params are present
264
273
  # [ ] ...
265
274
  if len(self.nodes) > 1:
266
275
  # Our users are not aware of data source data files being a single-node data file, hence this error
@@ -283,6 +292,12 @@ class Datafile:
283
292
  raise DatafileValidationError(
284
293
  f"Some Kafka params have been provided, but the following required ones are missing: {missing}"
285
294
  )
295
+ # Validate S3 params
296
+ if any(param in node for param in S3_PARAMS) and not all(param in node for param in REQUIRED_S3_PARAMS):
297
+ missing = [param for param in S3_PARAMS if param not in node]
298
+ raise DatafileValidationError(
299
+ f"Some S3 params have been provided, but the following required ones are missing: {missing}"
300
+ )
286
301
  else:
287
302
  # We cannot validate a datafile whose kind is unknown
288
303
  pass
@@ -113,6 +113,9 @@ def start_server(auth_callback, auth_host):
113
113
  @coro
114
114
  async def login(host: str, auth_host: str, workspace: str):
115
115
  """Authenticate using the browser."""
116
+ host = host.rstrip("/")
117
+ auth_host = auth_host.rstrip("/")
118
+
116
119
  auth_event = threading.Event()
117
120
  auth_code: list[str] = [] # Using a list to store the code, as it's mutable
118
121
 
@@ -153,8 +156,8 @@ async def login(host: str, auth_host: str, workspace: str):
153
156
  cli_config.set_token(data.get("workspace_token", ""))
154
157
  cli_config.set_token_for_host(data.get("workspace_token", ""), host)
155
158
  cli_config.set_user_token(data.get("user_token", ""))
156
- cli_config.set_host(host or data.get("api_host", ""))
157
-
159
+ host = data.get("api_host", host)
160
+ cli_config.set_host(host)
158
161
  ws = await cli_config.get_client(token=data.get("workspace_token", ""), host=host).workspace_info(version="v1")
159
162
  for k in ("id", "name", "user_email", "user_id", "scope"):
160
163
  if k in ws:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: tinybird
3
- Version: 0.0.1.dev108
3
+ Version: 0.0.1.dev109
4
4
  Summary: Tinybird Command Line Tool
5
5
  Home-page: https://www.tinybird.co/docs/cli/introduction.html
6
6
  Author: Tinybird
@@ -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=OSNR6WHHR8BSY9FOJAY3RW4JLaPIKXViXTAQ-ptYsYg,252
18
+ tinybird/tb/__cli__.py,sha256=gq1iOJ_OD1Jr2fuf07Ot_OShPnS-FIvM36rsSSSVtzs,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
@@ -38,7 +38,7 @@ tinybird/tb/modules/llm.py,sha256=AC0VSphTOM2t-v1_3NLvNN_FIbgMo4dTyMqIv5nniPo,83
38
38
  tinybird/tb/modules/llm_utils.py,sha256=nS9r4FAElJw8yXtmdYrx-rtI2zXR8qXfi1QqUDCfxvg,3469
39
39
  tinybird/tb/modules/local.py,sha256=4BhxfkSTHpckXmH4aU_BothlV5n4JyAIoBKX3wP_BZg,7863
40
40
  tinybird/tb/modules/local_common.py,sha256=RN5OEncHdq7ua4AZ--WgKtaFuEsLvIhq_ROHJadRXXA,3188
41
- tinybird/tb/modules/login.py,sha256=98b7obc1yQtDtoB-88yyEj_X99ZvVRB13q261AMKJBM,6270
41
+ tinybird/tb/modules/login.py,sha256=lLCJ1kIq3sLcoSMH1kZge5isHh-fDwHPRHApIqbaCkw,6350
42
42
  tinybird/tb/modules/logout.py,sha256=ULooy1cDBD02-r7voZmhV7udA0ML5tVuflJyShrh56Y,1022
43
43
  tinybird/tb/modules/materialization.py,sha256=r8Q9HXcYEmfrEzP4WpiasCKDJdSkTPaAKJtZMoJKhi8,5749
44
44
  tinybird/tb/modules/mock.py,sha256=2E26N8TMK1sP7eRc9N1nODdc_vU1jBeGRs8e-fbQ5Dc,4516
@@ -61,7 +61,7 @@ tinybird/tb/modules/datafile/build.py,sha256=jhfIJ2xt0N13XsLPe3iMQIyCPApHS13_Df2
61
61
  tinybird/tb/modules/datafile/build_common.py,sha256=rT7VJ5mnQ68R_8US91DAtkusfvjWuG_NObOzNgtN_ko,4562
62
62
  tinybird/tb/modules/datafile/build_datasource.py,sha256=CCU3eQ8Rax9RgHHfbAXDRL6rQ49N35h_GDQnGrUUUzA,17379
63
63
  tinybird/tb/modules/datafile/build_pipe.py,sha256=w-Wd08gZYAEcak9FdBijVfIU2_Wn_PPdgAZddPpoGTo,11382
64
- tinybird/tb/modules/datafile/common.py,sha256=4Jv20MUMaQl2NlbviRGHH41ncoDc6h9g4IWC0nl0j3M,82579
64
+ tinybird/tb/modules/datafile/common.py,sha256=4pvW92X9BXomaN3-WhQOjvnAHY96O4dTsp4USBdknzk,83192
65
65
  tinybird/tb/modules/datafile/diff.py,sha256=-0J7PsBO64T7LOZSkZ4ZFHHCPvT7cKItnJkbz2PkndU,6754
66
66
  tinybird/tb/modules/datafile/exceptions.py,sha256=8rw2umdZjtby85QbuRKFO5ETz_eRHwUY5l7eHsy1wnI,556
67
67
  tinybird/tb/modules/datafile/fixture.py,sha256=si-9LB-LdKQSWDtVW82xDrHtFfko5bgBG1cvjqqrcPU,1064
@@ -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.dev108.dist-info/METADATA,sha256=gXcf738MA5OAGkVcougBzsBLqsPi-1fff5sNv6bAjGU,1612
85
- tinybird-0.0.1.dev108.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
86
- tinybird-0.0.1.dev108.dist-info/entry_points.txt,sha256=LwdHU6TfKx4Qs7BqqtaczEZbImgU7Abe9Lp920zb_fo,43
87
- tinybird-0.0.1.dev108.dist-info/top_level.txt,sha256=VqqqEmkAy7UNaD8-V51FCoMMWXjLUlR0IstvK7tJYVY,54
88
- tinybird-0.0.1.dev108.dist-info/RECORD,,
84
+ tinybird-0.0.1.dev109.dist-info/METADATA,sha256=v6-T3y67YWXtDvTUvKDY54ywJvMNaNpb150tom2JvtM,1612
85
+ tinybird-0.0.1.dev109.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
86
+ tinybird-0.0.1.dev109.dist-info/entry_points.txt,sha256=LwdHU6TfKx4Qs7BqqtaczEZbImgU7Abe9Lp920zb_fo,43
87
+ tinybird-0.0.1.dev109.dist-info/top_level.txt,sha256=VqqqEmkAy7UNaD8-V51FCoMMWXjLUlR0IstvK7tJYVY,54
88
+ tinybird-0.0.1.dev109.dist-info/RECORD,,