tinybird 0.0.1.dev192__py3-none-any.whl → 0.0.1.dev193__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/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.dev192'
8
- __revision__ = '116c2dc'
7
+ __version__ = '0.0.1.dev193'
8
+ __revision__ = '1b9821e'
@@ -127,7 +127,7 @@ async def datasource_ls(ctx: Context, match: Optional[str], format_: str):
127
127
 
128
128
  @datasource.command(name="append")
129
129
  @click.argument("datasource_name", required=False)
130
- @click.argument("data", nargs=-1, required=False)
130
+ @click.argument("data", required=False)
131
131
  @click.option("--url", type=str, help="URL to append data from")
132
132
  @click.option("--file", type=str, help="Local file to append data from")
133
133
  @click.option("--events", type=str, help="Events to append data from")
@@ -159,15 +159,30 @@ async def datasource_append(
159
159
 
160
160
  # If data is passed as argument, we detect if it's a JSON object, a URL or a file
161
161
  if data:
162
- try:
163
- json.loads(data)
162
+ VALID_EXTENSIONS = [
163
+ "csv",
164
+ "csv.gz",
165
+ "ndjson",
166
+ "ndjson.gz",
167
+ "jsonl",
168
+ "jsonl.gz",
169
+ "json",
170
+ "json.gz",
171
+ "parquet",
172
+ "parquet.gz",
173
+ ]
174
+ is_file_or_url = data and (data.startswith("http") or any(data.endswith(f".{ext}") for ext in VALID_EXTENSIONS))
175
+ if is_file_or_url:
176
+ try:
177
+ if urlparse(data).scheme in ("http", "https"):
178
+ url = data
179
+ except Exception:
180
+ pass
181
+
182
+ if not url:
183
+ file = data
184
+ else:
164
185
  events = data
165
- except Exception:
166
- pass
167
- if urlparse(data).scheme in ("http", "https"):
168
- url = data
169
- if not events and not url:
170
- file = data
171
186
 
172
187
  # If data is not passed as argument, we use the data from the options
173
188
  if not data:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: tinybird
3
- Version: 0.0.1.dev192
3
+ Version: 0.0.1.dev193
4
4
  Summary: Tinybird Command Line Tool
5
5
  Home-page: https://www.tinybird.co/docs/forward/commands
6
6
  Author: Tinybird
@@ -12,7 +12,7 @@ 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=WyfYqfkf_ILLl0K6xlcfKKfD_0fTf__KCCa29CBGHmw,247
15
+ tinybird/tb/__cli__.py,sha256=rqSzdlg51t2GUpwT8SnAfh-khtwhZTHokHMinOPEY-s,247
16
16
  tinybird/tb/check_pypi.py,sha256=rW4QmDRbtgKdUUwJCnBkVjmTjZSZGN-XgZhx7vMkC0w,1009
17
17
  tinybird/tb/cli.py,sha256=u3eGOhX0MHkuT6tiwaZ0_3twqLmqKXDAOxF7yV_Nn9Q,1075
18
18
  tinybird/tb/client.py,sha256=CO-dQw8h28X6T6IO-Z79yPBKaJQT1Rwya5b6gexvw58,56491
@@ -25,7 +25,7 @@ tinybird/tb/modules/config.py,sha256=ziqW_t_mRVvWOd85VoB4vKyvgMkEfpXDf9H4v38p2xc
25
25
  tinybird/tb/modules/connection.py,sha256=z1xWP2gtjKEbjc4ZF1aD7QUgl8V--wf2IRNy-4sRFm8,9779
26
26
  tinybird/tb/modules/copy.py,sha256=2Mm4FWKehOG7CoOhiF1m9UZJgJn0W1_cMolqju8ONYg,5805
27
27
  tinybird/tb/modules/create.py,sha256=2uW-4t7c7e4xkZ-GpK_8XaA-nuXwklq7rTks4k6qrtI,20917
28
- tinybird/tb/modules/datasource.py,sha256=Uomj3bpVL5m4A0_ezWFXvQAjVER4EfmDz5gFkfGR7eo,37027
28
+ tinybird/tb/modules/datasource.py,sha256=7r7wxU56Cabkg-rqNVOPkANHtMtZ03A1mWCCuK9t-8Q,37436
29
29
  tinybird/tb/modules/deployment.py,sha256=aVVg-ZqpZSNp8f8RQflAKijQsyRs9W6tys-xzHUUrMI,28169
30
30
  tinybird/tb/modules/deprecations.py,sha256=rrszC1f_JJeJ8mUxGoCxckQTJFBCR8wREf4XXXN-PRc,4507
31
31
  tinybird/tb/modules/dev_server.py,sha256=57FCKuWpErwYUYgHspYDkLWEm9F4pbvVOtMrFXX1fVU,10129
@@ -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.dev192.dist-info/METADATA,sha256=eZrRBg8bCyPv90gKQtHPx47LdUlGlk6nIoAU18AjYf4,1608
84
- tinybird-0.0.1.dev192.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
85
- tinybird-0.0.1.dev192.dist-info/entry_points.txt,sha256=LwdHU6TfKx4Qs7BqqtaczEZbImgU7Abe9Lp920zb_fo,43
86
- tinybird-0.0.1.dev192.dist-info/top_level.txt,sha256=VqqqEmkAy7UNaD8-V51FCoMMWXjLUlR0IstvK7tJYVY,54
87
- tinybird-0.0.1.dev192.dist-info/RECORD,,
83
+ tinybird-0.0.1.dev193.dist-info/METADATA,sha256=sn2-N11dklKkdkf6j2ZpXPDnjI2p8rDTLyzRV7JVp6Q,1608
84
+ tinybird-0.0.1.dev193.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
85
+ tinybird-0.0.1.dev193.dist-info/entry_points.txt,sha256=LwdHU6TfKx4Qs7BqqtaczEZbImgU7Abe9Lp920zb_fo,43
86
+ tinybird-0.0.1.dev193.dist-info/top_level.txt,sha256=VqqqEmkAy7UNaD8-V51FCoMMWXjLUlR0IstvK7tJYVY,54
87
+ tinybird-0.0.1.dev193.dist-info/RECORD,,