tinybird 0.0.1.dev61__tar.gz → 0.0.1.dev63__tar.gz

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.

Files changed (101) hide show
  1. {tinybird-0.0.1.dev61 → tinybird-0.0.1.dev63}/PKG-INFO +1 -1
  2. {tinybird-0.0.1.dev61 → tinybird-0.0.1.dev63}/tinybird/config.py +4 -6
  3. {tinybird-0.0.1.dev61 → tinybird-0.0.1.dev63}/tinybird/feedback_manager.py +3 -0
  4. {tinybird-0.0.1.dev61 → tinybird-0.0.1.dev63}/tinybird/tb/__cli__.py +2 -2
  5. {tinybird-0.0.1.dev61 → tinybird-0.0.1.dev63}/tinybird/tb/modules/config.py +0 -4
  6. {tinybird-0.0.1.dev61 → tinybird-0.0.1.dev63}/tinybird/tb/modules/datafile/parse_pipe.py +2 -0
  7. {tinybird-0.0.1.dev61 → tinybird-0.0.1.dev63}/tinybird/tb/modules/endpoint.py +115 -19
  8. {tinybird-0.0.1.dev61 → tinybird-0.0.1.dev63}/tinybird/tb/modules/local_common.py +3 -2
  9. {tinybird-0.0.1.dev61 → tinybird-0.0.1.dev63}/tinybird/tb_cli_modules/common.py +0 -2
  10. {tinybird-0.0.1.dev61 → tinybird-0.0.1.dev63}/tinybird/tb_cli_modules/connection.py +9 -1
  11. {tinybird-0.0.1.dev61 → tinybird-0.0.1.dev63}/tinybird.egg-info/PKG-INFO +1 -1
  12. {tinybird-0.0.1.dev61 → tinybird-0.0.1.dev63}/setup.cfg +0 -0
  13. {tinybird-0.0.1.dev61 → tinybird-0.0.1.dev63}/tinybird/__cli__.py +0 -0
  14. {tinybird-0.0.1.dev61 → tinybird-0.0.1.dev63}/tinybird/ch_utils/constants.py +0 -0
  15. {tinybird-0.0.1.dev61 → tinybird-0.0.1.dev63}/tinybird/ch_utils/engine.py +0 -0
  16. {tinybird-0.0.1.dev61 → tinybird-0.0.1.dev63}/tinybird/check_pypi.py +0 -0
  17. {tinybird-0.0.1.dev61 → tinybird-0.0.1.dev63}/tinybird/client.py +0 -0
  18. {tinybird-0.0.1.dev61 → tinybird-0.0.1.dev63}/tinybird/connectors.py +0 -0
  19. {tinybird-0.0.1.dev61 → tinybird-0.0.1.dev63}/tinybird/context.py +0 -0
  20. {tinybird-0.0.1.dev61 → tinybird-0.0.1.dev63}/tinybird/datafile.py +0 -0
  21. {tinybird-0.0.1.dev61 → tinybird-0.0.1.dev63}/tinybird/datatypes.py +0 -0
  22. {tinybird-0.0.1.dev61 → tinybird-0.0.1.dev63}/tinybird/git_settings.py +0 -0
  23. {tinybird-0.0.1.dev61 → tinybird-0.0.1.dev63}/tinybird/prompts.py +0 -0
  24. {tinybird-0.0.1.dev61 → tinybird-0.0.1.dev63}/tinybird/sql.py +0 -0
  25. {tinybird-0.0.1.dev61 → tinybird-0.0.1.dev63}/tinybird/sql_template.py +0 -0
  26. {tinybird-0.0.1.dev61 → tinybird-0.0.1.dev63}/tinybird/sql_template_fmt.py +0 -0
  27. {tinybird-0.0.1.dev61 → tinybird-0.0.1.dev63}/tinybird/sql_toolset.py +0 -0
  28. {tinybird-0.0.1.dev61 → tinybird-0.0.1.dev63}/tinybird/syncasync.py +0 -0
  29. {tinybird-0.0.1.dev61 → tinybird-0.0.1.dev63}/tinybird/tb/cli.py +0 -0
  30. {tinybird-0.0.1.dev61 → tinybird-0.0.1.dev63}/tinybird/tb/modules/auth.py +0 -0
  31. {tinybird-0.0.1.dev61 → tinybird-0.0.1.dev63}/tinybird/tb/modules/build.py +0 -0
  32. {tinybird-0.0.1.dev61 → tinybird-0.0.1.dev63}/tinybird/tb/modules/cicd.py +0 -0
  33. {tinybird-0.0.1.dev61 → tinybird-0.0.1.dev63}/tinybird/tb/modules/cli.py +0 -0
  34. {tinybird-0.0.1.dev61 → tinybird-0.0.1.dev63}/tinybird/tb/modules/common.py +0 -0
  35. {tinybird-0.0.1.dev61 → tinybird-0.0.1.dev63}/tinybird/tb/modules/copy.py +0 -0
  36. {tinybird-0.0.1.dev61 → tinybird-0.0.1.dev63}/tinybird/tb/modules/create.py +0 -0
  37. {tinybird-0.0.1.dev61 → tinybird-0.0.1.dev63}/tinybird/tb/modules/datafile/build.py +0 -0
  38. {tinybird-0.0.1.dev61 → tinybird-0.0.1.dev63}/tinybird/tb/modules/datafile/build_common.py +0 -0
  39. {tinybird-0.0.1.dev61 → tinybird-0.0.1.dev63}/tinybird/tb/modules/datafile/build_datasource.py +0 -0
  40. {tinybird-0.0.1.dev61 → tinybird-0.0.1.dev63}/tinybird/tb/modules/datafile/build_pipe.py +0 -0
  41. {tinybird-0.0.1.dev61 → tinybird-0.0.1.dev63}/tinybird/tb/modules/datafile/common.py +0 -0
  42. {tinybird-0.0.1.dev61 → tinybird-0.0.1.dev63}/tinybird/tb/modules/datafile/diff.py +0 -0
  43. {tinybird-0.0.1.dev61 → tinybird-0.0.1.dev63}/tinybird/tb/modules/datafile/exceptions.py +0 -0
  44. {tinybird-0.0.1.dev61 → tinybird-0.0.1.dev63}/tinybird/tb/modules/datafile/fixture.py +0 -0
  45. {tinybird-0.0.1.dev61 → tinybird-0.0.1.dev63}/tinybird/tb/modules/datafile/format_common.py +0 -0
  46. {tinybird-0.0.1.dev61 → tinybird-0.0.1.dev63}/tinybird/tb/modules/datafile/format_datasource.py +0 -0
  47. {tinybird-0.0.1.dev61 → tinybird-0.0.1.dev63}/tinybird/tb/modules/datafile/format_pipe.py +0 -0
  48. {tinybird-0.0.1.dev61 → tinybird-0.0.1.dev63}/tinybird/tb/modules/datafile/parse_datasource.py +0 -0
  49. {tinybird-0.0.1.dev61 → tinybird-0.0.1.dev63}/tinybird/tb/modules/datafile/pipe_checker.py +0 -0
  50. {tinybird-0.0.1.dev61 → tinybird-0.0.1.dev63}/tinybird/tb/modules/datafile/pull.py +0 -0
  51. {tinybird-0.0.1.dev61 → tinybird-0.0.1.dev63}/tinybird/tb/modules/datasource.py +0 -0
  52. {tinybird-0.0.1.dev61 → tinybird-0.0.1.dev63}/tinybird/tb/modules/deployment.py +0 -0
  53. {tinybird-0.0.1.dev61 → tinybird-0.0.1.dev63}/tinybird/tb/modules/exceptions.py +0 -0
  54. {tinybird-0.0.1.dev61 → tinybird-0.0.1.dev63}/tinybird/tb/modules/feedback_manager.py +0 -0
  55. {tinybird-0.0.1.dev61 → tinybird-0.0.1.dev63}/tinybird/tb/modules/fmt.py +0 -0
  56. {tinybird-0.0.1.dev61 → tinybird-0.0.1.dev63}/tinybird/tb/modules/job.py +0 -0
  57. {tinybird-0.0.1.dev61 → tinybird-0.0.1.dev63}/tinybird/tb/modules/llm.py +0 -0
  58. {tinybird-0.0.1.dev61 → tinybird-0.0.1.dev63}/tinybird/tb/modules/llm_utils.py +0 -0
  59. {tinybird-0.0.1.dev61 → tinybird-0.0.1.dev63}/tinybird/tb/modules/local.py +0 -0
  60. {tinybird-0.0.1.dev61 → tinybird-0.0.1.dev63}/tinybird/tb/modules/login.py +0 -0
  61. {tinybird-0.0.1.dev61 → tinybird-0.0.1.dev63}/tinybird/tb/modules/materialization.py +0 -0
  62. {tinybird-0.0.1.dev61 → tinybird-0.0.1.dev63}/tinybird/tb/modules/mock.py +0 -0
  63. {tinybird-0.0.1.dev61 → tinybird-0.0.1.dev63}/tinybird/tb/modules/pipe.py +0 -0
  64. {tinybird-0.0.1.dev61 → tinybird-0.0.1.dev63}/tinybird/tb/modules/project.py +0 -0
  65. {tinybird-0.0.1.dev61 → tinybird-0.0.1.dev63}/tinybird/tb/modules/regions.py +0 -0
  66. {tinybird-0.0.1.dev61 → tinybird-0.0.1.dev63}/tinybird/tb/modules/shell.py +0 -0
  67. {tinybird-0.0.1.dev61 → tinybird-0.0.1.dev63}/tinybird/tb/modules/table.py +0 -0
  68. {tinybird-0.0.1.dev61 → tinybird-0.0.1.dev63}/tinybird/tb/modules/tag.py +0 -0
  69. {tinybird-0.0.1.dev61 → tinybird-0.0.1.dev63}/tinybird/tb/modules/telemetry.py +0 -0
  70. {tinybird-0.0.1.dev61 → tinybird-0.0.1.dev63}/tinybird/tb/modules/test.py +0 -0
  71. {tinybird-0.0.1.dev61 → tinybird-0.0.1.dev63}/tinybird/tb/modules/tinyunit/tinyunit.py +0 -0
  72. {tinybird-0.0.1.dev61 → tinybird-0.0.1.dev63}/tinybird/tb/modules/tinyunit/tinyunit_lib.py +0 -0
  73. {tinybird-0.0.1.dev61 → tinybird-0.0.1.dev63}/tinybird/tb/modules/token.py +0 -0
  74. {tinybird-0.0.1.dev61 → tinybird-0.0.1.dev63}/tinybird/tb/modules/watch.py +0 -0
  75. {tinybird-0.0.1.dev61 → tinybird-0.0.1.dev63}/tinybird/tb/modules/workspace.py +0 -0
  76. {tinybird-0.0.1.dev61 → tinybird-0.0.1.dev63}/tinybird/tb/modules/workspace_members.py +0 -0
  77. {tinybird-0.0.1.dev61 → tinybird-0.0.1.dev63}/tinybird/tb_cli.py +0 -0
  78. {tinybird-0.0.1.dev61 → tinybird-0.0.1.dev63}/tinybird/tb_cli_modules/auth.py +0 -0
  79. {tinybird-0.0.1.dev61 → tinybird-0.0.1.dev63}/tinybird/tb_cli_modules/branch.py +0 -0
  80. {tinybird-0.0.1.dev61 → tinybird-0.0.1.dev63}/tinybird/tb_cli_modules/cicd.py +0 -0
  81. {tinybird-0.0.1.dev61 → tinybird-0.0.1.dev63}/tinybird/tb_cli_modules/cli.py +0 -0
  82. {tinybird-0.0.1.dev61 → tinybird-0.0.1.dev63}/tinybird/tb_cli_modules/config.py +0 -0
  83. {tinybird-0.0.1.dev61 → tinybird-0.0.1.dev63}/tinybird/tb_cli_modules/datasource.py +0 -0
  84. {tinybird-0.0.1.dev61 → tinybird-0.0.1.dev63}/tinybird/tb_cli_modules/exceptions.py +0 -0
  85. {tinybird-0.0.1.dev61 → tinybird-0.0.1.dev63}/tinybird/tb_cli_modules/fmt.py +0 -0
  86. {tinybird-0.0.1.dev61 → tinybird-0.0.1.dev63}/tinybird/tb_cli_modules/job.py +0 -0
  87. {tinybird-0.0.1.dev61 → tinybird-0.0.1.dev63}/tinybird/tb_cli_modules/pipe.py +0 -0
  88. {tinybird-0.0.1.dev61 → tinybird-0.0.1.dev63}/tinybird/tb_cli_modules/regions.py +0 -0
  89. {tinybird-0.0.1.dev61 → tinybird-0.0.1.dev63}/tinybird/tb_cli_modules/tag.py +0 -0
  90. {tinybird-0.0.1.dev61 → tinybird-0.0.1.dev63}/tinybird/tb_cli_modules/telemetry.py +0 -0
  91. {tinybird-0.0.1.dev61 → tinybird-0.0.1.dev63}/tinybird/tb_cli_modules/test.py +0 -0
  92. {tinybird-0.0.1.dev61 → tinybird-0.0.1.dev63}/tinybird/tb_cli_modules/tinyunit/tinyunit.py +0 -0
  93. {tinybird-0.0.1.dev61 → tinybird-0.0.1.dev63}/tinybird/tb_cli_modules/tinyunit/tinyunit_lib.py +0 -0
  94. {tinybird-0.0.1.dev61 → tinybird-0.0.1.dev63}/tinybird/tb_cli_modules/workspace.py +0 -0
  95. {tinybird-0.0.1.dev61 → tinybird-0.0.1.dev63}/tinybird/tb_cli_modules/workspace_members.py +0 -0
  96. {tinybird-0.0.1.dev61 → tinybird-0.0.1.dev63}/tinybird/tornado_template.py +0 -0
  97. {tinybird-0.0.1.dev61 → tinybird-0.0.1.dev63}/tinybird.egg-info/SOURCES.txt +0 -0
  98. {tinybird-0.0.1.dev61 → tinybird-0.0.1.dev63}/tinybird.egg-info/dependency_links.txt +0 -0
  99. {tinybird-0.0.1.dev61 → tinybird-0.0.1.dev63}/tinybird.egg-info/entry_points.txt +0 -0
  100. {tinybird-0.0.1.dev61 → tinybird-0.0.1.dev63}/tinybird.egg-info/requires.txt +0 -0
  101. {tinybird-0.0.1.dev61 → tinybird-0.0.1.dev63}/tinybird.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: tinybird
3
- Version: 0.0.1.dev61
3
+ Version: 0.0.1.dev63
4
4
  Summary: Tinybird Command Line Tool
5
5
  Home-page: https://www.tinybird.co/docs/cli/introduction.html
6
6
  Author: Tinybird
@@ -49,12 +49,6 @@ LEGACY_HOSTS = {
49
49
  "https://ui.us-west-2.aws.tinybird.co": "https://app.tinybird.co/aws/us-west-2",
50
50
  "https://ui.eu-central-1.aws.tinybird.co": "https://app.tinybird.co/aws/eu-central-1",
51
51
  "https://ui.ap-east.aws.tinybird.co": "https://app.tinybird.co/aws/ap-east",
52
- "https://inditex-tech.tinybird.co": "https://app.inditex.tinybird.co/gcp/inditex-tech",
53
- "https://inditex-c-stg.tinybird.co": "https://app.inditex.tinybird.co/gcp/inditex-c-stg",
54
- "https://inditex-c-pro.tinybird.co": "https://app.inditex.tinybird.co/gcp/inditex-c-pro",
55
- "https://inditex-z-stg.tinybird.co": "https://app.inditex.tinybird.co/gcp/inditex-z-stg",
56
- "https://inditex-rt-pro.tinybird.co": "https://app.inditex.tinybird.co/gcp/inditex-rt-pro",
57
- "https://inditex-pro.tinybird.co": "https://app.inditex.tinybird.co/gcp/inditex-pro",
58
52
  "https://ui.split.tinybird.co": "https://app.tinybird.co/aws/split-us-east",
59
53
  "https://ui.split.us-west-2.aws.tinybird.co": "https://app.tinybird.co/aws/split-us-west-2",
60
54
  "https://api.split.tinybird.co": "https://app.tinybird.co/aws/split-us-east",
@@ -116,3 +110,7 @@ class FeatureFlags:
116
110
  @classmethod
117
111
  def is_localhost(cls) -> bool:
118
112
  return "SET_LOCALHOST" in environ
113
+
114
+ @classmethod
115
+ def enable_snowflake_connector_command(cls) -> bool:
116
+ return "ENABLE_SNOWFLAKE_CONNECTOR_COMMAND" in environ
@@ -420,6 +420,9 @@ class FeedbackManager:
420
420
  error_updating_tag = error_message("Error updating tag: {error}")
421
421
  error_tag_generic = error_message("There was an issue updating tags. {error}")
422
422
  error_tag_not_found = error_message("Tag {tag_name} not found.")
423
+ error_snowflake_connector_not_enabled = error_message(
424
+ "🚨🚨🚨 [DEPRECATED] Snowflake connector is deprecated. Can't create the connector. **"
425
+ )
423
426
 
424
427
  info_incl_relative_path = info_message("** Relative path {path} does not exist, skipping.")
425
428
  info_ignoring_incl_file = info_message(
@@ -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.dev61'
8
- __revision__ = '0fed0e1'
7
+ __version__ = '0.0.1.dev63'
8
+ __revision__ = '4d0f19d'
@@ -321,10 +321,6 @@ class CLIConfig:
321
321
  """
322
322
  working_dir = working_dir or os.getcwd()
323
323
  path: str = os.path.join(working_dir, ".tinyb")
324
-
325
- if not os.path.exists(path):
326
- path = os.path.join(os.path.dirname(working_dir), ".tinyb")
327
-
328
324
  return CLIConfig(path, parent=CLIConfig.get_global_config())
329
325
 
330
326
  @staticmethod
@@ -47,6 +47,8 @@ def parse_pipe(
47
47
  finally:
48
48
  raise e
49
49
  for node in doc.nodes:
50
+ if "type" in node:
51
+ node["type"] = node["type"].lower()
50
52
  sql = node.get("sql", "")
51
53
  if sql.strip()[0] == "%":
52
54
  # Note(eclbg): not sure what test_mode is for. I think it does something like using placeholder values
@@ -10,6 +10,7 @@ from urllib.parse import urlencode
10
10
 
11
11
  import click
12
12
  import humanfriendly
13
+ import pyperclip
13
14
  import requests
14
15
  from click import Context
15
16
 
@@ -54,7 +55,7 @@ async def endpoint_ls(ctx: Context, match: str, format_: str):
54
55
  tk = get_name_version(t["name"])
55
56
  if pattern and not pattern.search(tk["name"]):
56
57
  continue
57
- token = get_endpoint_token(tokens, tk["name"])
58
+ token = get_endpoint_token(tokens, tk["name"]) or client.token
58
59
  endpoint_url = build_endpoint_url(client, tk["name"], token)
59
60
  table_human_readable.append((tk["name"], t["updated_at"][:-7], len(t["nodes"]), endpoint_url))
60
61
  table_machine_readable.append(
@@ -151,29 +152,23 @@ async def endpoint_data(ctx: Context, pipe: str, query: str, format_: str):
151
152
 
152
153
  @endpoint.command(name="url")
153
154
  @click.argument("pipe")
155
+ @click.option(
156
+ "--language",
157
+ default="http",
158
+ help="Language used for sending the request. Options: http, python, curl, javascript, rust, go",
159
+ )
154
160
  @click.pass_context
155
161
  @coro
156
- async def endpoint_url(ctx: Context, pipe: str):
162
+ async def endpoint_url(ctx: Context, pipe: str, language: str):
157
163
  """Print the URL of an endpoint"""
164
+ if language != "http":
165
+ click.echo(FeedbackManager.highlight(message=f"\n» Generating snippet for {language} language"))
158
166
  client: TinyB = ctx.ensure_object(dict)["client"]
159
167
  tokens = await client.tokens()
160
- token = get_endpoint_token(tokens, pipe)
161
- click.echo(build_endpoint_url(client, pipe, token))
162
-
163
-
164
- def build_endpoint_url(tb_client: TinyB, pipe_name: str, token: Optional[str]) -> Optional[str]:
165
- try:
166
- token = token or tb_client.token
167
- example_params = {
168
- "format": "json",
169
- "pipe": pipe_name,
170
- "q": "",
171
- "token": token,
172
- }
173
- response = requests.get(f"{tb_client.host}/examples/query.http?{urlencode(example_params)}")
174
- return response.text.replace("http://localhost:8001", tb_client.host)
175
- except Exception:
176
- return None
168
+ token = get_endpoint_token(tokens, pipe) or client.token
169
+ click.echo(build_endpoint_snippet(client, pipe, token, language))
170
+ if language != "http":
171
+ click.echo(FeedbackManager.success(message="\n✓ Code snippet copied to clipboard!\n"))
177
172
 
178
173
 
179
174
  def get_endpoint_token(tokens: List[Dict[str, Any]], pipe_name: str) -> Optional[str]:
@@ -272,3 +267,104 @@ async def endpoint_stats(ctx: click.Context, pipes: Tuple[str, ...], format_: st
272
267
  click.echo(json.dumps({"pipes": table_machine_readable}, indent=2))
273
268
  else:
274
269
  echo_safe_humanfriendly_tables_format_smart_table(table_human_readable, column_names=columns)
270
+
271
+
272
+ def build_endpoint_snippet(tb_client: TinyB, pipe_name: str, token: Optional[str], language: str) -> Optional[str]:
273
+ endpoint_url = build_endpoint_url(tb_client, pipe_name, token)
274
+ if language == "http":
275
+ return endpoint_url
276
+
277
+ snippet = None
278
+ if language == "python":
279
+ snippet = build_python_snippet(endpoint_url, token)
280
+ elif language == "curl":
281
+ snippet = build_curl_snippet(endpoint_url)
282
+ elif language == "javascript":
283
+ snippet = build_javascript_snippet(endpoint_url, token)
284
+ elif language == "rust":
285
+ snippet = build_rust_snippet(endpoint_url, token)
286
+ elif language == "go":
287
+ snippet = build_go_snippet(endpoint_url, token)
288
+
289
+ if not snippet:
290
+ raise CLIPipeException(FeedbackManager.error(message=f"Language {language} not supported"))
291
+
292
+ pyperclip.copy(snippet.strip())
293
+ return snippet
294
+
295
+
296
+ def build_endpoint_url(tb_client: TinyB, pipe_name: str, token: str) -> str:
297
+ example_params = {
298
+ "format": "json",
299
+ "pipe": pipe_name,
300
+ "q": "",
301
+ "token": token,
302
+ }
303
+ response = requests.get(f"{tb_client.host}/examples/query.http?{urlencode(example_params)}")
304
+ return response.text.replace("http://localhost:8001", tb_client.host)
305
+
306
+
307
+ def build_python_snippet(endpoint_url: str, token: str) -> str:
308
+ endpoint_url = endpoint_url.replace(f"token={token}", "token={{token}}")
309
+ return f"""
310
+ import requests
311
+
312
+ token = "{token}"
313
+ url = "{endpoint_url}"
314
+ response = requests.get(url)
315
+ print(response.json())
316
+ """
317
+
318
+
319
+ def build_curl_snippet(endpoint_url: str) -> str:
320
+ return f"""
321
+ curl -X GET "{endpoint_url}"
322
+ """
323
+
324
+
325
+ def build_javascript_snippet(endpoint_url: str, token: str) -> str:
326
+ endpoint_url = endpoint_url.replace(f"token={token}", "token=${token}")
327
+ return f"""
328
+ const token = "{token}";
329
+ fetch(`{endpoint_url}`)
330
+ .then(response => response.json())
331
+ .then(data => console.log(data));
332
+ """
333
+
334
+
335
+ def build_rust_snippet(endpoint_url: str) -> str:
336
+ return f"""
337
+ use reqwest::Client;
338
+
339
+ let client = Client::new();
340
+ let response = client.get("{endpoint_url}").send().await?;
341
+ """
342
+
343
+
344
+ def build_go_snippet(endpoint_url: str) -> str:
345
+ return f"""
346
+ package main
347
+
348
+ import (
349
+ "fmt"
350
+ "io"
351
+ "log"
352
+ "net/http"
353
+ )
354
+
355
+ func main() {{
356
+ url := "{endpoint_url}"
357
+ resp, err := http.Get(url)
358
+ if err != nil {{
359
+ log.Fatal(err)
360
+ }}
361
+ defer resp.Body.Close()
362
+
363
+ body, err := io.ReadAll(resp.Body)
364
+ if err != nil {{
365
+ log.Fatal(err)
366
+ }}
367
+
368
+ fmt.Println(string(body))
369
+ }}
370
+ """
@@ -5,8 +5,9 @@ from typing import Any, Dict
5
5
 
6
6
  import requests
7
7
 
8
- from tinybird.client import AuthException, AuthNoTokenException, TinyB
8
+ from tinybird.client import AuthNoTokenException, TinyB
9
9
  from tinybird.tb.modules.config import CLIConfig
10
+ from tinybird.tb.modules.exceptions import CLIException
10
11
 
11
12
  TB_IMAGE_NAME = "tinybirdco/tinybird-local:beta"
12
13
  TB_CONTAINER_NAME = "tinybird-local"
@@ -32,7 +33,7 @@ async def get_tinybird_local_config(config_obj: Dict[str, Any], build: bool = Fa
32
33
  # ruff: noqa: ASYNC210
33
34
  tokens = requests.get(f"{TB_LOCAL_HOST}/tokens").json()
34
35
  except Exception:
35
- raise AuthException("Error: Tinybird local is not running. Please run `tb local start` first.")
36
+ raise CLIException("Tinybird local is not running. Please run `tb local start` first.")
36
37
 
37
38
  user_token = tokens["user_token"]
38
39
  admin_token = tokens["admin_token"]
@@ -593,8 +593,6 @@ def format_host(host: str, subdomain: Optional[str] = None) -> str:
593
593
  'https://api.us-east.tinybird.co'
594
594
  >>> format_host('https://ui.us-east.tinybird.co', subdomain='api')
595
595
  'https://api.us-east.tinybird.co'
596
- >>> format_host('https://inditex-rt-pro.tinybird.co', subdomain='ui')
597
- 'https://inditex-rt-pro.tinybird.co'
598
596
  >>> format_host('https://cluiente-tricky.tinybird.co', subdomain='api')
599
597
  'https://cluiente-tricky.tinybird.co'
600
598
  """
@@ -13,6 +13,7 @@ import click
13
13
  from click import Context
14
14
 
15
15
  from tinybird.client import DoesNotExistException, TinyB
16
+ from tinybird.config import FeatureFlags
16
17
  from tinybird.feedback_manager import FeedbackManager
17
18
  from tinybird.tb_cli_modules.cli import cli
18
19
  from tinybird.tb_cli_modules.common import (
@@ -193,7 +194,9 @@ async def connection_create_kafka(
193
194
  click.echo(FeedbackManager.success_connection_created(id=id))
194
195
 
195
196
 
196
- @connection_create.command(name="snowflake", short_help="Creates a Snowflake connection in the current workspace")
197
+ @connection_create.command(
198
+ name="snowflake", short_help="Creates a Snowflake connection in the current workspace", hidden=True
199
+ )
197
200
  @click.option("--account", help="The account identifier of your Snowflake account (e.g. myorg-account123)")
198
201
  @click.option("--username", help="The Snowflake user you want to use for the connection")
199
202
  @click.option("--password", help="The Snowflake password of the chosen user")
@@ -242,6 +245,11 @@ async def connection_create_snowflake(
242
245
  $ tb connection create snowflake
243
246
  """
244
247
 
248
+ snowflake_connector_enabled = FeatureFlags.enable_snowflake_connector_command()
249
+ if not snowflake_connector_enabled:
250
+ click.echo(FeedbackManager.error_snowflake_connector_not_enabled())
251
+ return
252
+
245
253
  obj: Dict[str, Any] = ctx.ensure_object(dict)
246
254
  client: TinyB = obj["client"]
247
255
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: tinybird
3
- Version: 0.0.1.dev61
3
+ Version: 0.0.1.dev63
4
4
  Summary: Tinybird Command Line Tool
5
5
  Home-page: https://www.tinybird.co/docs/cli/introduction.html
6
6
  Author: Tinybird
File without changes