tinybird 4.6.7.dev0__py3-none-any.whl → 4.6.8.dev0__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/sql_template.py CHANGED
@@ -1953,11 +1953,12 @@ def get_var_data(content, node_id=None):
1953
1953
  """
1954
1954
 
1955
1955
  def node_to_value(x):
1956
- if type(x) in (ast.Bytes, ast.Str):
1957
- return x.s
1958
- elif type(x) == ast.Num: # noqa: E721
1959
- return x.n
1960
- elif type(x) == ast.NameConstant: # noqa: E721
1956
+ # ast.Constant supersedes the deprecated ast.Bytes/ast.Str/ast.Num/
1957
+ # ast.NameConstant node classes. Those were aliases of ast.Constant
1958
+ # since Python 3.8 (emitting DeprecationWarning on access in 3.12) and
1959
+ # were removed in Python 3.14. The parser only ever produces
1960
+ # ast.Constant nodes, so .value holds str/bytes/int/float/bool/None.
1961
+ if type(x) == ast.Constant: # noqa: E721
1961
1962
  return x.value
1962
1963
  elif type(x) == ast.Name: # noqa: E721
1963
1964
  return x.id
@@ -1971,8 +1972,6 @@ def get_var_data(content, node_id=None):
1971
1972
  if not r:
1972
1973
  r = node_to_value(x.right)
1973
1974
  return r
1974
- elif type(x) == ast.Constant: # noqa: E721
1975
- return x.value
1976
1975
  elif type(x) == ast.UnaryOp and type(x.operand) == ast.Constant: # noqa: E721
1977
1976
  if type(x.op) == ast.USub: # noqa: E721
1978
1977
  return x.operand.value * -1
@@ -1991,11 +1990,9 @@ def get_var_data(content, node_id=None):
1991
1990
  return []
1992
1991
 
1993
1992
  first_elem = x.elts[0]
1994
- if type(first_elem) in (ast.Bytes, ast.Str):
1995
- return [elem.s for elem in x.elts]
1996
- elif type(first_elem) == ast.Num: # noqa: E721
1997
- return [elem.n for elem in x.elts]
1998
- elif type(first_elem) == ast.NameConstant or type(first_elem) == ast.Constant: # noqa: E721
1993
+ # See node_to_value: ast.Constant supersedes the deprecated
1994
+ # ast.Bytes/ast.Str/ast.Num/ast.NameConstant (removed in 3.14).
1995
+ if type(first_elem) == ast.Constant: # noqa: E721
1999
1996
  return [elem.value for elem in x.elts]
2000
1997
  elif type(first_elem) == ast.Name: # noqa: E721
2001
1998
  return [elem.id for elem in x.elts]
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__ = '4.6.7.dev0'
8
- __revision__ = 'd3cbd87'
7
+ __version__ = '4.6.8.dev0'
8
+ __revision__ = '1177944'
@@ -213,13 +213,22 @@ def login(
213
213
 
214
214
  # Wait for the authentication to complete or timeout
215
215
  if auth_event.wait(timeout=SERVER_MAX_WAIT_TIME): # Wait for up to 180 seconds
216
- params = {}
217
- params["code"] = auth_code[0]
216
+ params = {"code": auth_code[0]}
218
217
  response = requests.get(
219
218
  f"{auth_host}/api/cli-login?{urlencode(params)}",
219
+ allow_redirects=False,
220
220
  )
221
221
 
222
- data = response.json()
222
+ if response.status_code != 200:
223
+ raise Exception("Could not complete the authentication. Please try running the login command again.")
224
+
225
+ try:
226
+ data = response.json()
227
+ except ValueError:
228
+ raise Exception(
229
+ "Received an unexpected response while completing the authentication. "
230
+ "Please try running the login command again."
231
+ )
223
232
  authenticate_with_tokens(data, cli_config)
224
233
  else:
225
234
  raise Exception("Authentication failed or timed out.")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: tinybird
3
- Version: 4.6.7.dev0
3
+ Version: 4.6.8.dev0
4
4
  Summary: Tinybird Command Line Tool
5
5
  Home-page: https://www.tinybird.co/docs/forward/commands
6
6
  Author: Tinybird
@@ -52,6 +52,11 @@ The Tinybird command-line tool allows you to use all the Tinybird functionality
52
52
  Changelog
53
53
  ----------
54
54
 
55
+ 4.6.7.
56
+ *******
57
+
58
+ - `Fixed` `tb login` now raises an actionable error when the CLI cannot complete the authentication.
59
+
55
60
  4.6.6
56
61
  *******
57
62
 
@@ -5,7 +5,7 @@ tinybird/git_settings.py,sha256=mqWgeboOlOFsSo97qyv595UCR2R1QCAqT4GTawBNPBg,3935
5
5
  tinybird/prompts.py,sha256=FNYpphDYlrXpm5AQM3yfQPbj4gd_TVnwoaoeswtx0OE,32699
6
6
  tinybird/service_datasources.py,sha256=Fp3a_Evte1u1U4f4D8fchgbtv6BgJIIyBbmOLtgLu4Q,58162
7
7
  tinybird/sql.py,sha256=L3tTmm62iTrf6WQdcV8mmwrCMitLFUvJ3OfDzyRTMGw,47385
8
- tinybird/sql_template.py,sha256=jWZ30hCAlOJU5dVDSA-Rx03g9pHZxQydcr1Fd1-Unz0,127897
8
+ tinybird/sql_template.py,sha256=8A5Jfzej7OHXzbfFMGpbq-YUzSEOoDHy5u7uy0vLZo4,127947
9
9
  tinybird/sql_template_fmt.py,sha256=Ma4qcs-2r8ZXQC4GUmrCqYz34DsnGF8k5lE2Jwnr314,10638
10
10
  tinybird/sql_toolset.py,sha256=TvWeH3DsB13SfJ97V_t_ZaFTJ1IAtsrxQ8E3FLL8_tE,27442
11
11
  tinybird/syncasync.py,sha256=rIPmCvygWSFqfnlVqhZH4N9gVVTvD6DEPsfoxGizYrI,27776
@@ -19,7 +19,7 @@ tinybird/datafile/parse_datasource.py,sha256=yd58HrUF4yNJXLn6OsvKGpZJpvrcjLGAeJG
19
19
  tinybird/datafile/parse_pipe.py,sha256=-9bbgVuiWRyDYydrLVflDBt8GstZotMy6dklsrc6MUY,3859
20
20
  tinybird/iterating/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
21
21
  tinybird/iterating/data_branch_modes.py,sha256=5YuDa-gr8mKwmES8Xro6TRKbQtaOtIw4GbC606Qhu3o,184
22
- tinybird/tb/__cli__.py,sha256=pl01mee5GgJmds84ZsuJKEbeBrsAlWDiJJtFe0icuBs,245
22
+ tinybird/tb/__cli__.py,sha256=CxcmhFmuXOaguuZErMMae1fi2B8eAUtLktTMY2rXYRY,245
23
23
  tinybird/tb/check_pypi.py,sha256=Gp0HkHHDFMSDL6nxKlOY51z7z1Uv-2LRexNTZSHHGmM,552
24
24
  tinybird/tb/cli.py,sha256=IjiGfNIpxSxi1odK1kMj9s8lEhx3sAUgGA263XdmyR0,1119
25
25
  tinybird/tb/client.py,sha256=wgXYa_CSKi-ymWnX-j8-CNHCNdQrUWQA6ezT0REMPOs,56830
@@ -55,7 +55,7 @@ tinybird/tb/modules/local.py,sha256=1Uf1cOjVPYt3kF4cTQ8gmDsNbfTqmxv2SAfiiYYoMr4,
55
55
  tinybird/tb/modules/local_common.py,sha256=Bl47fKrPXLCmslFq1H2fG5KMYuAANlHm-GeQ3vdOGro,38863
56
56
  tinybird/tb/modules/local_logs.py,sha256=TTrfEQr3wVoddrQiKslSWJQ8BE4FOlMQZbH1yJ5f56I,7427
57
57
  tinybird/tb/modules/login.py,sha256=fxgcsN0fMhjzT_6C8VrwGTxnLxLVuWlZvASFr8I9yUU,1885
58
- tinybird/tb/modules/login_common.py,sha256=FFMdj2vSiFaAvZUwmtTwg--Q-gqwEo34CaAgItf3M08,21744
58
+ tinybird/tb/modules/login_common.py,sha256=oRIAJm1cwJ4t4hZb1RKRmyylZuYz0mrEBo0xTOZHSQ8,22185
59
59
  tinybird/tb/modules/logout.py,sha256=sniI4JNxpTrVeRCp0oGJuQ3yRerG4hH5uz6oBmjv724,1009
60
60
  tinybird/tb/modules/logs.py,sha256=uSQi_A6QIFOjAoj1h8XOI_51AQ3uk5UEg2TjYbZxDJA,21462
61
61
  tinybird/tb/modules/materialization.py,sha256=SaomNeaAzLWtcnsZdetYBxEq0ihY1cRzh23n3Z1P_c4,5643
@@ -99,8 +99,8 @@ tinybird/tb_cli_modules/config.py,sha256=Ey9yqM27C4Irglm5-63RXte8K0bFh8ConKdIoAa
99
99
  tinybird/tb_cli_modules/exceptions.py,sha256=pmucP4kTF4irIt7dXiG-FcnI-o3mvDusPmch1L8RCWk,3367
100
100
  tinybird/tb_cli_modules/regions.py,sha256=QjsL5H6Kg-qr0aYVLrvb1STeJ5Sx_sjvbOYO0LrEGMk,166
101
101
  tinybird/tb_cli_modules/telemetry.py,sha256=W098H6jmS4kpE7hN3tadaREBTf7oMocel-lkKWN0pU8,10466
102
- tinybird-4.6.7.dev0.dist-info/METADATA,sha256=MEgE3XVXz6knf6hn0GSYsYgYQ3DbIUoYXM7KSJPT-0A,14568
103
- tinybird-4.6.7.dev0.dist-info/WHEEL,sha256=beeZ86-EfXScwlR_HKu4SllMC9wUEj_8Z_4FJ3egI2w,91
104
- tinybird-4.6.7.dev0.dist-info/entry_points.txt,sha256=LwdHU6TfKx4Qs7BqqtaczEZbImgU7Abe9Lp920zb_fo,43
105
- tinybird-4.6.7.dev0.dist-info/top_level.txt,sha256=ZIQJTPCzMqnfDzM_hEGZrJqDSEcKnIK_49T86DGWpyQ,78
106
- tinybird-4.6.7.dev0.dist-info/RECORD,,
102
+ tinybird-4.6.8.dev0.dist-info/METADATA,sha256=yYqIe4bfD089wuOvBA4zam7hk3xEgoM4o_7tgxdzmNU,14686
103
+ tinybird-4.6.8.dev0.dist-info/WHEEL,sha256=beeZ86-EfXScwlR_HKu4SllMC9wUEj_8Z_4FJ3egI2w,91
104
+ tinybird-4.6.8.dev0.dist-info/entry_points.txt,sha256=LwdHU6TfKx4Qs7BqqtaczEZbImgU7Abe9Lp920zb_fo,43
105
+ tinybird-4.6.8.dev0.dist-info/top_level.txt,sha256=ZIQJTPCzMqnfDzM_hEGZrJqDSEcKnIK_49T86DGWpyQ,78
106
+ tinybird-4.6.8.dev0.dist-info/RECORD,,