tinybird 0.0.1.dev193__py3-none-any.whl → 0.0.1.dev195__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.dev193'
8
- __revision__ = '1b9821e'
7
+ __version__ = '0.0.1.dev195'
8
+ __revision__ = '6b32ca9'
@@ -220,7 +220,12 @@ async def sql(
220
220
  req_format = "CSVWithNames" if output == "csv" else "JSON"
221
221
  res = None
222
222
  try:
223
+ if not query and not sys.stdin.isatty(): # Check if there's piped input
224
+ query = sys.stdin.read().strip()
225
+
223
226
  if query:
227
+ if query.endswith(";"):
228
+ query = query[:-1].strip()
224
229
  q = query.lower().strip()
225
230
  if q.startswith("insert"):
226
231
  click.echo(FeedbackManager.info_append_data())
@@ -671,7 +671,7 @@ def print_changes(result: dict, project: Project) -> None:
671
671
  resources.append(["new", ds, "datasource", project.get_resource_path(ds, "datasource")])
672
672
 
673
673
  for p in deployment.get("new_pipe_names", []):
674
- path = str(project.get_resource_path(p, "pipe"))
674
+ path = project.get_resource_path(p, "pipe")
675
675
  pipe_type = project.get_pipe_type(path)
676
676
  resources.append(["new", p, pipe_type, path])
677
677
 
@@ -682,7 +682,7 @@ def print_changes(result: dict, project: Project) -> None:
682
682
  resources.append(["modified", ds, "datasource", project.get_resource_path(ds, "datasource")])
683
683
 
684
684
  for p in deployment.get("changed_pipe_names", []):
685
- path = str(project.get_resource_path(p, "pipe"))
685
+ path = project.get_resource_path(p, "pipe")
686
686
  pipe_type = project.get_pipe_type(path)
687
687
  resources.append(["modified", p, pipe_type, path])
688
688
 
@@ -696,7 +696,7 @@ def print_changes(result: dict, project: Project) -> None:
696
696
  resources.append(["deleted", ds, "datasource", project.get_resource_path(ds, "datasource")])
697
697
 
698
698
  for p in deployment.get("deleted_pipe_names", []):
699
- path = str(project.get_resource_path(p, "pipe"))
699
+ path = project.get_resource_path(p, "pipe")
700
700
  pipe_type = project.get_pipe_type(path)
701
701
  resources.append(["deleted", p, pipe_type, path])
702
702
 
@@ -50,12 +50,12 @@ class Project:
50
50
  project_files.append(project_file)
51
51
  return project_files
52
52
 
53
- def get_resource_path(self, resource_name: str, resource_type: str) -> Optional[str]:
53
+ def get_resource_path(self, resource_name: str, resource_type: str) -> str:
54
54
  full_path = next(
55
55
  (p for p in self.get_project_files() if p.endswith("/" + resource_name + f".{resource_type}")), ""
56
56
  )
57
57
  if not full_path:
58
- return None
58
+ return ""
59
59
  return Path(full_path).relative_to(self.path).as_posix()
60
60
 
61
61
  @property
@@ -117,14 +117,17 @@ class Project:
117
117
 
118
118
  @staticmethod
119
119
  def get_pipe_type(path: str) -> str:
120
- content = Path(path).read_text()
121
- if re.search(r"TYPE endpoint", content, re.IGNORECASE):
122
- return "endpoint"
123
- elif re.search(r"TYPE materialized", content, re.IGNORECASE):
124
- return "materialization"
125
- elif re.search(r"TYPE copy", content, re.IGNORECASE):
126
- return "copy"
127
- return "pipe"
120
+ try:
121
+ content = Path(path).read_text()
122
+ if re.search(r"TYPE endpoint", content, re.IGNORECASE):
123
+ return "endpoint"
124
+ elif re.search(r"TYPE materialized", content, re.IGNORECASE):
125
+ return "materialization"
126
+ elif re.search(r"TYPE copy", content, re.IGNORECASE):
127
+ return "copy"
128
+ return "pipe"
129
+ except Exception:
130
+ return "pipe"
128
131
 
129
132
  @staticmethod
130
133
  def is_kafka_connection(content: str) -> bool:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: tinybird
3
- Version: 0.0.1.dev193
3
+ Version: 0.0.1.dev195
4
4
  Summary: Tinybird Command Line Tool
5
5
  Home-page: https://www.tinybird.co/docs/forward/commands
6
6
  Author: Tinybird
@@ -12,21 +12,21 @@ 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=rqSzdlg51t2GUpwT8SnAfh-khtwhZTHokHMinOPEY-s,247
15
+ tinybird/tb/__cli__.py,sha256=Qg4UNsBMCnudsflNCzOHSFJG5BZ9WYHV058IuEvEK0k,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
19
19
  tinybird/tb/config.py,sha256=jT9xndpeCY_g0HdB5qE2EquC0TFRRnkPnQFWZWd04jo,3998
20
20
  tinybird/tb/modules/build.py,sha256=Deuq1Qk7c5Uapz92Vn9Bp7CrjDylRWER5hBvKGS3QxE,19370
21
21
  tinybird/tb/modules/cicd.py,sha256=Njb6eZOHHbUkoJJx6KoixO9PsfA_T-3Ybkya9-50Ca8,7328
22
- tinybird/tb/modules/cli.py,sha256=LW77oBqvZ6QB5X96158Kp13Tl24vKdxlyWvsSawpmCo,15399
22
+ tinybird/tb/modules/cli.py,sha256=qmD1tNoPXxpDuTD_Vu4YIR9egc3m1eS0NIhaQzacOYo,15605
23
23
  tinybird/tb/modules/common.py,sha256=2NRDRll0czmYjwLh3qv3DYL9aP8XgRkRAv5S3meCGfM,84062
24
24
  tinybird/tb/modules/config.py,sha256=ziqW_t_mRVvWOd85VoB4vKyvgMkEfpXDf9H4v38p2xc,11422
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
28
  tinybird/tb/modules/datasource.py,sha256=7r7wxU56Cabkg-rqNVOPkANHtMtZ03A1mWCCuK9t-8Q,37436
29
- tinybird/tb/modules/deployment.py,sha256=aVVg-ZqpZSNp8f8RQflAKijQsyRs9W6tys-xzHUUrMI,28169
29
+ tinybird/tb/modules/deployment.py,sha256=QeLYvk6vNmOFC2FAvhR5tzFIYDkSCVgT08CGEIxr4fU,28154
30
30
  tinybird/tb/modules/deprecations.py,sha256=rrszC1f_JJeJ8mUxGoCxckQTJFBCR8wREf4XXXN-PRc,4507
31
31
  tinybird/tb/modules/dev_server.py,sha256=57FCKuWpErwYUYgHspYDkLWEm9F4pbvVOtMrFXX1fVU,10129
32
32
  tinybird/tb/modules/endpoint.py,sha256=XySDt3pk66vxOZ0egUfz4bY8bEk3BjOXkv-L0OIJ3sc,12083
@@ -45,7 +45,7 @@ tinybird/tb/modules/materialization.py,sha256=QJX5kCPhhm6IXBO1JsalVfbQdypCe_eOUD
45
45
  tinybird/tb/modules/mock.py,sha256=IyHweMUM6bUH8IhyiX2tTMpdVpTFUeAJ41lZ5P42-HQ,5303
46
46
  tinybird/tb/modules/open.py,sha256=OuctINN77oexpSjth9uoIZPCelKO4Li-yyVxeSnk1io,1371
47
47
  tinybird/tb/modules/pipe.py,sha256=AQKEDagO6e3psPVjJkS_MDbn8aK-apAiLp26k7jgAV0,2432
48
- tinybird/tb/modules/project.py,sha256=eUO8WKfnBIEz9WofOdgXDiEl26dLJdK-3i3O8OHUOLk,5514
48
+ tinybird/tb/modules/project.py,sha256=xaXzLytWieNvSfK8DRvFJMXWxVNTAp4mI7Jkvozauoc,5599
49
49
  tinybird/tb/modules/regions.py,sha256=QjsL5H6Kg-qr0aYVLrvb1STeJ5Sx_sjvbOYO0LrEGMk,166
50
50
  tinybird/tb/modules/secret.py,sha256=WsqzxxLh9W_jkuHL2JofMXdIJy0lT5WEI-7bQSIDgAc,2921
51
51
  tinybird/tb/modules/shell.py,sha256=Zd_4Ak_5tKVX-cw6B4ag36xZeEGHeh-jZpAsIXkoMoE,14116
@@ -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.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,,
83
+ tinybird-0.0.1.dev195.dist-info/METADATA,sha256=p3l7jsZI94Z9fQhDjTv9ObdNETwV4hjQnNZ2fZ6RNhA,1608
84
+ tinybird-0.0.1.dev195.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
85
+ tinybird-0.0.1.dev195.dist-info/entry_points.txt,sha256=LwdHU6TfKx4Qs7BqqtaczEZbImgU7Abe9Lp920zb_fo,43
86
+ tinybird-0.0.1.dev195.dist-info/top_level.txt,sha256=VqqqEmkAy7UNaD8-V51FCoMMWXjLUlR0IstvK7tJYVY,54
87
+ tinybird-0.0.1.dev195.dist-info/RECORD,,