tinybird 5.0.0__tar.gz → 5.0.1__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-5.0.0 → tinybird-5.0.1}/PKG-INFO +7 -1
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/tb/__cli__.py +2 -2
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/tb/modules/branch.py +28 -12
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/tb/modules/cli.py +10 -1
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/tb/modules/datafile/build.py +2 -2
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/tb/modules/deployment.py +2 -2
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/tb/modules/feedback_manager.py +3 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/tb/modules/local.py +2 -2
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/tb/modules/login_common.py +1 -1
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/tb/modules/logs.py +5 -5
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/tb/modules/token.py +2 -2
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/tb_cli_modules/common.py +2 -2
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird.egg-info/PKG-INFO +7 -1
- {tinybird-5.0.0 → tinybird-5.0.1}/pyproject.toml +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/setup.cfg +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/__cli__.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/ch_utils/constants.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/ch_utils/engine.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/check_pypi.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/client.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/config.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/context.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/datafile/common.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/datafile/exceptions.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/datafile/parse_connection.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/datafile/parse_datasource.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/datafile/parse_pipe.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/datatypes.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/feedback_manager.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/git_settings.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/iterating/__init__.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/iterating/data_branch_modes.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/prompts.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/service_datasources.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/sql.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/sql_template.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/sql_template_fmt.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/sql_toolset.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/syncasync.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/tb/check_pypi.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/tb/cli.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/tb/client.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/tb/config.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/tb/modules/build.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/tb/modules/build_common.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/tb/modules/cicd.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/tb/modules/common.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/tb/modules/config.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/tb/modules/connection.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/tb/modules/connection_dynamodb.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/tb/modules/connection_kafka.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/tb/modules/connection_s3.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/tb/modules/copy.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/tb/modules/create.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/tb/modules/datafile/build_common.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/tb/modules/datafile/build_datasource.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/tb/modules/datafile/build_pipe.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/tb/modules/datafile/diff.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/tb/modules/datafile/fixture.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/tb/modules/datafile/format_common.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/tb/modules/datafile/format_connection.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/tb/modules/datafile/format_datasource.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/tb/modules/datafile/format_pipe.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/tb/modules/datafile/pipe_checker.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/tb/modules/datafile/playground.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/tb/modules/datafile/pull.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/tb/modules/datasource.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/tb/modules/deployment_common.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/tb/modules/deprecations.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/tb/modules/endpoint.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/tb/modules/exceptions.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/tb/modules/fmt.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/tb/modules/info.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/tb/modules/infra.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/tb/modules/job.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/tb/modules/job_common.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/tb/modules/llm.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/tb/modules/llm_utils.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/tb/modules/local_common.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/tb/modules/local_logs.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/tb/modules/login.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/tb/modules/logout.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/tb/modules/materialization.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/tb/modules/open.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/tb/modules/pipe.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/tb/modules/preview.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/tb/modules/project.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/tb/modules/project_commands.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/tb/modules/py_project.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/tb/modules/query_output.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/tb/modules/regions.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/tb/modules/secret.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/tb/modules/secret_common.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/tb/modules/sink.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/tb/modules/table.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/tb/modules/telemetry.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/tb/modules/test.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/tb/modules/test_common.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/tb/modules/tinyunit/tinyunit.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/tb/modules/ts_project.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/tb/modules/watch.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/tb/modules/workspace.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/tb/modules/workspace_members.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/tb_cli.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/tb_cli_modules/auth.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/tb_cli_modules/branch.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/tb_cli_modules/cicd.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/tb_cli_modules/cli.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/tb_cli_modules/config.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/tb_cli_modules/connection.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/tb_cli_modules/datasource.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/tb_cli_modules/exceptions.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/tb_cli_modules/fmt.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/tb_cli_modules/job.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/tb_cli_modules/pipe.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/tb_cli_modules/regions.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/tb_cli_modules/tag.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/tb_cli_modules/telemetry.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/tb_cli_modules/test.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/tb_cli_modules/tinyunit/tinyunit.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/tb_cli_modules/workspace.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/tb_cli_modules/workspace_members.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/tornado_template.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/utils/__init__.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird/utils/bools.py +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird.egg-info/SOURCES.txt +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird.egg-info/dependency_links.txt +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird.egg-info/entry_points.txt +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird.egg-info/requires.txt +0 -0
- {tinybird-5.0.0 → tinybird-5.0.1}/tinybird.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: tinybird
|
|
3
|
-
Version: 5.0.
|
|
3
|
+
Version: 5.0.1
|
|
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,12 @@ The Tinybird command-line tool allows you to use all the Tinybird functionality
|
|
|
52
52
|
Changelog
|
|
53
53
|
----------
|
|
54
54
|
|
|
55
|
+
5.0.1
|
|
56
|
+
*******
|
|
57
|
+
|
|
58
|
+
- `Fixed` Git branches whose name starts with a digit (for example ``3-clean-up-tokens``) work with ``tb build`` and ``tb deploy``. Cloud branches keep the leading digit; Tinybird Local workspaces use a ``branch_`` prefix.
|
|
59
|
+
- `Fixed` ``tb branch clear <name>`` also finds the ``branch_``-prefixed name that ``tb branch create <name>`` generates. If the name matches more than one Branch, use the Branch ID.
|
|
60
|
+
|
|
55
61
|
5.0.0
|
|
56
62
|
*******
|
|
57
63
|
|
|
@@ -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__ = '5.0.
|
|
8
|
-
__revision__ = '
|
|
7
|
+
__version__ = '5.0.1'
|
|
8
|
+
__revision__ = '44d7abef'
|
|
@@ -7,7 +7,7 @@ from typing import Any, Dict, List, Optional, Tuple
|
|
|
7
7
|
|
|
8
8
|
import click
|
|
9
9
|
|
|
10
|
-
from tinybird.tb.modules.cli import _looks_like_uuid, cli, ensure_valid_workspace_name
|
|
10
|
+
from tinybird.tb.modules.cli import _looks_like_uuid, cli, ensure_valid_workspace_name, sanitize_branch_name
|
|
11
11
|
from tinybird.tb.modules.common import (
|
|
12
12
|
MAIN_BRANCH,
|
|
13
13
|
create_workspace_branch,
|
|
@@ -207,17 +207,33 @@ def clear_branch(
|
|
|
207
207
|
if branch_name_or_id:
|
|
208
208
|
if branch_name_or_id == MAIN_BRANCH:
|
|
209
209
|
raise CLIException(FeedbackManager.error_not_allowed_in_main_branch())
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
(
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
210
|
+
if _looks_like_uuid(branch_name_or_id):
|
|
211
|
+
lookup_candidates = [branch_name_or_id]
|
|
212
|
+
else:
|
|
213
|
+
# Git-derived branches keep a leading digit, `tb branch create` adds branch_.
|
|
214
|
+
unprefixed_name = sanitize_branch_name(branch_name_or_id, enforce_workspace_prefix_rules=False)
|
|
215
|
+
lookup_candidates = [unprefixed_name or branch_name_or_id, sanitize_branch_name(branch_name_or_id)]
|
|
216
|
+
lookup_branch_name_or_id = lookup_candidates[0]
|
|
217
|
+
matching_branches = [
|
|
218
|
+
workspace
|
|
219
|
+
for candidate in dict.fromkeys(lookup_candidates)
|
|
220
|
+
for workspace in workspace_branches
|
|
221
|
+
if workspace["name"] == candidate or workspace["id"] == candidate
|
|
222
|
+
]
|
|
223
|
+
if len({workspace["id"] for workspace in matching_branches}) > 1:
|
|
224
|
+
raise CLIBranchException(
|
|
225
|
+
FeedbackManager.error_branch_name_ambiguous(
|
|
226
|
+
branch=branch_name_or_id,
|
|
227
|
+
matches=", ".join(f"'{workspace['name']}' ({workspace['id']})" for workspace in matching_branches),
|
|
228
|
+
)
|
|
229
|
+
)
|
|
230
|
+
workspace_to_clear = matching_branches[0] if matching_branches else None
|
|
231
|
+
if workspace_to_clear and branch_name_or_id not in (workspace_to_clear["name"], workspace_to_clear["id"]):
|
|
232
|
+
click.echo(
|
|
233
|
+
FeedbackManager.warning_branch_name_sanitized(
|
|
234
|
+
context="Branch", original=branch_name_or_id, sanitized=workspace_to_clear["name"]
|
|
235
|
+
)
|
|
236
|
+
)
|
|
221
237
|
else:
|
|
222
238
|
workspace_to_clear = next(
|
|
223
239
|
(workspace for workspace in workspace_branches if workspace["id"] == config["id"]), None
|
|
@@ -202,9 +202,18 @@ def get_tinybird_branch_name_from_git_branch(branch_name: Optional[str]) -> Opti
|
|
|
202
202
|
if not branch_name:
|
|
203
203
|
return None
|
|
204
204
|
sanitized = sanitize_branch_name(branch_name, enforce_workspace_prefix_rules=False)
|
|
205
|
+
if sanitized.startswith("d_"):
|
|
206
|
+
sanitized = f"branch_{sanitized}"
|
|
205
207
|
return sanitized or None
|
|
206
208
|
|
|
207
209
|
|
|
210
|
+
def get_local_workspace_name_from_git_branch(branch_name: Optional[str]) -> Optional[str]:
|
|
211
|
+
# Tinybird Local creates a regular Workspace, not a Branch, so the name must start with a letter.
|
|
212
|
+
if not branch_name:
|
|
213
|
+
return None
|
|
214
|
+
return sanitize_branch_name(branch_name) or None
|
|
215
|
+
|
|
216
|
+
|
|
208
217
|
def is_tinybird_local_running(timeout_seconds: float = 0.2) -> bool:
|
|
209
218
|
try:
|
|
210
219
|
with socket.create_connection((TB_LOCAL_HOST, TB_LOCAL_PORT), timeout=timeout_seconds):
|
|
@@ -1159,7 +1168,7 @@ def create_ctx_client(
|
|
|
1159
1168
|
if not test and not explicit_token_passed:
|
|
1160
1169
|
git_branch = get_current_git_branch()
|
|
1161
1170
|
if git_branch and not is_main_git_branch(git_branch):
|
|
1162
|
-
local_branch =
|
|
1171
|
+
local_branch = get_local_workspace_name_from_git_branch(git_branch)
|
|
1163
1172
|
ctx.ensure_object(dict)["git_branch"] = git_branch
|
|
1164
1173
|
client, workspace_created = get_tinybird_local_client(config, test=test, staging=staging, branch=local_branch)
|
|
1165
1174
|
if local_branch and config.get("local_workspace_name") == local_branch:
|
|
@@ -4,7 +4,7 @@ import re
|
|
|
4
4
|
import urllib
|
|
5
5
|
from copy import deepcopy
|
|
6
6
|
from dataclasses import dataclass
|
|
7
|
-
from datetime import
|
|
7
|
+
from datetime import UTC, datetime
|
|
8
8
|
from pathlib import Path
|
|
9
9
|
from typing import Any, Dict, Iterable, List, Optional, Set, Tuple
|
|
10
10
|
|
|
@@ -678,7 +678,7 @@ def process_file(
|
|
|
678
678
|
if import_from_timestamp := params.get("import_from_timestamp", None):
|
|
679
679
|
try:
|
|
680
680
|
dt = datetime.fromisoformat(import_from_timestamp)
|
|
681
|
-
if dt.tzinfo is None or dt.tzinfo !=
|
|
681
|
+
if dt.tzinfo is None or dt.tzinfo != UTC:
|
|
682
682
|
# If the datetime does not have an embedded timezone info
|
|
683
683
|
# or differs from UTC, user should change it.
|
|
684
684
|
raise click.ClickException(
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import json
|
|
2
2
|
import logging
|
|
3
3
|
import os
|
|
4
|
-
from datetime import datetime, timedelta
|
|
4
|
+
from datetime import UTC, datetime, timedelta
|
|
5
5
|
from pathlib import Path
|
|
6
6
|
from typing import Any, Dict, Optional
|
|
7
7
|
|
|
@@ -582,7 +582,7 @@ data-host="{client.host}"
|
|
|
582
582
|
|
|
583
583
|
try:
|
|
584
584
|
ttl = timedelta(days=365 * 10)
|
|
585
|
-
expiration_time = int((ttl + datetime.now(
|
|
585
|
+
expiration_time = int((ttl + datetime.now(UTC)).timestamp())
|
|
586
586
|
datasources = client.datasources()
|
|
587
587
|
pipes = client.pipes()
|
|
588
588
|
|
|
@@ -297,6 +297,9 @@ class FeedbackManager:
|
|
|
297
297
|
error_branch = error_message(
|
|
298
298
|
"Branch {branch} not found. use '{cli} branch ls' to list your Branches, make sure you are authenticated using the right workspace token"
|
|
299
299
|
)
|
|
300
|
+
error_branch_name_ambiguous = error_message(
|
|
301
|
+
"Branch name '{branch}' matches more than one Branch: {matches}. Use the Branch ID instead."
|
|
302
|
+
)
|
|
300
303
|
error_not_a_branch = error_message(
|
|
301
304
|
"To use this command you need to be authenticated on a Branch. Use '{cli} branch ls' and '{cli} branch use' and retry the command."
|
|
302
305
|
)
|
|
@@ -12,7 +12,7 @@ from tinybird.tb.client import AuthNoTokenException
|
|
|
12
12
|
from tinybird.tb.modules.cli import (
|
|
13
13
|
cli,
|
|
14
14
|
get_current_git_branch,
|
|
15
|
-
|
|
15
|
+
get_local_workspace_name_from_git_branch,
|
|
16
16
|
is_main_git_branch,
|
|
17
17
|
)
|
|
18
18
|
from tinybird.tb.modules.common import (
|
|
@@ -96,7 +96,7 @@ def clear_local_workspace() -> None:
|
|
|
96
96
|
ws_name = config.get("name")
|
|
97
97
|
git_branch = get_current_git_branch()
|
|
98
98
|
if git_branch and not is_main_git_branch(git_branch):
|
|
99
|
-
branch_ws_name =
|
|
99
|
+
branch_ws_name = get_local_workspace_name_from_git_branch(git_branch)
|
|
100
100
|
if branch_ws_name:
|
|
101
101
|
ws_name = branch_ws_name
|
|
102
102
|
if not ws_name:
|
|
@@ -258,7 +258,7 @@ def open_url(url: str, *, new_tab: bool = False) -> bool:
|
|
|
258
258
|
# 1. Try the standard library first on CPython ≥ 3.11 this already
|
|
259
259
|
# recognises WSL and fires up the Windows default browser for us.
|
|
260
260
|
try:
|
|
261
|
-
wb: Any = webbrowser.get()
|
|
261
|
+
wb: Any = webbrowser.get()
|
|
262
262
|
if new_tab:
|
|
263
263
|
if wb.open_new_tab(url):
|
|
264
264
|
return True
|
|
@@ -6,7 +6,7 @@ import json
|
|
|
6
6
|
import re
|
|
7
7
|
import time
|
|
8
8
|
from contextlib import suppress
|
|
9
|
-
from datetime import datetime, timedelta
|
|
9
|
+
from datetime import UTC, datetime, timedelta
|
|
10
10
|
from typing import Any, Dict, List, Optional, Sequence, Set, Tuple
|
|
11
11
|
|
|
12
12
|
import click
|
|
@@ -199,11 +199,11 @@ _MILLISECOND_DURATION_SOURCES: Set[str] = set()
|
|
|
199
199
|
|
|
200
200
|
|
|
201
201
|
def _to_iso_utc(dt: datetime) -> str:
|
|
202
|
-
return dt.astimezone(
|
|
202
|
+
return dt.astimezone(UTC).replace(microsecond=0).isoformat().replace("+00:00", "Z")
|
|
203
203
|
|
|
204
204
|
|
|
205
205
|
def _parse_relative_time(value: str, now: Optional[datetime] = None) -> str:
|
|
206
|
-
now = now or datetime.now(
|
|
206
|
+
now = now or datetime.now(UTC)
|
|
207
207
|
cleaned_value = value.strip()
|
|
208
208
|
match = _RELATIVE_TIME_RE.match(cleaned_value)
|
|
209
209
|
if not match:
|
|
@@ -281,7 +281,7 @@ def _parse_sources(raw_sources: Sequence[str]) -> List[str]:
|
|
|
281
281
|
def _format_time(timestamp_value: Any) -> str:
|
|
282
282
|
timestamp = str(timestamp_value)
|
|
283
283
|
try:
|
|
284
|
-
parsed_dt = datetime.fromisoformat(timestamp
|
|
284
|
+
parsed_dt = datetime.fromisoformat(timestamp)
|
|
285
285
|
return parsed_dt.strftime("%Y-%m-%d %H:%M:%S")
|
|
286
286
|
except ValueError:
|
|
287
287
|
return timestamp
|
|
@@ -595,7 +595,7 @@ def logs(
|
|
|
595
595
|
return
|
|
596
596
|
|
|
597
597
|
client: TinyB = ctx.ensure_object(dict)["client"]
|
|
598
|
-
now = datetime.now(
|
|
598
|
+
now = datetime.now(UTC)
|
|
599
599
|
|
|
600
600
|
resolved_start = _parse_relative_time(start_time, now)
|
|
601
601
|
resolved_end = _parse_relative_time(end_time, now) if end_time else _to_iso_utc(now)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from datetime import datetime, timedelta
|
|
1
|
+
from datetime import UTC, datetime, timedelta
|
|
2
2
|
from typing import Any, Dict, List, Optional
|
|
3
3
|
|
|
4
4
|
import click
|
|
@@ -201,7 +201,7 @@ def create_jwt_token(ctx: Context, name: str, ttl: timedelta, scope, resource, f
|
|
|
201
201
|
obj: Dict[str, Any] = ctx.ensure_object(dict)
|
|
202
202
|
client: TinyB = obj["client"]
|
|
203
203
|
|
|
204
|
-
expiration_time = int((ttl + datetime.now(
|
|
204
|
+
expiration_time = int((ttl + datetime.now(UTC)).timestamp())
|
|
205
205
|
if len(scope) != len(resource):
|
|
206
206
|
raise CLITokenException(FeedbackManager.error_number_of_scopes_and_resources_mismatch())
|
|
207
207
|
|
|
@@ -1561,7 +1561,7 @@ async def wait_job(
|
|
|
1561
1561
|
if result["status"] != "done":
|
|
1562
1562
|
raise CLIException(FeedbackManager.error_while_running_job(error=result["error"]))
|
|
1563
1563
|
return result
|
|
1564
|
-
except
|
|
1564
|
+
except TimeoutError:
|
|
1565
1565
|
raise CLIException(FeedbackManager.error_while_running_job(error="Reach timeout, job cancelled"))
|
|
1566
1566
|
except JobException as e:
|
|
1567
1567
|
raise CLIException(FeedbackManager.error_while_running_job(error=str(e)))
|
|
@@ -1579,7 +1579,7 @@ async def wait_job_no_ui(
|
|
|
1579
1579
|
if result["status"] != "done":
|
|
1580
1580
|
raise JobException(result.get("error"))
|
|
1581
1581
|
return result
|
|
1582
|
-
except
|
|
1582
|
+
except TimeoutError:
|
|
1583
1583
|
await tb_client.job_cancel(job_id)
|
|
1584
1584
|
raise
|
|
1585
1585
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: tinybird
|
|
3
|
-
Version: 5.0.
|
|
3
|
+
Version: 5.0.1
|
|
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,12 @@ The Tinybird command-line tool allows you to use all the Tinybird functionality
|
|
|
52
52
|
Changelog
|
|
53
53
|
----------
|
|
54
54
|
|
|
55
|
+
5.0.1
|
|
56
|
+
*******
|
|
57
|
+
|
|
58
|
+
- `Fixed` Git branches whose name starts with a digit (for example ``3-clean-up-tokens``) work with ``tb build`` and ``tb deploy``. Cloud branches keep the leading digit; Tinybird Local workspaces use a ``branch_`` prefix.
|
|
59
|
+
- `Fixed` ``tb branch clear <name>`` also finds the ``branch_``-prefixed name that ``tb branch create <name>`` generates. If the name matches more than one Branch, use the Branch ID.
|
|
60
|
+
|
|
55
61
|
5.0.0
|
|
56
62
|
*******
|
|
57
63
|
|
|
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
|
|
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
|
|
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
|
|
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
|
|
File without changes
|