tinybird-cli 3.6.1.dev4__py3-none-any.whl → 3.6.1.dev5__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/__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__ = '3.6.1.dev4'
8
- __revision__ = '4fa4c4a'
7
+ __version__ = '3.6.1.dev5'
8
+ __revision__ = '321fe96'
@@ -7,10 +7,11 @@ from sqlfmt import actions, api
7
7
  from sqlfmt.analyzer import Analyzer, Rule, group
8
8
  from sqlfmt.comment import Comment
9
9
  from sqlfmt.dialect import ClickHouse
10
+ from sqlfmt.exception import SqlfmtBracketError
10
11
  from sqlfmt.jinjafmt import JinjaFormatter, JinjaTag
11
12
  from sqlfmt.line import Line
12
13
  from sqlfmt.mode import Mode
13
- from sqlfmt.node import Node
14
+ from sqlfmt.node import Node, get_previous_token
14
15
  from sqlfmt.node_manager import NodeManager
15
16
  from sqlfmt.token import Token, TokenType
16
17
 
@@ -118,6 +119,26 @@ class TinybirdNodeManager(NodeManager):
118
119
  super().__init__(case_sensitive_names)
119
120
  self.lower_keywords = lower_keywords
120
121
 
122
+ def create_node(self, token: Token, previous_node: Optional[Node]) -> Node:
123
+ try:
124
+ return super().create_node(token, previous_node)
125
+ except SqlfmtBracketError:
126
+ # we already have tb check and the toolset to check the SQL, no need for this extra validation
127
+ prev_token, extra_whitespace = get_previous_token(previous_node)
128
+ prefix = self.whitespace(token, prev_token, extra_whitespace)
129
+ value = self.standardize_value(token)
130
+ return Node(
131
+ token=token,
132
+ previous_node=previous_node,
133
+ prefix=prefix,
134
+ value=value,
135
+ formatting_disabled=False,
136
+ )
137
+
138
+ def raise_on_mismatched_bracket(self, token: Token, last_bracket: Node) -> None:
139
+ # we already have tb check and the toolset to check the SQL, no need for this extra validation
140
+ pass
141
+
121
142
  def standardize_value(self, token: Token) -> str:
122
143
  """
123
144
  Tinybird => Patched to not lower keywords
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: tinybird-cli
3
- Version: 3.6.1.dev4
3
+ Version: 3.6.1.dev5
4
4
  Summary: Tinybird Command Line Tool
5
5
  Home-page: https://www.tinybird.co/docs/cli/introduction.html
6
6
  Author: Tinybird
@@ -52,6 +52,11 @@ Changelog
52
52
 
53
53
  ---------
54
54
 
55
+ 3.6.1.dev5
56
+ ************
57
+
58
+ - `Fixed` Avoid `tb fmt` to error if there's a `CASE` in the sql
59
+
55
60
  3.6.1.dev4
56
61
  ************
57
62
 
@@ -1,4 +1,4 @@
1
- tinybird/__cli__.py,sha256=Yx00gzhEr5Aa-FQVwES4DB1m-04sX1hIlV_EriUluWY,254
1
+ tinybird/__cli__.py,sha256=9b226fjwx6IUFDoehvMthpbbpOiAS-OJceoZ5qknImY,254
2
2
  tinybird/check_pypi.py,sha256=_4NkharLyR_ELrAdit-ftqIWvOf7jZNPt3i76frlo9g,975
3
3
  tinybird/client.py,sha256=HbTicwXGErvAMCFj7o9X7aGKxI0WuuTKOr6tf-0jYOA,46575
4
4
  tinybird/config.py,sha256=E0jDwbFD1zhdijNhtF8fg6mqIyKbZ8xpNPP_3n2PFpE,2003
@@ -11,7 +11,7 @@ tinybird/feedback_manager.py,sha256=p8unybrnH8L6uK-k5UZ0nvzrSfzwDMeIKSGIzRy0_nU,
11
11
  tinybird/git_settings.py,sha256=vu8sWb3TAXeM8Tqy27aR0el8MnPm7kqQzTRV76xB0ro,4707
12
12
  tinybird/sql.py,sha256=ln_rs8goRV-yP7BdiA3MewzFKgIHQdRalhtiUrwTBV4,41181
13
13
  tinybird/sql_template.py,sha256=-q64irnoIqKhYgtCmsgjPV62vluM6aFxKgkgtRcL1n8,76994
14
- tinybird/sql_template_fmt.py,sha256=qUD5bWgiMpl1-Zu5ykmNxaJM9vHZhnvGZInWbtaBAY4,8137
14
+ tinybird/sql_template_fmt.py,sha256=XVViCPRfH9HtJi0-rrOyJOvU17qsOynbC1P07w9gi9Y,9121
15
15
  tinybird/sql_toolset.py,sha256=xt_UETbeLK_psCUTumgTVT0o1b1LPIxihTjr0intMkc,11523
16
16
  tinybird/syncasync.py,sha256=fAvq0qkRgqXqXMKwbY2iJNYqLT_r6mDsh1MRpGKrdRU,27763
17
17
  tinybird/tb_cli.py,sha256=XPyQ8QQ85ohpfVv7ZGzZjIbeijFZEzWQDwCz5zVpZ_U,674
@@ -38,8 +38,8 @@ tinybird/tb_cli_modules/workspace.py,sha256=NDHINzW3SBo8FcWH8Bx-DCeUXQ8YUJX6FW8c
38
38
  tinybird/tb_cli_modules/workspace_members.py,sha256=3HzY43218fb35ZM81mtkwDQe7gAAf1zEFY6kIEhGvgE,8268
39
39
  tinybird/tb_cli_modules/tinyunit/tinyunit.py,sha256=0dYYmZMMJVubxSPls2e_a-fqtUYvgLfu2B0xwLfkbHw,11667
40
40
  tinybird/tb_cli_modules/tinyunit/tinyunit_lib.py,sha256=j92za8QbXrv4eIPjKBZPn9ghR-nYQ2wZZ88MeXyMWXE,1868
41
- tinybird_cli-3.6.1.dev4.dist-info/METADATA,sha256=L8RZwkbX2PkZA4kP74DjBCryI5mX6qRAel5Pwcl8buI,69077
42
- tinybird_cli-3.6.1.dev4.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
43
- tinybird_cli-3.6.1.dev4.dist-info/entry_points.txt,sha256=PKPKuPmA4IfJYnCFHHUiw-aAWZuBomFvwCklv1OyCjE,43
44
- tinybird_cli-3.6.1.dev4.dist-info/top_level.txt,sha256=pgw6AzERHBcW3YTi2PW4arjxLkulk2msOz_SomfOEuc,45
45
- tinybird_cli-3.6.1.dev4.dist-info/RECORD,,
41
+ tinybird_cli-3.6.1.dev5.dist-info/METADATA,sha256=4tC2eTcips1VHScwJvriZ6HzHCQwvhT7JDIBw5iEXbQ,69168
42
+ tinybird_cli-3.6.1.dev5.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
43
+ tinybird_cli-3.6.1.dev5.dist-info/entry_points.txt,sha256=PKPKuPmA4IfJYnCFHHUiw-aAWZuBomFvwCklv1OyCjE,43
44
+ tinybird_cli-3.6.1.dev5.dist-info/top_level.txt,sha256=pgw6AzERHBcW3YTi2PW4arjxLkulk2msOz_SomfOEuc,45
45
+ tinybird_cli-3.6.1.dev5.dist-info/RECORD,,