tinybird-cli 5.6.1.dev0__tar.gz → 5.6.1.dev2__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.
- {tinybird-cli-5.6.1.dev0 → tinybird-cli-5.6.1.dev2}/PKG-INFO +12 -1
- {tinybird-cli-5.6.1.dev0 → tinybird-cli-5.6.1.dev2}/tinybird/__cli__.py +2 -2
- {tinybird-cli-5.6.1.dev0 → tinybird-cli-5.6.1.dev2}/tinybird/datafile.py +17 -12
- {tinybird-cli-5.6.1.dev0 → tinybird-cli-5.6.1.dev2}/tinybird/feedback_manager.py +1 -0
- {tinybird-cli-5.6.1.dev0 → tinybird-cli-5.6.1.dev2}/tinybird/tb_cli_modules/auth.py +12 -2
- {tinybird-cli-5.6.1.dev0 → tinybird-cli-5.6.1.dev2}/tinybird_cli.egg-info/PKG-INFO +12 -1
- {tinybird-cli-5.6.1.dev0 → tinybird-cli-5.6.1.dev2}/setup.cfg +0 -0
- {tinybird-cli-5.6.1.dev0 → tinybird-cli-5.6.1.dev2}/tinybird/ch_utils/constants.py +0 -0
- {tinybird-cli-5.6.1.dev0 → tinybird-cli-5.6.1.dev2}/tinybird/ch_utils/engine.py +0 -0
- {tinybird-cli-5.6.1.dev0 → tinybird-cli-5.6.1.dev2}/tinybird/check_pypi.py +0 -0
- {tinybird-cli-5.6.1.dev0 → tinybird-cli-5.6.1.dev2}/tinybird/client.py +0 -0
- {tinybird-cli-5.6.1.dev0 → tinybird-cli-5.6.1.dev2}/tinybird/config.py +0 -0
- {tinybird-cli-5.6.1.dev0 → tinybird-cli-5.6.1.dev2}/tinybird/connectors.py +0 -0
- {tinybird-cli-5.6.1.dev0 → tinybird-cli-5.6.1.dev2}/tinybird/context.py +0 -0
- {tinybird-cli-5.6.1.dev0 → tinybird-cli-5.6.1.dev2}/tinybird/datatypes.py +0 -0
- {tinybird-cli-5.6.1.dev0 → tinybird-cli-5.6.1.dev2}/tinybird/git_settings.py +0 -0
- {tinybird-cli-5.6.1.dev0 → tinybird-cli-5.6.1.dev2}/tinybird/sql.py +0 -0
- {tinybird-cli-5.6.1.dev0 → tinybird-cli-5.6.1.dev2}/tinybird/sql_template.py +0 -0
- {tinybird-cli-5.6.1.dev0 → tinybird-cli-5.6.1.dev2}/tinybird/sql_template_fmt.py +0 -0
- {tinybird-cli-5.6.1.dev0 → tinybird-cli-5.6.1.dev2}/tinybird/sql_toolset.py +0 -0
- {tinybird-cli-5.6.1.dev0 → tinybird-cli-5.6.1.dev2}/tinybird/syncasync.py +0 -0
- {tinybird-cli-5.6.1.dev0 → tinybird-cli-5.6.1.dev2}/tinybird/tb_cli.py +0 -0
- {tinybird-cli-5.6.1.dev0 → tinybird-cli-5.6.1.dev2}/tinybird/tb_cli_modules/branch.py +0 -0
- {tinybird-cli-5.6.1.dev0 → tinybird-cli-5.6.1.dev2}/tinybird/tb_cli_modules/cicd.py +0 -0
- {tinybird-cli-5.6.1.dev0 → tinybird-cli-5.6.1.dev2}/tinybird/tb_cli_modules/cli.py +0 -0
- {tinybird-cli-5.6.1.dev0 → tinybird-cli-5.6.1.dev2}/tinybird/tb_cli_modules/common.py +0 -0
- {tinybird-cli-5.6.1.dev0 → tinybird-cli-5.6.1.dev2}/tinybird/tb_cli_modules/config.py +0 -0
- {tinybird-cli-5.6.1.dev0 → tinybird-cli-5.6.1.dev2}/tinybird/tb_cli_modules/connection.py +0 -0
- {tinybird-cli-5.6.1.dev0 → tinybird-cli-5.6.1.dev2}/tinybird/tb_cli_modules/datasource.py +0 -0
- {tinybird-cli-5.6.1.dev0 → tinybird-cli-5.6.1.dev2}/tinybird/tb_cli_modules/exceptions.py +0 -0
- {tinybird-cli-5.6.1.dev0 → tinybird-cli-5.6.1.dev2}/tinybird/tb_cli_modules/job.py +0 -0
- {tinybird-cli-5.6.1.dev0 → tinybird-cli-5.6.1.dev2}/tinybird/tb_cli_modules/pipe.py +0 -0
- {tinybird-cli-5.6.1.dev0 → tinybird-cli-5.6.1.dev2}/tinybird/tb_cli_modules/regions.py +0 -0
- {tinybird-cli-5.6.1.dev0 → tinybird-cli-5.6.1.dev2}/tinybird/tb_cli_modules/telemetry.py +0 -0
- {tinybird-cli-5.6.1.dev0 → tinybird-cli-5.6.1.dev2}/tinybird/tb_cli_modules/test.py +0 -0
- {tinybird-cli-5.6.1.dev0 → tinybird-cli-5.6.1.dev2}/tinybird/tb_cli_modules/tinyunit/tinyunit.py +0 -0
- {tinybird-cli-5.6.1.dev0 → tinybird-cli-5.6.1.dev2}/tinybird/tb_cli_modules/tinyunit/tinyunit_lib.py +0 -0
- {tinybird-cli-5.6.1.dev0 → tinybird-cli-5.6.1.dev2}/tinybird/tb_cli_modules/token.py +0 -0
- {tinybird-cli-5.6.1.dev0 → tinybird-cli-5.6.1.dev2}/tinybird/tb_cli_modules/workspace.py +0 -0
- {tinybird-cli-5.6.1.dev0 → tinybird-cli-5.6.1.dev2}/tinybird/tb_cli_modules/workspace_members.py +0 -0
- {tinybird-cli-5.6.1.dev0 → tinybird-cli-5.6.1.dev2}/tinybird/tornado_template.py +0 -0
- {tinybird-cli-5.6.1.dev0 → tinybird-cli-5.6.1.dev2}/tinybird_cli.egg-info/SOURCES.txt +0 -0
- {tinybird-cli-5.6.1.dev0 → tinybird-cli-5.6.1.dev2}/tinybird_cli.egg-info/dependency_links.txt +0 -0
- {tinybird-cli-5.6.1.dev0 → tinybird-cli-5.6.1.dev2}/tinybird_cli.egg-info/entry_points.txt +0 -0
- {tinybird-cli-5.6.1.dev0 → tinybird-cli-5.6.1.dev2}/tinybird_cli.egg-info/requires.txt +0 -0
- {tinybird-cli-5.6.1.dev0 → tinybird-cli-5.6.1.dev2}/tinybird_cli.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: tinybird-cli
|
|
3
|
-
Version: 5.6.1.
|
|
3
|
+
Version: 5.6.1.dev2
|
|
4
4
|
Summary: Tinybird Command Line Tool
|
|
5
5
|
Home-page: https://www.tinybird.co/docs/cli/introduction.html
|
|
6
6
|
Author: Tinybird
|
|
@@ -18,6 +18,17 @@ The Tinybird command-line tool allows you to use all the Tinybird functionality
|
|
|
18
18
|
Changelog
|
|
19
19
|
----------
|
|
20
20
|
|
|
21
|
+
5.6.1.dev2
|
|
22
|
+
**********
|
|
23
|
+
|
|
24
|
+
- `Changed` support `prod` as main git branch name when running `tb init --git`
|
|
25
|
+
|
|
26
|
+
5.6.1.dev1
|
|
27
|
+
**********
|
|
28
|
+
|
|
29
|
+
- `Fixed` issue with `tb auth` when using `--region` and `--token` options together.
|
|
30
|
+
- `Fixed` `tb auth` behavior when the `TB_TOKEN` env var is set.
|
|
31
|
+
|
|
21
32
|
5.6.0
|
|
22
33
|
**********
|
|
23
34
|
|
|
@@ -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__ = '5.6.1.
|
|
8
|
-
__revision__ = '
|
|
7
|
+
__version__ = '5.6.1.dev2'
|
|
8
|
+
__revision__ = '6379e18'
|
|
@@ -205,9 +205,9 @@ class ExportReplacements:
|
|
|
205
205
|
("export_format", "format", "csv"),
|
|
206
206
|
("export_compression", "compression", None),
|
|
207
207
|
("export_strategy", "strategy", "@new"),
|
|
208
|
+
("export_kafka_topic", "kafka_topic", None),
|
|
208
209
|
("kafka_connection_name", "connection", None),
|
|
209
210
|
("kafka_topic", "kafka_topic", None),
|
|
210
|
-
("kafka_group_id", "kafka_group_id", None),
|
|
211
211
|
)
|
|
212
212
|
|
|
213
213
|
@staticmethod
|
|
@@ -216,6 +216,10 @@ class ExportReplacements:
|
|
|
216
216
|
return "kafka"
|
|
217
217
|
return (node.get("export_service", "") or "").lower()
|
|
218
218
|
|
|
219
|
+
@staticmethod
|
|
220
|
+
def get_node_type(node: Dict[str, Optional[str]]) -> str:
|
|
221
|
+
return (node.get("type", "standard") or "standard").lower()
|
|
222
|
+
|
|
219
223
|
@staticmethod
|
|
220
224
|
def is_export_node(node: Dict[str, Optional[str]]) -> bool:
|
|
221
225
|
export_service = ExportReplacements.get_export_service(node)
|
|
@@ -232,11 +236,11 @@ class ExportReplacements:
|
|
|
232
236
|
def get_params_from_datafile(node: Dict[str, Optional[str]]) -> Dict[str, Optional[str]]:
|
|
233
237
|
"""Returns the export parameters for a given node."""
|
|
234
238
|
params = {}
|
|
235
|
-
|
|
239
|
+
node_type = ExportReplacements.get_node_type(node)
|
|
236
240
|
for datafile_key, export_key, default_value in ExportReplacements._REPLACEMENTS:
|
|
237
|
-
if
|
|
241
|
+
if node_type != PipeNodeTypes.STREAM and datafile_key.startswith("kafka_"):
|
|
238
242
|
continue
|
|
239
|
-
if
|
|
243
|
+
if node_type == PipeNodeTypes.STREAM and datafile_key.startswith("export_"):
|
|
240
244
|
continue
|
|
241
245
|
if datafile_key == "export_schedule" and node.get(datafile_key, None) == ON_DEMAND:
|
|
242
246
|
node[datafile_key] = ""
|
|
@@ -246,14 +250,14 @@ class ExportReplacements:
|
|
|
246
250
|
@staticmethod
|
|
247
251
|
def get_datafile_key(param: str, node: Dict[str, Optional[str]]) -> Optional[str]:
|
|
248
252
|
"""Returns the datafile key for a given export parameter."""
|
|
249
|
-
|
|
250
|
-
for
|
|
251
|
-
if
|
|
253
|
+
node_type = ExportReplacements.get_node_type(node)
|
|
254
|
+
for datafile_key, export_key, _ in ExportReplacements._REPLACEMENTS:
|
|
255
|
+
if node_type != PipeNodeTypes.STREAM and datafile_key.startswith("kafka_"):
|
|
252
256
|
continue
|
|
253
|
-
if
|
|
257
|
+
if node_type == PipeNodeTypes.STREAM and datafile_key.startswith("export_"):
|
|
254
258
|
continue
|
|
255
|
-
if
|
|
256
|
-
return
|
|
259
|
+
if export_key == param.lower():
|
|
260
|
+
return datafile_key.upper()
|
|
257
261
|
return None
|
|
258
262
|
|
|
259
263
|
|
|
@@ -355,7 +359,7 @@ class CLIGitRelease:
|
|
|
355
359
|
return self.head().commit.hexsha
|
|
356
360
|
|
|
357
361
|
def is_main_branch(self) -> bool:
|
|
358
|
-
return self.repo.active_branch.name in ["main", "master", "develop"]
|
|
362
|
+
return self.repo.active_branch.name in ["main", "master", "develop", "dev", "prod"]
|
|
359
363
|
|
|
360
364
|
def is_head_empty(self) -> bool:
|
|
361
365
|
return not self.repo.head.is_valid()
|
|
@@ -1160,6 +1164,7 @@ def parse(
|
|
|
1160
1164
|
"export_format": assign_var("export_format"),
|
|
1161
1165
|
"export_strategy": assign_var("export_strategy"),
|
|
1162
1166
|
"export_compression": assign_var("export_compression"),
|
|
1167
|
+
"export_kafka_topic": assign_var("export_kafka_topic"),
|
|
1163
1168
|
}
|
|
1164
1169
|
|
|
1165
1170
|
engine_vars = set()
|
|
@@ -4815,7 +4820,7 @@ async def format_node_type(file_parts: List[str], node: Dict[str, Any]) -> List[
|
|
|
4815
4820
|
if param == "schedule_cron" and not value:
|
|
4816
4821
|
value = ON_DEMAND
|
|
4817
4822
|
datafile_key = ExportReplacements.get_datafile_key(param, node)
|
|
4818
|
-
if datafile_key:
|
|
4823
|
+
if datafile_key and value:
|
|
4819
4824
|
file_parts.append(f"{datafile_key} {value}")
|
|
4820
4825
|
file_parts.append(DATAFILE_NEW_LINE)
|
|
4821
4826
|
|
|
@@ -423,6 +423,7 @@ class FeedbackManager:
|
|
|
423
423
|
info_dry_minor_patch_release_no_autopromote = info_message(
|
|
424
424
|
"** [DRY RUN] Detected a minor or patch version: {version}. TB_AUTO_PROMOTE=0 detected, a new Release will be created in preview status."
|
|
425
425
|
)
|
|
426
|
+
info_reading_from_env = info_message("** Reading {value} from env var {envvar}")
|
|
426
427
|
info_releases_detected = info_message("** Live Release: {current_semver} => New Release: {semver}")
|
|
427
428
|
info_dry_releases_detected = info_message("** [DRY RUN] Live Release: {current_semver} => New Release: {semver}")
|
|
428
429
|
info_pre_prompt_auth_login_user_token = info_message(
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
# - If it makes sense and only when strictly necessary, you can create utility functions in this file.
|
|
4
4
|
# - But please, **do not** interleave utility functions and command definitions.
|
|
5
5
|
|
|
6
|
+
import os
|
|
6
7
|
from typing import Any, Dict, List, Optional
|
|
7
8
|
|
|
8
9
|
import click
|
|
@@ -65,18 +66,27 @@ async def auth(ctx: click.Context, token: str, host: str, region: str, connector
|
|
|
65
66
|
|
|
66
67
|
assert isinstance(ctx.parent, click.Context)
|
|
67
68
|
|
|
69
|
+
env_token = os.environ.get("TB_TOKEN", None)
|
|
70
|
+
|
|
68
71
|
# If no token passed, let's clear the current one to
|
|
69
72
|
# do a clean auth
|
|
70
|
-
if not token and not ctx.parent.params.get("token"):
|
|
73
|
+
if not token and not ctx.parent.params.get("token") and not env_token:
|
|
71
74
|
config.set_token(None)
|
|
75
|
+
else:
|
|
76
|
+
if env_token:
|
|
77
|
+
click.echo(FeedbackManager.info_reading_from_env(value="token", envvar="TB_TOKEN"))
|
|
72
78
|
|
|
73
79
|
regions: Optional[List[Region]] = None
|
|
80
|
+
try_all_regions = True
|
|
74
81
|
|
|
75
82
|
if region:
|
|
76
83
|
regions, host = await get_host_from_region_temp(config, region, config.get_host())
|
|
77
84
|
config.set_host(host)
|
|
85
|
+
if token:
|
|
86
|
+
config.set_token_for_host(token, host)
|
|
87
|
+
try_all_regions = False
|
|
78
88
|
|
|
79
|
-
if not await try_authenticate(config, regions=regions, interactive=interactive, try_all_regions=
|
|
89
|
+
if not await try_authenticate(config, regions=regions, interactive=interactive, try_all_regions=try_all_regions):
|
|
80
90
|
raise CLIAuthException(FeedbackManager.error_invalid_token_for_host(host=config.get_host()))
|
|
81
91
|
|
|
82
92
|
config.persist_to_file()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: tinybird-cli
|
|
3
|
-
Version: 5.6.1.
|
|
3
|
+
Version: 5.6.1.dev2
|
|
4
4
|
Summary: Tinybird Command Line Tool
|
|
5
5
|
Home-page: https://www.tinybird.co/docs/cli/introduction.html
|
|
6
6
|
Author: Tinybird
|
|
@@ -18,6 +18,17 @@ The Tinybird command-line tool allows you to use all the Tinybird functionality
|
|
|
18
18
|
Changelog
|
|
19
19
|
----------
|
|
20
20
|
|
|
21
|
+
5.6.1.dev2
|
|
22
|
+
**********
|
|
23
|
+
|
|
24
|
+
- `Changed` support `prod` as main git branch name when running `tb init --git`
|
|
25
|
+
|
|
26
|
+
5.6.1.dev1
|
|
27
|
+
**********
|
|
28
|
+
|
|
29
|
+
- `Fixed` issue with `tb auth` when using `--region` and `--token` options together.
|
|
30
|
+
- `Fixed` `tb auth` behavior when the `TB_TOKEN` env var is set.
|
|
31
|
+
|
|
21
32
|
5.6.0
|
|
22
33
|
**********
|
|
23
34
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{tinybird-cli-5.6.1.dev0 → tinybird-cli-5.6.1.dev2}/tinybird/tb_cli_modules/tinyunit/tinyunit.py
RENAMED
|
File without changes
|
{tinybird-cli-5.6.1.dev0 → tinybird-cli-5.6.1.dev2}/tinybird/tb_cli_modules/tinyunit/tinyunit_lib.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{tinybird-cli-5.6.1.dev0 → tinybird-cli-5.6.1.dev2}/tinybird/tb_cli_modules/workspace_members.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{tinybird-cli-5.6.1.dev0 → tinybird-cli-5.6.1.dev2}/tinybird_cli.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|