tinybird 0.0.1.dev118__py3-none-any.whl → 0.0.1.dev120__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.
Potentially problematic release.
This version of tinybird might be problematic. Click here for more details.
- tinybird/datatypes.py +29 -24
- tinybird/tb/__cli__.py +2 -2
- tinybird/{client.py → tb/client.py} +8 -1
- tinybird/tb/config.py +96 -0
- tinybird/tb/modules/auth.py +1 -1
- tinybird/tb/modules/build.py +1 -1
- tinybird/tb/modules/cli.py +2 -73
- tinybird/tb/modules/common.py +9 -6
- tinybird/tb/modules/config.py +2 -2
- tinybird/tb/modules/connection.py +10 -1
- tinybird/tb/modules/copy.py +1 -1
- tinybird/tb/modules/create.py +1 -1
- tinybird/tb/modules/datafile/build.py +1 -1
- tinybird/tb/modules/datafile/build_common.py +1 -1
- tinybird/tb/modules/datafile/build_datasource.py +1 -1
- tinybird/tb/modules/datafile/build_pipe.py +1 -1
- tinybird/tb/modules/datafile/common.py +25 -0
- tinybird/tb/modules/datafile/diff.py +1 -1
- tinybird/tb/modules/datafile/format_datasource.py +1 -1
- tinybird/tb/modules/datafile/playground.py +1 -1
- tinybird/tb/modules/datafile/pull.py +1 -1
- tinybird/tb/modules/datasource.py +1 -1
- tinybird/tb/modules/endpoint.py +1 -1
- tinybird/tb/modules/feedback_manager.py +1 -0
- tinybird/tb/modules/infra.py +1 -1
- tinybird/tb/modules/job.py +1 -1
- tinybird/tb/modules/llm.py +10 -0
- tinybird/tb/modules/local.py +5 -1
- tinybird/tb/modules/local_common.py +1 -1
- tinybird/tb/modules/login.py +10 -0
- tinybird/tb/modules/materialization.py +1 -1
- tinybird/tb/modules/mock.py +1 -1
- tinybird/tb/modules/pipe.py +1 -1
- tinybird/tb/modules/secret.py +1 -1
- tinybird/tb/modules/shell.py +1 -1
- tinybird/tb/modules/telemetry.py +1 -1
- tinybird/tb/modules/test.py +1 -1
- tinybird/tb/modules/tinyunit/tinyunit.py +1 -1
- tinybird/tb/modules/token.py +1 -1
- tinybird/tb/modules/workspace.py +1 -1
- tinybird/tb/modules/workspace_members.py +2 -2
- {tinybird-0.0.1.dev118.dist-info → tinybird-0.0.1.dev120.dist-info}/METADATA +1 -1
- tinybird-0.0.1.dev120.dist-info/RECORD +86 -0
- tinybird/__cli__.py +0 -7
- tinybird/config.py +0 -146
- tinybird-0.0.1.dev118.dist-info/RECORD +0 -87
- {tinybird-0.0.1.dev118.dist-info → tinybird-0.0.1.dev120.dist-info}/WHEEL +0 -0
- {tinybird-0.0.1.dev118.dist-info → tinybird-0.0.1.dev120.dist-info}/entry_points.txt +0 -0
- {tinybird-0.0.1.dev118.dist-info → tinybird-0.0.1.dev120.dist-info}/top_level.txt +0 -0
tinybird/datatypes.py
CHANGED
|
@@ -5,11 +5,14 @@ from decimal import Decimal
|
|
|
5
5
|
from typing import Callable, Dict, List, Optional, Tuple
|
|
6
6
|
|
|
7
7
|
datetime64_patterns = [
|
|
8
|
-
r"\d\d\d\d.\d\d.\d\d(T|\s)\d\d:\d\d:\d\d.\d\d\d",
|
|
9
|
-
r"\d\d.\d\d.\d\d\d\d.\d{1,2}:\d{1,2}:\d{1,2}.\d{1,3}",
|
|
8
|
+
re.compile(r"\d\d\d\d.\d\d.\d\d(T|\s)\d\d:\d\d:\d\d.\d\d\d"),
|
|
9
|
+
re.compile(r"\d\d.\d\d.\d\d\d\d.\d{1,2}:\d{1,2}:\d{1,2}.\d{1,3}"),
|
|
10
10
|
]
|
|
11
11
|
|
|
12
|
-
datetime_patterns = [
|
|
12
|
+
datetime_patterns = [
|
|
13
|
+
re.compile(r"\d\d\d\d.\d\d.\d\d(T|\s)\d\d:\d\d:\d\d"),
|
|
14
|
+
re.compile(r"\d\d.\d\d.\d\d\d\d.\d{1,2}:\d{1,2}:\d{1,2}"),
|
|
15
|
+
]
|
|
13
16
|
|
|
14
17
|
int_8_max = 2**7
|
|
15
18
|
int16_max = 2**15
|
|
@@ -23,13 +26,15 @@ uint32_max = 2**32
|
|
|
23
26
|
uint64_max = 2**64
|
|
24
27
|
uint128_max = 2**128
|
|
25
28
|
uint256_max = 2**256
|
|
26
|
-
intx_re = r"^[+-]?\d+$"
|
|
27
|
-
uintx_re = r"^\d+$"
|
|
29
|
+
intx_re = re.compile(r"^[+-]?\d+$")
|
|
30
|
+
uintx_re = re.compile(r"^\d+$")
|
|
28
31
|
float32_max = 2**23 # 23 bits is the fractional part of float 32 ieee754
|
|
29
32
|
float64_max = 2**52 # 51 bits is the fractional part of float 64 ieee754
|
|
30
33
|
|
|
31
|
-
|
|
32
|
-
|
|
34
|
+
date_pattern = re.compile(r"\d\d\d\d-\d\d-\d\d$")
|
|
35
|
+
|
|
36
|
+
datetime64_type_pattern = re.compile(r"^DateTime64(\([1-9](, ?'.+')?\))?$")
|
|
37
|
+
datetime_type_pattern = re.compile(r"^DateTime(\(('.+')?)?\)?$")
|
|
33
38
|
|
|
34
39
|
# List from https://github.com/tinybirdco/ClickHousePrivate/blob/153473d9c1c871974688a1d72dcff7a13fc2076c/src/DataTypes/Serializations/SerializationBool.cpp#L216
|
|
35
40
|
bool_allowed_values = {
|
|
@@ -71,7 +76,7 @@ def is_type_datetime64(type_to_check: str) -> bool:
|
|
|
71
76
|
>>> is_type_datetime64("datetime64")
|
|
72
77
|
False
|
|
73
78
|
"""
|
|
74
|
-
return
|
|
79
|
+
return datetime64_type_pattern.match(type_to_check) is not None
|
|
75
80
|
|
|
76
81
|
|
|
77
82
|
def is_type_datetime(type_to_check: str) -> bool:
|
|
@@ -87,7 +92,7 @@ def is_type_datetime(type_to_check: str) -> bool:
|
|
|
87
92
|
>>> is_type_datetime("datetime")
|
|
88
93
|
False
|
|
89
94
|
"""
|
|
90
|
-
return
|
|
95
|
+
return datetime_type_pattern.match(type_to_check) is not None
|
|
91
96
|
|
|
92
97
|
|
|
93
98
|
def string_test(x: str) -> bool:
|
|
@@ -95,63 +100,63 @@ def string_test(x: str) -> bool:
|
|
|
95
100
|
|
|
96
101
|
|
|
97
102
|
def date_test(x: str) -> bool:
|
|
98
|
-
return
|
|
103
|
+
return date_pattern.match(x) is not None
|
|
99
104
|
|
|
100
105
|
|
|
101
106
|
def datetime64_test(x: str) -> bool:
|
|
102
|
-
return any([
|
|
107
|
+
return any([p.match(x) for p in datetime64_patterns])
|
|
103
108
|
|
|
104
109
|
|
|
105
110
|
def datetime_test(x: str) -> bool:
|
|
106
|
-
return any([
|
|
111
|
+
return any([p.match(x) for p in datetime_patterns])
|
|
107
112
|
|
|
108
113
|
|
|
109
114
|
def int_8_test(x: str) -> bool:
|
|
110
|
-
return
|
|
115
|
+
return intx_re.match(x) is not None and -int_8_max <= int(x) < int_8_max
|
|
111
116
|
|
|
112
117
|
|
|
113
118
|
def int16_test(x: str) -> bool:
|
|
114
|
-
return
|
|
119
|
+
return intx_re.match(x) is not None and -int16_max <= int(x) < int16_max
|
|
115
120
|
|
|
116
121
|
|
|
117
122
|
def int32_test(x: str) -> bool:
|
|
118
|
-
return
|
|
123
|
+
return intx_re.match(x) is not None and -int32_max <= int(x) < int32_max
|
|
119
124
|
|
|
120
125
|
|
|
121
126
|
def int64_test(x: str) -> bool:
|
|
122
|
-
return
|
|
127
|
+
return intx_re.match(x) is not None and -int64_max <= int(x) < int64_max
|
|
123
128
|
|
|
124
129
|
|
|
125
130
|
def int128_test(x: str) -> bool:
|
|
126
|
-
return
|
|
131
|
+
return intx_re.match(x) is not None and -int128_max <= int(x) < int128_max
|
|
127
132
|
|
|
128
133
|
|
|
129
134
|
def int256_test(x: str) -> bool:
|
|
130
|
-
return
|
|
135
|
+
return intx_re.match(x) is not None and -int256_max <= int(x) < int256_max
|
|
131
136
|
|
|
132
137
|
|
|
133
138
|
def uint_8_test(x: str) -> bool:
|
|
134
|
-
return
|
|
139
|
+
return uintx_re.match(x) is not None and 0 <= int(x) < uint_8_max
|
|
135
140
|
|
|
136
141
|
|
|
137
142
|
def uint16_test(x: str) -> bool:
|
|
138
|
-
return
|
|
143
|
+
return uintx_re.match(x) is not None and 0 <= int(x) < uint16_max
|
|
139
144
|
|
|
140
145
|
|
|
141
146
|
def uint32_test(x: str) -> bool:
|
|
142
|
-
return
|
|
147
|
+
return uintx_re.match(x) is not None and 0 <= int(x) < uint32_max
|
|
143
148
|
|
|
144
149
|
|
|
145
150
|
def uint64_test(x: str) -> bool:
|
|
146
|
-
return
|
|
151
|
+
return uintx_re.match(x) is not None and 0 <= int(x) < uint64_max
|
|
147
152
|
|
|
148
153
|
|
|
149
154
|
def uint128_test(x: str) -> bool:
|
|
150
|
-
return
|
|
155
|
+
return intx_re.match(x) is not None and 0 <= int(x) < uint128_max
|
|
151
156
|
|
|
152
157
|
|
|
153
158
|
def uint256_test(x: str) -> bool:
|
|
154
|
-
return
|
|
159
|
+
return intx_re.match(x) is not None and 0 <= int(x) < uint256_max
|
|
155
160
|
|
|
156
161
|
|
|
157
162
|
def float_test(x: str) -> bool:
|
tinybird/tb/__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__ = '0.0.1.
|
|
8
|
-
__revision__ = '
|
|
7
|
+
__version__ = '0.0.1.dev120'
|
|
8
|
+
__revision__ = 'a558f0d'
|
|
@@ -15,7 +15,7 @@ from urllib3 import Retry
|
|
|
15
15
|
|
|
16
16
|
from tinybird.ch_utils.constants import COPY_ENABLED_TABLE_FUNCTIONS
|
|
17
17
|
from tinybird.syncasync import sync_to_async
|
|
18
|
-
from tinybird.
|
|
18
|
+
from tinybird.tb.modules.telemetry import add_telemetry_event
|
|
19
19
|
|
|
20
20
|
HOST = "https://api.tinybird.co"
|
|
21
21
|
LIMIT_RETRIES = 10
|
|
@@ -1170,6 +1170,13 @@ class TinyB:
|
|
|
1170
1170
|
response = await self._req(f"/v0/connectors/snowflake/warehouses?{urlencode(params)}", method="POST", data="")
|
|
1171
1171
|
return response["warehouses"]
|
|
1172
1172
|
|
|
1173
|
+
async def check_aws_credentials(self) -> bool:
|
|
1174
|
+
try:
|
|
1175
|
+
await self._req("/v0/integrations/s3/settings")
|
|
1176
|
+
return True
|
|
1177
|
+
except Exception:
|
|
1178
|
+
return False
|
|
1179
|
+
|
|
1173
1180
|
async def get_trust_policy(self, service: str) -> Dict[str, Any]:
|
|
1174
1181
|
return await self._req(f"/v0/integrations/{service}/policies/trust-policy")
|
|
1175
1182
|
|
tinybird/tb/config.py
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import json
|
|
2
|
+
from os import environ, getcwd
|
|
3
|
+
from pathlib import Path
|
|
4
|
+
from typing import Any, Dict, Optional
|
|
5
|
+
|
|
6
|
+
import aiofiles
|
|
7
|
+
import click
|
|
8
|
+
|
|
9
|
+
from tinybird.tb import __cli__
|
|
10
|
+
from tinybird.tb.modules.feedback_manager import FeedbackManager
|
|
11
|
+
|
|
12
|
+
try:
|
|
13
|
+
from tinybird.tb.__cli__ import __revision__
|
|
14
|
+
except Exception:
|
|
15
|
+
__revision__ = ""
|
|
16
|
+
|
|
17
|
+
DEFAULT_API_HOST = "https://api.tinybird.co"
|
|
18
|
+
DEFAULT_LOCALHOST = "http://localhost:8001"
|
|
19
|
+
CURRENT_VERSION = f"{__cli__.__version__}"
|
|
20
|
+
VERSION = f"{__cli__.__version__} (rev {__revision__})"
|
|
21
|
+
DEFAULT_UI_HOST = "https://cloud.tinybird.co"
|
|
22
|
+
SUPPORTED_CONNECTORS = ["bigquery", "snowflake"]
|
|
23
|
+
PROJECT_PATHS = ["datasources", "datasources/fixtures", "endpoints", "pipes", "tests", "scripts", "deploy"]
|
|
24
|
+
DEPRECATED_PROJECT_PATHS = ["endpoints"]
|
|
25
|
+
MIN_WORKSPACE_ID_LENGTH = 36
|
|
26
|
+
|
|
27
|
+
CLOUD_HOSTS = {
|
|
28
|
+
"https://api.tinybird.co": "https://cloud.tinybird.co/gcp/europe-west3",
|
|
29
|
+
"https://api.us-east.tinybird.co": "https://cloud.tinybird.co/gcp/us-east4",
|
|
30
|
+
"https://api.us-east.aws.tinybird.co": "https://cloud.tinybird.co/aws/us-east-1",
|
|
31
|
+
"https://api.us-west-2.aws.tinybird.co": "https://cloud.tinybird.co/aws/us-west-2",
|
|
32
|
+
"https://api.eu-central-1.aws.tinybird.co": "https://cloud.tinybird.co/aws/eu-central-1",
|
|
33
|
+
"https://api.eu-west-1.aws.tinybird.co": "https://cloud.tinybird.co/aws/eu-west-1",
|
|
34
|
+
"https://api.europe-west2.gcp.tinybird.co": "https://cloud.tinybird.co/gcp/europe-west2",
|
|
35
|
+
"https://api.ap-east.aws.tinybird.co": "https://cloud.tinybird.co/aws/ap-east",
|
|
36
|
+
"https://ui.tinybird.co": "https://cloud.tinybird.co/gcp/europe-west3",
|
|
37
|
+
"https://ui.us-east.tinybird.co": "https://cloud.tinybird.co/gcp/us-east4",
|
|
38
|
+
"https://ui.us-east.aws.tinybird.co": "https://cloud.tinybird.co/aws/us-east-1",
|
|
39
|
+
"https://ui.us-west-2.aws.tinybird.co": "https://cloud.tinybird.co/aws/us-west-2",
|
|
40
|
+
"https://ui.eu-central-1.aws.tinybird.co": "https://cloud.tinybird.co/aws/eu-central-1",
|
|
41
|
+
"https://ui.europe-west2.gcp.tinybird.co": "https://cloud.tinybird.co/gcp/europe-west2",
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
async def get_config(
|
|
46
|
+
host: str, token: Optional[str], semver: Optional[str] = None, config_file: Optional[str] = None
|
|
47
|
+
) -> Dict[str, Any]:
|
|
48
|
+
if host:
|
|
49
|
+
host = host.rstrip("/")
|
|
50
|
+
|
|
51
|
+
config = {}
|
|
52
|
+
try:
|
|
53
|
+
async with aiofiles.open(config_file or Path(getcwd()) / ".tinyb") as file:
|
|
54
|
+
res = await file.read()
|
|
55
|
+
config = json.loads(res)
|
|
56
|
+
except OSError:
|
|
57
|
+
pass
|
|
58
|
+
except json.decoder.JSONDecodeError:
|
|
59
|
+
click.echo(FeedbackManager.error_load_file_config(config_file=config_file))
|
|
60
|
+
return config
|
|
61
|
+
|
|
62
|
+
config["token_passed"] = token
|
|
63
|
+
config["token"] = token or config.get("token", None)
|
|
64
|
+
config["semver"] = semver or config.get("semver", None)
|
|
65
|
+
config["host"] = host or config.get("host", DEFAULT_API_HOST)
|
|
66
|
+
config["workspaces"] = config.get("workspaces", [])
|
|
67
|
+
config["cwd"] = config.get("cwd", getcwd())
|
|
68
|
+
return config
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
async def write_config(config: Dict[str, Any], dest_file: str = ".tinyb"):
|
|
72
|
+
config_file = Path(getcwd()) / dest_file
|
|
73
|
+
async with aiofiles.open(config_file, "w") as file:
|
|
74
|
+
await file.write(json.dumps(config, indent=4, sort_keys=True))
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
def get_display_cloud_host(api_host: str) -> str:
|
|
78
|
+
is_local = "localhost" in api_host
|
|
79
|
+
if is_local:
|
|
80
|
+
port = api_host.split(":")[-1]
|
|
81
|
+
return f"http://cloud.tinybird.co/local/{port}"
|
|
82
|
+
return CLOUD_HOSTS.get(api_host, api_host)
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
class FeatureFlags:
|
|
86
|
+
@classmethod
|
|
87
|
+
def ignore_sql_errors(cls) -> bool: # Context: #1155
|
|
88
|
+
return "TB_IGNORE_SQL_ERRORS" in environ
|
|
89
|
+
|
|
90
|
+
@classmethod
|
|
91
|
+
def is_localhost(cls) -> bool:
|
|
92
|
+
return "SET_LOCALHOST" in environ
|
|
93
|
+
|
|
94
|
+
@classmethod
|
|
95
|
+
def enable_snowflake_connector_command(cls) -> bool:
|
|
96
|
+
return "ENABLE_SNOWFLAKE_CONNECTOR_COMMAND" in environ
|
tinybird/tb/modules/auth.py
CHANGED
|
@@ -9,7 +9,7 @@ from typing import Any, Dict, List, Optional
|
|
|
9
9
|
import click
|
|
10
10
|
import humanfriendly.tables
|
|
11
11
|
|
|
12
|
-
from tinybird.config import get_display_cloud_host
|
|
12
|
+
from tinybird.tb.config import get_display_cloud_host
|
|
13
13
|
from tinybird.tb.modules.cli import cli
|
|
14
14
|
from tinybird.tb.modules.common import (
|
|
15
15
|
configure_connector,
|
tinybird/tb/modules/build.py
CHANGED
|
@@ -14,7 +14,7 @@ import click
|
|
|
14
14
|
import requests
|
|
15
15
|
|
|
16
16
|
import tinybird.context as context
|
|
17
|
-
from tinybird.client import TinyB
|
|
17
|
+
from tinybird.tb.client import TinyB
|
|
18
18
|
from tinybird.tb.modules.cli import cli
|
|
19
19
|
from tinybird.tb.modules.common import push_data
|
|
20
20
|
from tinybird.tb.modules.config import CLIConfig
|
tinybird/tb/modules/cli.py
CHANGED
|
@@ -17,25 +17,22 @@ import click
|
|
|
17
17
|
import humanfriendly
|
|
18
18
|
from click import Context
|
|
19
19
|
|
|
20
|
-
from tinybird.
|
|
20
|
+
from tinybird.tb import __cli__
|
|
21
|
+
from tinybird.tb.client import (
|
|
21
22
|
AuthException,
|
|
22
23
|
AuthNoTokenException,
|
|
23
|
-
TinyB,
|
|
24
24
|
)
|
|
25
|
-
from tinybird.tb import __cli__
|
|
26
25
|
from tinybird.tb.modules.common import (
|
|
27
26
|
CatchAuthExceptions,
|
|
28
27
|
CLIException,
|
|
29
28
|
_get_tb_client,
|
|
30
29
|
coro,
|
|
31
30
|
echo_safe_format_table,
|
|
32
|
-
get_current_main_workspace,
|
|
33
31
|
getenv_bool,
|
|
34
32
|
try_update_config_with_remote,
|
|
35
33
|
)
|
|
36
34
|
from tinybird.tb.modules.config import CLIConfig
|
|
37
35
|
from tinybird.tb.modules.datafile.build import build_graph
|
|
38
|
-
from tinybird.tb.modules.datafile.diff import diff_command
|
|
39
36
|
from tinybird.tb.modules.datafile.pull import folder_pull
|
|
40
37
|
from tinybird.tb.modules.feedback_manager import FeedbackManager
|
|
41
38
|
from tinybird.tb.modules.local_common import get_tinybird_local_client
|
|
@@ -165,74 +162,6 @@ async def pull(ctx: Context, force: bool, fmt: bool) -> None:
|
|
|
165
162
|
return await folder_pull(client, project.path, force, fmt=fmt)
|
|
166
163
|
|
|
167
164
|
|
|
168
|
-
@cli.command(
|
|
169
|
-
name="diff",
|
|
170
|
-
short_help="Diff local datafiles to the corresponding remote files in the workspace. Only diffs VERSION and SCHEMA for .datasource files.",
|
|
171
|
-
)
|
|
172
|
-
@click.argument("filename", type=click.Path(exists=True), nargs=-1, required=False)
|
|
173
|
-
@click.option(
|
|
174
|
-
"--fmt/--no-fmt",
|
|
175
|
-
is_flag=True,
|
|
176
|
-
default=True,
|
|
177
|
-
help="Format files before doing the diff, default is True so both files match the format",
|
|
178
|
-
)
|
|
179
|
-
@click.option("--no-color", is_flag=True, default=False, help="Don't colorize diff")
|
|
180
|
-
@click.option(
|
|
181
|
-
"--no-verbose", is_flag=True, default=False, help="List the resources changed not the content of the diff"
|
|
182
|
-
)
|
|
183
|
-
@click.option(
|
|
184
|
-
"--main",
|
|
185
|
-
is_flag=True,
|
|
186
|
-
default=False,
|
|
187
|
-
help="Diff local datafiles to the corresponding remote files in the main workspace. Only works when authenticated on a Branch.",
|
|
188
|
-
hidden=True,
|
|
189
|
-
)
|
|
190
|
-
@click.pass_context
|
|
191
|
-
@coro
|
|
192
|
-
async def diff(
|
|
193
|
-
ctx: Context, filename: Optional[Tuple], fmt: bool, no_color: bool, no_verbose: bool, main: bool
|
|
194
|
-
) -> None:
|
|
195
|
-
only_resources_changed = no_verbose
|
|
196
|
-
client: TinyB = ctx.ensure_object(dict)["client"]
|
|
197
|
-
|
|
198
|
-
if not main:
|
|
199
|
-
changed = await diff_command(
|
|
200
|
-
list(filename) if filename else None, fmt, client, no_color, with_print=not only_resources_changed
|
|
201
|
-
)
|
|
202
|
-
else:
|
|
203
|
-
config = CLIConfig.get_project_config()
|
|
204
|
-
|
|
205
|
-
response = await client.user_workspaces_and_branches(version="v1")
|
|
206
|
-
ws_client = None
|
|
207
|
-
for workspace in response["workspaces"]:
|
|
208
|
-
if config["id"] == workspace["id"]:
|
|
209
|
-
if not workspace.get("is_branch"):
|
|
210
|
-
raise CLIException(FeedbackManager.error_not_a_branch())
|
|
211
|
-
|
|
212
|
-
origin = workspace["main"]
|
|
213
|
-
workspace = await get_current_main_workspace(config)
|
|
214
|
-
|
|
215
|
-
if not workspace:
|
|
216
|
-
raise CLIException(FeedbackManager.error_workspace(workspace=origin))
|
|
217
|
-
|
|
218
|
-
ws_client = _get_tb_client(workspace["token"], config["host"])
|
|
219
|
-
break
|
|
220
|
-
|
|
221
|
-
if not ws_client:
|
|
222
|
-
raise CLIException(FeedbackManager.error_workspace(workspace=origin))
|
|
223
|
-
changed = await diff_command(
|
|
224
|
-
list(filename) if filename else None, fmt, ws_client, no_color, with_print=not only_resources_changed
|
|
225
|
-
)
|
|
226
|
-
|
|
227
|
-
if only_resources_changed:
|
|
228
|
-
click.echo("\n")
|
|
229
|
-
for resource, status in dict(sorted(changed.items(), key=lambda item: str(item[1]))).items():
|
|
230
|
-
if status is None:
|
|
231
|
-
continue
|
|
232
|
-
status = "changed" if status not in ["remote", "local", "shared"] else status
|
|
233
|
-
click.echo(f"{status}: {resource}")
|
|
234
|
-
|
|
235
|
-
|
|
236
165
|
@cli.command()
|
|
237
166
|
@click.argument("query", required=False)
|
|
238
167
|
@click.option("--rows_limit", default=100, help="Max number of rows retrieved")
|
tinybird/tb/modules/common.py
CHANGED
|
@@ -35,7 +35,7 @@ from humanfriendly.tables import format_pretty_table
|
|
|
35
35
|
from packaging.version import Version
|
|
36
36
|
from thefuzz import process
|
|
37
37
|
|
|
38
|
-
from tinybird.client import (
|
|
38
|
+
from tinybird.tb.client import (
|
|
39
39
|
AuthException,
|
|
40
40
|
AuthNoTokenException,
|
|
41
41
|
DoesNotExistException,
|
|
@@ -43,7 +43,7 @@ from tinybird.client import (
|
|
|
43
43
|
OperationCanNotBePerformed,
|
|
44
44
|
TinyB,
|
|
45
45
|
)
|
|
46
|
-
from tinybird.config import (
|
|
46
|
+
from tinybird.tb.config import (
|
|
47
47
|
DEFAULT_API_HOST,
|
|
48
48
|
DEFAULT_UI_HOST,
|
|
49
49
|
SUPPORTED_CONNECTORS,
|
|
@@ -518,7 +518,10 @@ def get_region_info(ctx, region=None):
|
|
|
518
518
|
api_host = format_host(
|
|
519
519
|
region["api_host"] if region else ctx.obj["config"].get("host", DEFAULT_API_HOST), subdomain="api"
|
|
520
520
|
)
|
|
521
|
-
ui_host = format_host(
|
|
521
|
+
ui_host = format_host(
|
|
522
|
+
region["host"] if region else ctx.obj["config"].get("host", DEFAULT_UI_HOST), subdomain="cloud"
|
|
523
|
+
)
|
|
524
|
+
|
|
522
525
|
return name, api_host, ui_host
|
|
523
526
|
|
|
524
527
|
|
|
@@ -553,13 +556,13 @@ def format_host(host: str, subdomain: Optional[str] = None) -> str:
|
|
|
553
556
|
if subdomain and not is_localhost:
|
|
554
557
|
url_info = urlparse(host)
|
|
555
558
|
current_subdomain = url_info.netloc.split(".")[0]
|
|
556
|
-
if current_subdomain in ("api", "ui"):
|
|
559
|
+
if current_subdomain in ("api", "ui", "app", "cloud"):
|
|
557
560
|
host = host.replace(current_subdomain, subdomain)
|
|
558
561
|
if "localhost" in host or is_localhost:
|
|
559
562
|
host = f"http://{host}" if "http" not in host else host
|
|
560
563
|
elif not host.startswith("http"):
|
|
561
564
|
host = f"https://{host}"
|
|
562
|
-
return host
|
|
565
|
+
return host.replace("app.tinybird.co", "cloud.tinybird.co")
|
|
563
566
|
|
|
564
567
|
|
|
565
568
|
def region_from_host(region_name_or_host, regions):
|
|
@@ -1506,7 +1509,7 @@ async def try_authenticate(
|
|
|
1506
1509
|
ui_host: str
|
|
1507
1510
|
token: Optional[str]
|
|
1508
1511
|
if host and not selected_region:
|
|
1509
|
-
name, api_host, ui_host = (host, format_host(host, subdomain="api"), format_host(host, subdomain="
|
|
1512
|
+
name, api_host, ui_host = (host, format_host(host, subdomain="api"), format_host(host, subdomain="cloud"))
|
|
1510
1513
|
token = config.get_token()
|
|
1511
1514
|
else:
|
|
1512
1515
|
name, api_host, ui_host = get_region_info(config, selected_region)
|
tinybird/tb/modules/config.py
CHANGED
|
@@ -8,8 +8,8 @@ from urllib.parse import urlparse
|
|
|
8
8
|
|
|
9
9
|
from packaging import version
|
|
10
10
|
|
|
11
|
-
import tinybird.client as tbc
|
|
12
|
-
from tinybird.config import CURRENT_VERSION, DEFAULT_API_HOST, DEFAULT_LOCALHOST
|
|
11
|
+
import tinybird.tb.client as tbc
|
|
12
|
+
from tinybird.tb.config import CURRENT_VERSION, DEFAULT_API_HOST, DEFAULT_LOCALHOST
|
|
13
13
|
|
|
14
14
|
APP_CONFIG_NAME = "tinybird"
|
|
15
15
|
|
|
@@ -9,7 +9,7 @@ from typing import Any, Dict, List, Optional
|
|
|
9
9
|
import click
|
|
10
10
|
from click import Context
|
|
11
11
|
|
|
12
|
-
from tinybird.client import TinyB
|
|
12
|
+
from tinybird.tb.client import TinyB
|
|
13
13
|
from tinybird.tb.modules.cli import cli
|
|
14
14
|
from tinybird.tb.modules.common import (
|
|
15
15
|
DataConnectorType,
|
|
@@ -151,6 +151,15 @@ async def connection_create_s3(ctx: Context) -> None:
|
|
|
151
151
|
obj: Dict[str, Any] = ctx.ensure_object(dict)
|
|
152
152
|
client: TinyB = obj["client"]
|
|
153
153
|
|
|
154
|
+
if obj["env"] == "local" and not await client.check_aws_credentials():
|
|
155
|
+
click.echo(
|
|
156
|
+
FeedbackManager.error(
|
|
157
|
+
message="No AWS credentials found. Please run `tb local restart --use-aws-creds` to pass your credentials. "
|
|
158
|
+
"Read more about this in https://www.tinybird.co/docs/forward/get-data-in/connectors/s3#local-environment"
|
|
159
|
+
)
|
|
160
|
+
)
|
|
161
|
+
return
|
|
162
|
+
|
|
154
163
|
service = DataConnectorType.AMAZON_S3
|
|
155
164
|
click.echo(FeedbackManager.prompt_s3_connection_header())
|
|
156
165
|
connection_name = get_s3_connection_name(project.folder)
|
tinybird/tb/modules/copy.py
CHANGED
|
@@ -10,7 +10,7 @@ from typing import Optional, Tuple
|
|
|
10
10
|
import click
|
|
11
11
|
from click import Context
|
|
12
12
|
|
|
13
|
-
from tinybird.client import AuthNoTokenException, TinyB
|
|
13
|
+
from tinybird.tb.client import AuthNoTokenException, TinyB
|
|
14
14
|
from tinybird.tb.modules.cli import cli
|
|
15
15
|
from tinybird.tb.modules.common import coro, echo_safe_humanfriendly_tables_format_smart_table, wait_job
|
|
16
16
|
from tinybird.tb.modules.datafile.common import get_name_version
|
tinybird/tb/modules/create.py
CHANGED
|
@@ -5,8 +5,8 @@ from typing import Optional, Tuple
|
|
|
5
5
|
|
|
6
6
|
import click
|
|
7
7
|
|
|
8
|
-
from tinybird.client import TinyB
|
|
9
8
|
from tinybird.prompts import create_prompt, mock_prompt, readme_prompt, rules_prompt
|
|
9
|
+
from tinybird.tb.client import TinyB
|
|
10
10
|
from tinybird.tb.modules.cicd import init_cicd
|
|
11
11
|
from tinybird.tb.modules.cli import cli
|
|
12
12
|
from tinybird.tb.modules.common import _generate_datafile, coro, generate_datafile
|
|
@@ -11,9 +11,9 @@ from typing import Any, Dict, Iterable, List, Optional, Set, Tuple, Union
|
|
|
11
11
|
import click
|
|
12
12
|
from toposort import toposort
|
|
13
13
|
|
|
14
|
-
from tinybird.client import TinyB
|
|
15
14
|
from tinybird.sql import parse_table_structure, schema_to_sql_columns
|
|
16
15
|
from tinybird.sql_template import get_used_tables_in_template, render_sql_template
|
|
16
|
+
from tinybird.tb.client import TinyB
|
|
17
17
|
from tinybird.tb.modules.common import get_ca_pem_content
|
|
18
18
|
from tinybird.tb.modules.datafile.build_datasource import is_datasource
|
|
19
19
|
from tinybird.tb.modules.datafile.build_pipe import (
|
|
@@ -5,7 +5,7 @@ from typing import Any, Dict, List, Optional
|
|
|
5
5
|
|
|
6
6
|
import click
|
|
7
7
|
|
|
8
|
-
from tinybird.client import DoesNotExistException, TinyB
|
|
8
|
+
from tinybird.tb.client import DoesNotExistException, TinyB
|
|
9
9
|
from tinybird.tb.modules.datafile.common import PREVIEW_CONNECTOR_SERVICES, ImportReplacements
|
|
10
10
|
from tinybird.tb.modules.feedback_manager import FeedbackManager
|
|
11
11
|
|
|
@@ -6,7 +6,7 @@ from urllib.parse import urlencode
|
|
|
6
6
|
import click
|
|
7
7
|
import requests
|
|
8
8
|
|
|
9
|
-
from tinybird.client import TinyB
|
|
9
|
+
from tinybird.tb.client import TinyB
|
|
10
10
|
from tinybird.tb.modules.common import requests_get
|
|
11
11
|
from tinybird.tb.modules.config import CLIConfig
|
|
12
12
|
from tinybird.tb.modules.datafile.common import PipeNodeTypes
|
|
@@ -810,6 +810,31 @@ def _parse_table_structure(schema: str) -> List[Dict[str, Any]]:
|
|
|
810
810
|
detected_type = parse_expr(
|
|
811
811
|
[NULL, NOTNULL, DEFAULT, MATERIALIZED, ALIAS, CODEC, TTL, JSONPATH, COMMA], "TYPE"
|
|
812
812
|
)
|
|
813
|
+
|
|
814
|
+
# Boolean type is supported in ClickHouse but its behavior is strange and will lead to unexpected results.
|
|
815
|
+
# Better to use Bool or UInt8 instead. An example:
|
|
816
|
+
#
|
|
817
|
+
# SELECT
|
|
818
|
+
# CAST(true, 'Boolean') AS bool,
|
|
819
|
+
# toTypeName(bool)
|
|
820
|
+
#
|
|
821
|
+
# ┌─bool─┬─toTypeName(bool)─┐
|
|
822
|
+
# │ true │ Bool │
|
|
823
|
+
# └──────┴──────────────────┘
|
|
824
|
+
if "boolean" in detected_type.lower():
|
|
825
|
+
raise SchemaSyntaxError(
|
|
826
|
+
message="Boolean type is not supported",
|
|
827
|
+
hint="Hint: use Bool or UInt8 instead",
|
|
828
|
+
lineno=line,
|
|
829
|
+
pos=pos,
|
|
830
|
+
)
|
|
831
|
+
if "datetime64" in detected_type.lower() and "datetime64(" not in detected_type.lower():
|
|
832
|
+
raise SchemaSyntaxError(
|
|
833
|
+
message="DateTime64 type without precision is not supported",
|
|
834
|
+
hint="Hint: use DateTime64(3) instead",
|
|
835
|
+
lineno=line,
|
|
836
|
+
pos=pos,
|
|
837
|
+
)
|
|
813
838
|
try:
|
|
814
839
|
# Imported in the body to be compatible with the CLI
|
|
815
840
|
from chtoolset.query import check_compatible_types
|
|
@@ -22,8 +22,8 @@ import sys
|
|
|
22
22
|
|
|
23
23
|
import click
|
|
24
24
|
|
|
25
|
-
from tinybird.client import TinyB
|
|
26
25
|
from tinybird.sql_template_fmt import DEFAULT_FMT_LINE_LENGTH
|
|
26
|
+
from tinybird.tb.client import TinyB
|
|
27
27
|
from tinybird.tb.modules.datafile.common import get_name_version, get_project_filenames, is_file_a_datasource, peek
|
|
28
28
|
from tinybird.tb.modules.datafile.format_datasource import format_datasource
|
|
29
29
|
from tinybird.tb.modules.datafile.format_pipe import format_pipe
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from typing import Any, Dict, List, Optional
|
|
2
2
|
|
|
3
|
-
from tinybird.client import TinyB
|
|
4
3
|
from tinybird.sql import schema_to_sql_columns
|
|
4
|
+
from tinybird.tb.client import TinyB
|
|
5
5
|
from tinybird.tb.modules.datafile.common import Datafile
|
|
6
6
|
from tinybird.tb.modules.datafile.format_common import (
|
|
7
7
|
DATAFILE_INDENT,
|
|
@@ -11,9 +11,9 @@ from typing import Any, Dict, Iterable, List, Optional, Set, Tuple, Union
|
|
|
11
11
|
import click
|
|
12
12
|
from toposort import toposort
|
|
13
13
|
|
|
14
|
-
from tinybird.client import TinyB
|
|
15
14
|
from tinybird.sql import parse_table_structure, schema_to_sql_columns
|
|
16
15
|
from tinybird.sql_template import get_used_tables_in_template, render_sql_template
|
|
16
|
+
from tinybird.tb.client import TinyB
|
|
17
17
|
from tinybird.tb.modules.common import get_ca_pem_content
|
|
18
18
|
from tinybird.tb.modules.config import CLIConfig
|
|
19
19
|
from tinybird.tb.modules.datafile.build_datasource import is_datasource
|
|
@@ -6,7 +6,7 @@ from typing import Any, Dict, List, Optional, Tuple
|
|
|
6
6
|
import aiofiles
|
|
7
7
|
import click
|
|
8
8
|
|
|
9
|
-
from tinybird.client import AuthNoTokenException, TinyB
|
|
9
|
+
from tinybird.tb.client import AuthNoTokenException, TinyB
|
|
10
10
|
from tinybird.tb.modules.datafile.common import get_name_version
|
|
11
11
|
from tinybird.tb.modules.datafile.format_datasource import format_datasource
|
|
12
12
|
from tinybird.tb.modules.datafile.format_pipe import format_pipe
|
|
@@ -13,7 +13,7 @@ import click
|
|
|
13
13
|
import humanfriendly
|
|
14
14
|
from click import Context
|
|
15
15
|
|
|
16
|
-
from tinybird.client import AuthNoTokenException, DoesNotExistException, TinyB
|
|
16
|
+
from tinybird.tb.client import AuthNoTokenException, DoesNotExistException, TinyB
|
|
17
17
|
from tinybird.tb.modules.cli import cli
|
|
18
18
|
from tinybird.tb.modules.common import (
|
|
19
19
|
_analyze,
|
tinybird/tb/modules/endpoint.py
CHANGED
|
@@ -14,7 +14,7 @@ import pyperclip
|
|
|
14
14
|
import requests
|
|
15
15
|
from click import Context
|
|
16
16
|
|
|
17
|
-
from tinybird.client import AuthNoTokenException, DoesNotExistException, TinyB
|
|
17
|
+
from tinybird.tb.client import AuthNoTokenException, DoesNotExistException, TinyB
|
|
18
18
|
from tinybird.tb.modules.cli import cli
|
|
19
19
|
from tinybird.tb.modules.common import coro, echo_safe_humanfriendly_tables_format_smart_table
|
|
20
20
|
from tinybird.tb.modules.datafile.common import get_name_version
|
|
@@ -441,6 +441,7 @@ class FeedbackManager:
|
|
|
441
441
|
error_tag_generic = error_message("There was an issue updating tags. {error}")
|
|
442
442
|
error_tag_not_found = error_message("Tag {tag_name} not found.")
|
|
443
443
|
error_build_failed = error_message("Build failed")
|
|
444
|
+
error_request_failed = error_message("Request failed with status code {status_code}, please try again later.")
|
|
444
445
|
|
|
445
446
|
info_incl_relative_path = info_message("** Relative path {path} does not exist, skipping.")
|
|
446
447
|
info_ignoring_incl_file = info_message(
|
tinybird/tb/modules/infra.py
CHANGED
|
@@ -11,7 +11,7 @@ import click
|
|
|
11
11
|
import requests
|
|
12
12
|
from click import Context
|
|
13
13
|
|
|
14
|
-
from tinybird.client import TinyB
|
|
14
|
+
from tinybird.tb.client import TinyB
|
|
15
15
|
from tinybird.tb.modules.cli import CLIException, cli
|
|
16
16
|
from tinybird.tb.modules.common import coro, echo_safe_humanfriendly_tables_format_smart_table
|
|
17
17
|
from tinybird.tb.modules.config import CLIConfig
|
tinybird/tb/modules/job.py
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
import click
|
|
7
7
|
from click import Context
|
|
8
8
|
|
|
9
|
-
from tinybird.client import DoesNotExistException, TinyB
|
|
9
|
+
from tinybird.tb.client import DoesNotExistException, TinyB
|
|
10
10
|
from tinybird.tb.modules.cli import cli
|
|
11
11
|
from tinybird.tb.modules.common import coro, echo_safe_humanfriendly_tables_format_smart_table
|
|
12
12
|
from tinybird.tb.modules.exceptions import CLIException
|
tinybird/tb/modules/llm.py
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import requests
|
|
2
2
|
|
|
3
|
+
from tinybird.tb.modules.feedback_manager import FeedbackManager
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class LLMException(Exception):
|
|
7
|
+
pass
|
|
8
|
+
|
|
3
9
|
|
|
4
10
|
class LLM:
|
|
5
11
|
def __init__(
|
|
@@ -29,4 +35,8 @@ class LLM:
|
|
|
29
35
|
headers={"Authorization": f"Bearer {self.user_token}"},
|
|
30
36
|
data=data,
|
|
31
37
|
)
|
|
38
|
+
|
|
39
|
+
if not response.ok:
|
|
40
|
+
raise LLMException(FeedbackManager.error_request_failed(status_code=response.status_code))
|
|
41
|
+
|
|
32
42
|
return response.json().get("result", "")
|
tinybird/tb/modules/local.py
CHANGED
|
@@ -207,7 +207,11 @@ def update_cli() -> None:
|
|
|
207
207
|
text=True,
|
|
208
208
|
)
|
|
209
209
|
except FileNotFoundError:
|
|
210
|
-
raise CLIException(
|
|
210
|
+
raise CLIException(
|
|
211
|
+
FeedbackManager.error(
|
|
212
|
+
message="Cannot find required tool: uv. Reinstall using: curl https://tinybird.co | sh"
|
|
213
|
+
)
|
|
214
|
+
)
|
|
211
215
|
|
|
212
216
|
stdout, stderr = process.communicate()
|
|
213
217
|
if "Nothing to upgrade" not in stdout + stderr:
|
|
@@ -5,7 +5,7 @@ from typing import Any, Dict
|
|
|
5
5
|
|
|
6
6
|
import requests
|
|
7
7
|
|
|
8
|
-
from tinybird.client import AuthNoTokenException, TinyB
|
|
8
|
+
from tinybird.tb.client import AuthNoTokenException, TinyB
|
|
9
9
|
from tinybird.tb.modules.config import CLIConfig
|
|
10
10
|
from tinybird.tb.modules.exceptions import CLIException
|
|
11
11
|
|
tinybird/tb/modules/login.py
CHANGED
|
@@ -5,6 +5,7 @@ import threading
|
|
|
5
5
|
import time
|
|
6
6
|
import urllib.parse
|
|
7
7
|
import webbrowser
|
|
8
|
+
from typing import Any, Dict
|
|
8
9
|
from urllib.parse import urlencode
|
|
9
10
|
|
|
10
11
|
import click
|
|
@@ -12,6 +13,7 @@ import requests
|
|
|
12
13
|
|
|
13
14
|
from tinybird.tb.modules.cli import CLIConfig, cli
|
|
14
15
|
from tinybird.tb.modules.common import coro
|
|
16
|
+
from tinybird.tb.modules.exceptions import CLIAuthException
|
|
15
17
|
from tinybird.tb.modules.feedback_manager import FeedbackManager
|
|
16
18
|
|
|
17
19
|
|
|
@@ -165,6 +167,14 @@ async def login(host: str, auth_host: str, workspace: str):
|
|
|
165
167
|
|
|
166
168
|
path = os.path.join(os.getcwd(), ".tinyb")
|
|
167
169
|
cli_config.persist_to_file(override_with_path=path)
|
|
170
|
+
|
|
171
|
+
auth_info: Dict[str, Any] = await cli_config.get_user_client().check_auth_login()
|
|
172
|
+
if not auth_info.get("is_valid", False):
|
|
173
|
+
raise CLIAuthException(FeedbackManager.error_auth_login_not_valid(host=cli_config.get_host()))
|
|
174
|
+
|
|
175
|
+
if not auth_info.get("is_user", False):
|
|
176
|
+
raise CLIAuthException(FeedbackManager.error_auth_login_not_user(host=cli_config.get_host()))
|
|
177
|
+
|
|
168
178
|
click.echo(FeedbackManager.gray(message="\nWorkspace: ") + FeedbackManager.info(message=ws["name"]))
|
|
169
179
|
click.echo(FeedbackManager.gray(message="User: ") + FeedbackManager.info(message=ws["user_email"]))
|
|
170
180
|
click.echo(FeedbackManager.gray(message="Host: ") + FeedbackManager.info(message=host))
|
tinybird/tb/modules/mock.py
CHANGED
|
@@ -3,8 +3,8 @@ from pathlib import Path
|
|
|
3
3
|
|
|
4
4
|
import click
|
|
5
5
|
|
|
6
|
-
from tinybird.client import TinyB
|
|
7
6
|
from tinybird.prompts import mock_prompt
|
|
7
|
+
from tinybird.tb.client import TinyB
|
|
8
8
|
from tinybird.tb.modules.cli import cli
|
|
9
9
|
from tinybird.tb.modules.common import CLIException, coro, push_data
|
|
10
10
|
from tinybird.tb.modules.config import CLIConfig
|
tinybird/tb/modules/pipe.py
CHANGED
tinybird/tb/modules/secret.py
CHANGED
|
@@ -3,7 +3,7 @@ from typing import Optional
|
|
|
3
3
|
|
|
4
4
|
import click
|
|
5
5
|
|
|
6
|
-
from tinybird.client import TinyB
|
|
6
|
+
from tinybird.tb.client import TinyB
|
|
7
7
|
from tinybird.tb.modules.cli import cli
|
|
8
8
|
from tinybird.tb.modules.common import coro, echo_safe_humanfriendly_tables_format_smart_table
|
|
9
9
|
from tinybird.tb.modules.feedback_manager import FeedbackManager
|
tinybird/tb/modules/shell.py
CHANGED
|
@@ -14,7 +14,7 @@ from prompt_toolkit.key_binding import KeyBindings
|
|
|
14
14
|
from prompt_toolkit.shortcuts import CompleteStyle
|
|
15
15
|
from prompt_toolkit.styles import Style
|
|
16
16
|
|
|
17
|
-
from tinybird.client import TinyB
|
|
17
|
+
from tinybird.tb.client import TinyB
|
|
18
18
|
from tinybird.tb.modules.exceptions import CLIException
|
|
19
19
|
from tinybird.tb.modules.feedback_manager import FeedbackManager, bcolors
|
|
20
20
|
from tinybird.tb.modules.project import Project
|
tinybird/tb/modules/telemetry.py
CHANGED
tinybird/tb/modules/test.py
CHANGED
|
@@ -15,8 +15,8 @@ import click
|
|
|
15
15
|
import yaml
|
|
16
16
|
from requests import Response
|
|
17
17
|
|
|
18
|
-
from tinybird.client import TinyB
|
|
19
18
|
from tinybird.prompts import test_create_prompt
|
|
19
|
+
from tinybird.tb.client import TinyB
|
|
20
20
|
from tinybird.tb.modules.cli import cli
|
|
21
21
|
from tinybird.tb.modules.common import coro
|
|
22
22
|
from tinybird.tb.modules.config import CLIConfig
|
|
@@ -7,7 +7,7 @@ import yaml
|
|
|
7
7
|
from humanfriendly.tables import format_smart_table
|
|
8
8
|
from typing_extensions import override
|
|
9
9
|
|
|
10
|
-
from tinybird.client import TinyB
|
|
10
|
+
from tinybird.tb.client import TinyB
|
|
11
11
|
from tinybird.tb.modules.common import CLIException
|
|
12
12
|
from tinybird.tb.modules.feedback_manager import FeedbackManager
|
|
13
13
|
|
tinybird/tb/modules/token.py
CHANGED
|
@@ -6,7 +6,7 @@ import pyperclip
|
|
|
6
6
|
from click import Context
|
|
7
7
|
from humanfriendly import parse_timespan
|
|
8
8
|
|
|
9
|
-
from tinybird.client import AuthNoTokenException, TinyB
|
|
9
|
+
from tinybird.tb.client import AuthNoTokenException, TinyB
|
|
10
10
|
from tinybird.tb.modules.cli import cli
|
|
11
11
|
from tinybird.tb.modules.common import (
|
|
12
12
|
DoesNotExistException,
|
tinybird/tb/modules/workspace.py
CHANGED
|
@@ -8,7 +8,7 @@ from typing import Optional
|
|
|
8
8
|
import click
|
|
9
9
|
from click import Context
|
|
10
10
|
|
|
11
|
-
from tinybird.client import TinyB
|
|
11
|
+
from tinybird.tb.client import TinyB
|
|
12
12
|
from tinybird.tb.modules.cli import cli
|
|
13
13
|
from tinybird.tb.modules.common import (
|
|
14
14
|
_get_workspace_plan_name,
|
|
@@ -10,8 +10,8 @@ from typing import Any, Dict, Optional, Tuple
|
|
|
10
10
|
import click
|
|
11
11
|
from click import Context
|
|
12
12
|
|
|
13
|
-
from tinybird.client import TinyB
|
|
14
|
-
from tinybird.config import get_display_cloud_host
|
|
13
|
+
from tinybird.tb.client import TinyB
|
|
14
|
+
from tinybird.tb.config import get_display_cloud_host
|
|
15
15
|
from tinybird.tb.modules.common import (
|
|
16
16
|
ask_for_user_token,
|
|
17
17
|
check_user_token,
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
tinybird/connectors.py,sha256=7Gjms7b5MAaBFGi3xytsJurCylprONpFcYrzp4Fw2Rc,15241
|
|
2
|
+
tinybird/context.py,sha256=FfqYfrGX_I7PKGTQo93utaKPDNVYWelg4Hsp3evX5wM,1291
|
|
3
|
+
tinybird/datatypes.py,sha256=r4WCvspmrXTJHiPjjyOTiZyZl31FO3Ynkwq4LQsYm6E,11059
|
|
4
|
+
tinybird/feedback_manager.py,sha256=a_ZhFX2zcB7vRknIcmHKMdQbb0c7TqlTBQ_5hPuWh88,69267
|
|
5
|
+
tinybird/git_settings.py,sha256=Sw_8rGmribEFJ4Z_6idrVytxpFYk7ez8ei0qHULzs3E,3934
|
|
6
|
+
tinybird/prompts.py,sha256=6J-dE0gOSOaIwdEwJUhEQS1Ztllz_qZnpnrv-tDoJWA,35511
|
|
7
|
+
tinybird/sql.py,sha256=C_B81wwv3BsqyXGhF5oTk9DcTUkrp7NwIFqSzd3Dmjc,47854
|
|
8
|
+
tinybird/sql_template.py,sha256=mK0yeRFctbXTAu0VNMjIzoFBJoh9PoniAVgEatA5SG4,99832
|
|
9
|
+
tinybird/sql_template_fmt.py,sha256=KUHdj5rYCYm_rKKdXYSJAE9vIyXUQLB0YSZnUXHeBlY,10196
|
|
10
|
+
tinybird/sql_toolset.py,sha256=KORVbNAUTfW1qo3U9oe7Z59xQ0QMsFhB0ji3HzY2JVo,15324
|
|
11
|
+
tinybird/syncasync.py,sha256=IPnOx6lMbf9SNddN1eBtssg8vCLHMt76SuZ6YNYm-Yk,27761
|
|
12
|
+
tinybird/tornado_template.py,sha256=jjNVDMnkYFWXflmT8KU_Ssbo5vR8KQq3EJMk5vYgXRw,41959
|
|
13
|
+
tinybird/ch_utils/constants.py,sha256=aYvg2C_WxYWsnqPdZB1ZFoIr8ZY-XjUXYyHKE9Ansj0,3890
|
|
14
|
+
tinybird/ch_utils/engine.py,sha256=BZuPM7MFS7vaEKK5tOMR2bwSAgJudPrJt27uVEwZmTY,40512
|
|
15
|
+
tinybird/tb/__cli__.py,sha256=UPIBtmA_KZNY0wM1HvtBDT0JZJO0puY_D9DLW6X0pDw,252
|
|
16
|
+
tinybird/tb/cli.py,sha256=uDLwcbwSJfVFw-pceijZJqaq26z5jNsey0QaUGFjt7w,1097
|
|
17
|
+
tinybird/tb/client.py,sha256=MxhpIC5lkL8JOaS1CxftmE_GxjYGBw4xx9yJzMFm3fM,55664
|
|
18
|
+
tinybird/tb/config.py,sha256=3bEyh6sECiAm41L9Nr_ALkvprMyuzvQSvVPrljFbg68,3790
|
|
19
|
+
tinybird/tb/modules/auth.py,sha256=_OeYnmTH83lnqCgQEdS6K0bx1KBUeRmZk2M7JnRmWpk,9037
|
|
20
|
+
tinybird/tb/modules/build.py,sha256=4yP8QJd2YYr1w9XWCSRqB6CztfVzN6gL75p32UYJvdc,15566
|
|
21
|
+
tinybird/tb/modules/cicd.py,sha256=A7zJZF9HkJ6NPokplgNjmefMrpUlRbFxBbjMZhq5OTI,7110
|
|
22
|
+
tinybird/tb/modules/cli.py,sha256=Y_5hu9xwyTIZw4bQoe0MYLnRIzmR7hUjql_oZBxd4Qg,13407
|
|
23
|
+
tinybird/tb/modules/common.py,sha256=d5h5jSibRXcaDY3d4XkQ5cBjLwSWDPPPQOQFeAuNlV0,84081
|
|
24
|
+
tinybird/tb/modules/config.py,sha256=ziqW_t_mRVvWOd85VoB4vKyvgMkEfpXDf9H4v38p2xc,11422
|
|
25
|
+
tinybird/tb/modules/connection.py,sha256=BPU5Q4gGv6z0aJ8qjKoh5OLa6DTcBaOvEG7EtqJBoQg,6757
|
|
26
|
+
tinybird/tb/modules/copy.py,sha256=2Mm4FWKehOG7CoOhiF1m9UZJgJn0W1_cMolqju8ONYg,5805
|
|
27
|
+
tinybird/tb/modules/create.py,sha256=s0Hx4s4fqqJPlo3Nl2JvybrlaObzBt9ej4Cv5C93HdM,16576
|
|
28
|
+
tinybird/tb/modules/datasource.py,sha256=-aQCK_-wEmoo92Ki7zr2wm424RchDgWvT6yhfFY5kko,16909
|
|
29
|
+
tinybird/tb/modules/deployment.py,sha256=4Zt7jPbqt18fB5kPx7DbO91Bh6xzBBTEUFY7O89shuU,19560
|
|
30
|
+
tinybird/tb/modules/endpoint.py,sha256=XySDt3pk66vxOZ0egUfz4bY8bEk3BjOXkv-L0OIJ3sc,12083
|
|
31
|
+
tinybird/tb/modules/exceptions.py,sha256=4A2sSjCEqKUMqpP3WI00zouCWW4uLaghXXLZBSw04mY,3363
|
|
32
|
+
tinybird/tb/modules/feedback_manager.py,sha256=7GH_Rob23L74UMQ2uG9_bZs1JSyg2W_T2dMAjSYOuPo,74099
|
|
33
|
+
tinybird/tb/modules/fmt.py,sha256=qpf9APqKTKL2uphNgdbj4OMVyLkAxZn6dn4eHF99L5g,3553
|
|
34
|
+
tinybird/tb/modules/infra.py,sha256=eX0StUipaXaxIhMxO82cnAnFKTCa7EPOt-e8pWoSLX0,33206
|
|
35
|
+
tinybird/tb/modules/job.py,sha256=n4dSSBgnA8NqD7srGahf2xRj6wxkmX9Vl0J-QJ_a2w0,2966
|
|
36
|
+
tinybird/tb/modules/llm.py,sha256=KfsCYmKeW1VQz0iDZhGKCRkQv_Y3kTHh6JuxvofOguE,1076
|
|
37
|
+
tinybird/tb/modules/llm_utils.py,sha256=nS9r4FAElJw8yXtmdYrx-rtI2zXR8qXfi1QqUDCfxvg,3469
|
|
38
|
+
tinybird/tb/modules/local.py,sha256=702U0p9pPFwZHkVNEsp2Y5gJxBKtOvd2XoS4dn1p-m8,11111
|
|
39
|
+
tinybird/tb/modules/local_common.py,sha256=DqTHHcq4JitohYvHiqCz2Av4REPhmwwS6naQTOf1Mdk,3191
|
|
40
|
+
tinybird/tb/modules/login.py,sha256=rLYdV7MLCTT1F4VBAWGv6SO9efMiM9-977ayLecUzjI,6842
|
|
41
|
+
tinybird/tb/modules/logout.py,sha256=ULooy1cDBD02-r7voZmhV7udA0ML5tVuflJyShrh56Y,1022
|
|
42
|
+
tinybird/tb/modules/materialization.py,sha256=yIns8ypdFVLWwuCcvAZPBChsuJl2DIxJe6M8UCBHNsU,5752
|
|
43
|
+
tinybird/tb/modules/mock.py,sha256=Z_1nYMO8mmjZkBjikqHNqSd4ssdmcfaXUqIh8jY-z6o,4519
|
|
44
|
+
tinybird/tb/modules/open.py,sha256=s3eJLFtF6OnXX5OLZzBz58dYaG-TGDCYFSJHttm919g,1317
|
|
45
|
+
tinybird/tb/modules/pipe.py,sha256=AQKEDagO6e3psPVjJkS_MDbn8aK-apAiLp26k7jgAV0,2432
|
|
46
|
+
tinybird/tb/modules/project.py,sha256=Jpoi-3ybIixN8bHCqOMnuaKByXjrdN_Gvlpa24L-e4U,3124
|
|
47
|
+
tinybird/tb/modules/regions.py,sha256=QjsL5H6Kg-qr0aYVLrvb1STeJ5Sx_sjvbOYO0LrEGMk,166
|
|
48
|
+
tinybird/tb/modules/secret.py,sha256=rhCRxHKSiUZ4iYY5_EKH57iHzA2mZtjCyuHRsQcA-DY,2823
|
|
49
|
+
tinybird/tb/modules/shell.py,sha256=swVozzVnECuHrQt1BD2Vl14LipFql6ESgc3Ym4mKYog,13939
|
|
50
|
+
tinybird/tb/modules/table.py,sha256=4XrtjM-N0zfNtxVkbvLDQQazno1EPXnxTyo7llivfXk,11035
|
|
51
|
+
tinybird/tb/modules/tag.py,sha256=anPmMUBc-TbFovlpFi8GPkKA18y7Y0GczMsMms5TZsU,3502
|
|
52
|
+
tinybird/tb/modules/telemetry.py,sha256=KEvjbzUsyz3zrNewJLkxoNHRrVJcb4jtkGfIfVLfgfs,10452
|
|
53
|
+
tinybird/tb/modules/test.py,sha256=HxkSpdLOW8brGUNsqdBoSW8RixxyC7OCDmYwEZsIpfs,11459
|
|
54
|
+
tinybird/tb/modules/token.py,sha256=2fmKwu10_M0pqs6YmJVeILR9ZQB0ejRAET86agASbKM,13488
|
|
55
|
+
tinybird/tb/modules/watch.py,sha256=poNJOUNDESDNn80H2dHvE6X6pIu-t9MZFi59_TxVN2U,8822
|
|
56
|
+
tinybird/tb/modules/workspace.py,sha256=SlK08psp0tu5t_URHyIczm696buW6KD6FPs9Lg1aNRE,6614
|
|
57
|
+
tinybird/tb/modules/workspace_members.py,sha256=RYLpyPM1ECCasHRg3uvpckzXplX0_KgNFsSPZn_i6qk,8744
|
|
58
|
+
tinybird/tb/modules/datafile/build.py,sha256=ltQ6ZEYwteYRJNeCgArl5iOWXilnEyUTR-Rd2NIKC5M,50955
|
|
59
|
+
tinybird/tb/modules/datafile/build_common.py,sha256=LU24kAQmxDJIyoIapDaYG-SU3P4FrMG9UBf8m9PgVSI,4565
|
|
60
|
+
tinybird/tb/modules/datafile/build_datasource.py,sha256=nXEQ0qHdq2ai7jJTv8H2d7eeDPBYzLn8VY7zMtOYb8M,17382
|
|
61
|
+
tinybird/tb/modules/datafile/build_pipe.py,sha256=6Cwjf3BKEF3-oQ9PipsQfK-Z43nSwtA4qJAUoysI7Uc,11385
|
|
62
|
+
tinybird/tb/modules/datafile/common.py,sha256=7vlw2tb6FOlq65C_ZdDbgjOR4ni7ysAwjnd05GNdjt8,84365
|
|
63
|
+
tinybird/tb/modules/datafile/diff.py,sha256=MTmj53RYjER4neLgWVjabn-FKVFgh8h8uYiBo55lFQg,6757
|
|
64
|
+
tinybird/tb/modules/datafile/exceptions.py,sha256=8rw2umdZjtby85QbuRKFO5ETz_eRHwUY5l7eHsy1wnI,556
|
|
65
|
+
tinybird/tb/modules/datafile/fixture.py,sha256=V3WGfPLIR78el3oCNWNkySWs6LxIufyIM0mDrrT3aWc,1131
|
|
66
|
+
tinybird/tb/modules/datafile/format_common.py,sha256=WaNV4tXrQU5gjV6MJP-5TGqg_Bre6ilNS8emvFl-X3c,1967
|
|
67
|
+
tinybird/tb/modules/datafile/format_datasource.py,sha256=FgjwxNe0rYVeZbuxnZ5FnD_1ceCENUX2QABKWOznvAA,6159
|
|
68
|
+
tinybird/tb/modules/datafile/format_pipe.py,sha256=58iSTrJ5lg-IsbpX8TQumQTuZ6UIotMsCIkNJd1M-pM,7418
|
|
69
|
+
tinybird/tb/modules/datafile/parse_datasource.py,sha256=cW08P_IaSl3kI3-ApjPW9BZTNaClkeC28Y7nwEw6KRE,1707
|
|
70
|
+
tinybird/tb/modules/datafile/parse_pipe.py,sha256=cGz83DLCZ9y4N9_h5PumpUy3QzhBGu1JC68h1siy5WM,3472
|
|
71
|
+
tinybird/tb/modules/datafile/pipe_checker.py,sha256=LnDLGIHLJ3N7qHb2ptEbPr8CoczNfGwpjOY8EMdxfHQ,24649
|
|
72
|
+
tinybird/tb/modules/datafile/playground.py,sha256=iVZ42pGW8q88Nu4WEe2KlyyDDSafIwzkV-MNVaZT6cY,56548
|
|
73
|
+
tinybird/tb/modules/datafile/pull.py,sha256=l6bIglY8b-tTIWgEYezf4kXjS0QHAVz4iOWLuNwe7Ps,5970
|
|
74
|
+
tinybird/tb/modules/tinyunit/tinyunit.py,sha256=tVynlV16gt1ex0fDmCPmcABQYyzjVnnycHq1Ou3kU0c,11718
|
|
75
|
+
tinybird/tb/modules/tinyunit/tinyunit_lib.py,sha256=hGh1ZaXC1af7rKnX7222urkj0QJMhMWclqMy59dOqwE,1922
|
|
76
|
+
tinybird/tb_cli_modules/cicd.py,sha256=0lMkb6CVOFZl5HOwgY8mK4T4mgI7O8335UngLXtCc-c,13851
|
|
77
|
+
tinybird/tb_cli_modules/common.py,sha256=G08f1_x5YSB6n-ncRj4tB2jhtjAjlWN-QD4xMWbTNQU,83033
|
|
78
|
+
tinybird/tb_cli_modules/config.py,sha256=IsgdtFRnUrkY8-Zo32lmk6O7u3bHie1QCxLwgp4ewgA,11546
|
|
79
|
+
tinybird/tb_cli_modules/exceptions.py,sha256=pmucP4kTF4irIt7dXiG-FcnI-o3mvDusPmch1L8RCWk,3367
|
|
80
|
+
tinybird/tb_cli_modules/regions.py,sha256=QjsL5H6Kg-qr0aYVLrvb1STeJ5Sx_sjvbOYO0LrEGMk,166
|
|
81
|
+
tinybird/tb_cli_modules/telemetry.py,sha256=Hh2Io8ZPROSunbOLuMvuIFU4TqwWPmQTqal4WS09K1A,10449
|
|
82
|
+
tinybird-0.0.1.dev120.dist-info/METADATA,sha256=JesTFd-RCepauIp0A_ooi20zst3Gw9AoBkKxncAZbnI,1612
|
|
83
|
+
tinybird-0.0.1.dev120.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
|
84
|
+
tinybird-0.0.1.dev120.dist-info/entry_points.txt,sha256=LwdHU6TfKx4Qs7BqqtaczEZbImgU7Abe9Lp920zb_fo,43
|
|
85
|
+
tinybird-0.0.1.dev120.dist-info/top_level.txt,sha256=VqqqEmkAy7UNaD8-V51FCoMMWXjLUlR0IstvK7tJYVY,54
|
|
86
|
+
tinybird-0.0.1.dev120.dist-info/RECORD,,
|
tinybird/__cli__.py
DELETED
tinybird/config.py
DELETED
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
import json
|
|
2
|
-
from os import environ, getcwd
|
|
3
|
-
from pathlib import Path
|
|
4
|
-
from typing import Any, Dict, Optional
|
|
5
|
-
|
|
6
|
-
import aiofiles
|
|
7
|
-
import click
|
|
8
|
-
|
|
9
|
-
from tinybird import __cli__
|
|
10
|
-
from tinybird.feedback_manager import FeedbackManager
|
|
11
|
-
|
|
12
|
-
try:
|
|
13
|
-
from tinybird.__cli__ import __revision__
|
|
14
|
-
except Exception:
|
|
15
|
-
__revision__ = ""
|
|
16
|
-
|
|
17
|
-
DEFAULT_API_HOST = "https://api.tinybird.co"
|
|
18
|
-
DEFAULT_LOCALHOST = "http://localhost:8001"
|
|
19
|
-
CURRENT_VERSION = f"{__cli__.__version__}"
|
|
20
|
-
VERSION = f"{__cli__.__version__} (rev {__revision__})"
|
|
21
|
-
DEFAULT_UI_HOST = "https://app.tinybird.co"
|
|
22
|
-
SUPPORTED_CONNECTORS = ["bigquery", "snowflake"]
|
|
23
|
-
PROJECT_PATHS = ["datasources", "datasources/fixtures", "endpoints", "pipes", "tests", "scripts", "deploy"]
|
|
24
|
-
DEPRECATED_PROJECT_PATHS = ["endpoints"]
|
|
25
|
-
MIN_WORKSPACE_ID_LENGTH = 36
|
|
26
|
-
LEGACY_HOSTS = {
|
|
27
|
-
"https://api.tinybird.co": "https://app.tinybird.co/gcp/europe-west3",
|
|
28
|
-
"https://api.us-east.tinybird.co": "https://app.tinybird.co/gcp/us-east4",
|
|
29
|
-
"https://api.us-east.aws.tinybird.co": "https://app.tinybird.co/aws/us-east-1",
|
|
30
|
-
"https://api.us-west-2.aws.tinybird.co": "https://app.tinybird.co/aws/us-west-2",
|
|
31
|
-
"https://api.eu-central-1.aws.tinybird.co": "https://app.tinybird.co/aws/eu-central-1",
|
|
32
|
-
"https://api.eu-west-1.aws.tinybird.co": "https://app.tinybird.co/aws/eu-west-1",
|
|
33
|
-
"https://api.europe-west2.gcp.tinybird.co": "https://cloud.tinybird.co/gcp/europe-west2",
|
|
34
|
-
"https://api.ap-east.aws.tinybird.co": "https://app.tinybird.co/aws/ap-east",
|
|
35
|
-
"https://api.wadus1.gcp.tinybird.co": "https://app.wadus.tinybird.co/gcp/wadus1",
|
|
36
|
-
"https://api.wadus2.gcp.tinybird.co": "https://app.wadus.tinybird.co/gcp/wadus2",
|
|
37
|
-
"https://api.wadus3.gcp.tinybird.co": "https://app.wadus.tinybird.co/gcp/wadus3",
|
|
38
|
-
"https://api.wadus4.gcp.tinybird.co": "https://app.wadus.tinybird.co/gcp/wadus4",
|
|
39
|
-
"https://api.wadus5.gcp.tinybird.co": "https://app.wadus.tinybird.co/gcp/wadus5",
|
|
40
|
-
"https://api.wadus6.gcp.tinybird.co": "https://app.wadus.tinybird.co/gcp/wadus6",
|
|
41
|
-
"https://api.wadus1.aws.tinybird.co": "https://app.wadus.tinybird.co/aws/wadus1",
|
|
42
|
-
"https://api.wadus2.aws.tinybird.co": "https://app.wadus.tinybird.co/aws/wadus2",
|
|
43
|
-
"https://api.wadus3.aws.tinybird.co": "https://app.wadus.tinybird.co/aws/wadus3",
|
|
44
|
-
"https://api.wadus4.aws.tinybird.co": "https://app.wadus.tinybird.co/aws/wadus4",
|
|
45
|
-
"https://api.wadus5.aws.tinybird.co": "https://app.wadus.tinybird.co/aws/wadus5",
|
|
46
|
-
"https://api.wadus6.aws.tinybird.co": "https://app.wadus.tinybird.co/aws/wadus6",
|
|
47
|
-
"https://ui.tinybird.co": "https://app.tinybird.co/gcp/europe-west3",
|
|
48
|
-
"https://ui.us-east.tinybird.co": "https://app.tinybird.co/gcp/us-east4",
|
|
49
|
-
"https://ui.us-east.aws.tinybird.co": "https://app.tinybird.co/aws/us-east-1",
|
|
50
|
-
"https://ui.us-west-2.aws.tinybird.co": "https://app.tinybird.co/aws/us-west-2",
|
|
51
|
-
"https://ui.eu-central-1.aws.tinybird.co": "https://app.tinybird.co/aws/eu-central-1",
|
|
52
|
-
"https://ui.europe-west2.gcp.tinybird.co": "https://cloud.tinybird.co/gcp/europe-west2",
|
|
53
|
-
"https://ui.ap-east.aws.tinybird.co": "https://app.tinybird.co/aws/ap-east",
|
|
54
|
-
"https://ui.split.tinybird.co": "https://app.tinybird.co/aws/split-us-east",
|
|
55
|
-
"https://ui.split.us-west-2.aws.tinybird.co": "https://app.tinybird.co/aws/split-us-west-2",
|
|
56
|
-
"https://api.split.tinybird.co": "https://app.tinybird.co/aws/split-us-east",
|
|
57
|
-
"https://api.split.us-west-2.aws.tinybird.co": "https://app.tinybird.co/aws/split-us-west-2",
|
|
58
|
-
"https://ui.wadus1.gcp.tinybird.co": "https://app.wadus.tinybird.co/gcp/wadus1",
|
|
59
|
-
"https://ui.wadus2.gcp.tinybird.co": "https://app.wadus.tinybird.co/gcp/wadus2",
|
|
60
|
-
"https://ui.wadus3.gcp.tinybird.co": "https://app.wadus.tinybird.co/gcp/wadus3",
|
|
61
|
-
"https://ui.wadus4.gcp.tinybird.co": "https://app.wadus.tinybird.co/gcp/wadus4",
|
|
62
|
-
"https://ui.wadus5.gcp.tinybird.co": "https://app.wadus.tinybird.co/gcp/wadus5",
|
|
63
|
-
"https://ui.wadus6.gcp.tinybird.co": "https://app.wadus.tinybird.co/gcp/wadus6",
|
|
64
|
-
"https://ui.wadus1.aws.tinybird.co": "https://app.wadus.tinybird.co/aws/wadus1",
|
|
65
|
-
"https://ui.wadus2.aws.tinybird.co": "https://app.wadus.tinybird.co/aws/wadus2",
|
|
66
|
-
"https://ui.wadus3.aws.tinybird.co": "https://app.wadus.tinybird.co/aws/wadus3",
|
|
67
|
-
"https://ui.wadus4.aws.tinybird.co": "https://app.wadus.tinybird.co/aws/wadus4",
|
|
68
|
-
"https://ui.wadus5.aws.tinybird.co": "https://app.wadus.tinybird.co/aws/wadus5",
|
|
69
|
-
"https://ui.wadus6.aws.tinybird.co": "https://app.wadus.tinybird.co/aws/wadus6",
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
CLOUD_HOSTS = {
|
|
74
|
-
"https://api.tinybird.co": "https://cloud.tinybird.co/gcp/europe-west3",
|
|
75
|
-
"https://api.us-east.tinybird.co": "https://cloud.tinybird.co/gcp/us-east4",
|
|
76
|
-
"https://api.us-east.aws.tinybird.co": "https://cloud.tinybird.co/aws/us-east-1",
|
|
77
|
-
"https://api.us-west-2.aws.tinybird.co": "https://cloud.tinybird.co/aws/us-west-2",
|
|
78
|
-
"https://api.eu-central-1.aws.tinybird.co": "https://cloud.tinybird.co/aws/eu-central-1",
|
|
79
|
-
"https://api.eu-west-1.aws.tinybird.co": "https://cloud.tinybird.co/aws/eu-west-1",
|
|
80
|
-
"https://api.europe-west2.gcp.tinybird.co": "https://cloud.tinybird.co/gcp/europe-west2",
|
|
81
|
-
"https://api.ap-east.aws.tinybird.co": "https://cloud.tinybird.co/aws/ap-east",
|
|
82
|
-
"https://ui.tinybird.co": "https://cloud.tinybird.co/gcp/europe-west3",
|
|
83
|
-
"https://ui.us-east.tinybird.co": "https://cloud.tinybird.co/gcp/us-east4",
|
|
84
|
-
"https://ui.us-east.aws.tinybird.co": "https://cloud.tinybird.co/aws/us-east-1",
|
|
85
|
-
"https://ui.us-west-2.aws.tinybird.co": "https://cloud.tinybird.co/aws/us-west-2",
|
|
86
|
-
"https://ui.eu-central-1.aws.tinybird.co": "https://cloud.tinybird.co/aws/eu-central-1",
|
|
87
|
-
"https://ui.europe-west2.gcp.tinybird.co": "https://cloud.tinybird.co/gcp/europe-west2",
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
async def get_config(
|
|
92
|
-
host: str, token: Optional[str], semver: Optional[str] = None, config_file: Optional[str] = None
|
|
93
|
-
) -> Dict[str, Any]:
|
|
94
|
-
if host:
|
|
95
|
-
host = host.rstrip("/")
|
|
96
|
-
|
|
97
|
-
config = {}
|
|
98
|
-
try:
|
|
99
|
-
async with aiofiles.open(config_file or Path(getcwd()) / ".tinyb") as file:
|
|
100
|
-
res = await file.read()
|
|
101
|
-
config = json.loads(res)
|
|
102
|
-
except OSError:
|
|
103
|
-
pass
|
|
104
|
-
except json.decoder.JSONDecodeError:
|
|
105
|
-
click.echo(FeedbackManager.error_load_file_config(config_file=config_file))
|
|
106
|
-
return config
|
|
107
|
-
|
|
108
|
-
config["token_passed"] = token
|
|
109
|
-
config["token"] = token or config.get("token", None)
|
|
110
|
-
config["semver"] = semver or config.get("semver", None)
|
|
111
|
-
config["host"] = host or config.get("host", DEFAULT_API_HOST)
|
|
112
|
-
config["workspaces"] = config.get("workspaces", [])
|
|
113
|
-
config["cwd"] = config.get("cwd", getcwd())
|
|
114
|
-
return config
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
async def write_config(config: Dict[str, Any], dest_file: str = ".tinyb"):
|
|
118
|
-
config_file = Path(getcwd()) / dest_file
|
|
119
|
-
async with aiofiles.open(config_file, "w") as file:
|
|
120
|
-
await file.write(json.dumps(config, indent=4, sort_keys=True))
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
def get_display_host(ui_host: str):
|
|
124
|
-
return LEGACY_HOSTS.get(ui_host, ui_host)
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
def get_display_cloud_host(api_host: str) -> str:
|
|
128
|
-
is_local = "localhost" in api_host
|
|
129
|
-
if is_local:
|
|
130
|
-
port = api_host.split(":")[-1]
|
|
131
|
-
return f"http://cloud.tinybird.co/local/{port}"
|
|
132
|
-
return CLOUD_HOSTS.get(api_host, api_host)
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
class FeatureFlags:
|
|
136
|
-
@classmethod
|
|
137
|
-
def ignore_sql_errors(cls) -> bool: # Context: #1155
|
|
138
|
-
return "TB_IGNORE_SQL_ERRORS" in environ
|
|
139
|
-
|
|
140
|
-
@classmethod
|
|
141
|
-
def is_localhost(cls) -> bool:
|
|
142
|
-
return "SET_LOCALHOST" in environ
|
|
143
|
-
|
|
144
|
-
@classmethod
|
|
145
|
-
def enable_snowflake_connector_command(cls) -> bool:
|
|
146
|
-
return "ENABLE_SNOWFLAKE_CONNECTOR_COMMAND" in environ
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
tinybird/__cli__.py,sha256=esPl5QDTzuQgHe5FuxWLm-fURFigGGwjnYLh9GuWUw4,232
|
|
2
|
-
tinybird/client.py,sha256=yc2BP2HiQhaUjU-t7nBuZEiJsb2nQMH3vBfOhKCciyU,55468
|
|
3
|
-
tinybird/config.py,sha256=iGOwxuWXpY82gBNoL71huJvQixe2IZEJ4jE3Y5thRA4,7548
|
|
4
|
-
tinybird/connectors.py,sha256=7Gjms7b5MAaBFGi3xytsJurCylprONpFcYrzp4Fw2Rc,15241
|
|
5
|
-
tinybird/context.py,sha256=FfqYfrGX_I7PKGTQo93utaKPDNVYWelg4Hsp3evX5wM,1291
|
|
6
|
-
tinybird/datatypes.py,sha256=XNypumfqNjsvLJ5iNXnbVHRvAJe0aQwI3lS6Cxox-e0,10979
|
|
7
|
-
tinybird/feedback_manager.py,sha256=a_ZhFX2zcB7vRknIcmHKMdQbb0c7TqlTBQ_5hPuWh88,69267
|
|
8
|
-
tinybird/git_settings.py,sha256=Sw_8rGmribEFJ4Z_6idrVytxpFYk7ez8ei0qHULzs3E,3934
|
|
9
|
-
tinybird/prompts.py,sha256=6J-dE0gOSOaIwdEwJUhEQS1Ztllz_qZnpnrv-tDoJWA,35511
|
|
10
|
-
tinybird/sql.py,sha256=C_B81wwv3BsqyXGhF5oTk9DcTUkrp7NwIFqSzd3Dmjc,47854
|
|
11
|
-
tinybird/sql_template.py,sha256=mK0yeRFctbXTAu0VNMjIzoFBJoh9PoniAVgEatA5SG4,99832
|
|
12
|
-
tinybird/sql_template_fmt.py,sha256=KUHdj5rYCYm_rKKdXYSJAE9vIyXUQLB0YSZnUXHeBlY,10196
|
|
13
|
-
tinybird/sql_toolset.py,sha256=KORVbNAUTfW1qo3U9oe7Z59xQ0QMsFhB0ji3HzY2JVo,15324
|
|
14
|
-
tinybird/syncasync.py,sha256=IPnOx6lMbf9SNddN1eBtssg8vCLHMt76SuZ6YNYm-Yk,27761
|
|
15
|
-
tinybird/tornado_template.py,sha256=jjNVDMnkYFWXflmT8KU_Ssbo5vR8KQq3EJMk5vYgXRw,41959
|
|
16
|
-
tinybird/ch_utils/constants.py,sha256=aYvg2C_WxYWsnqPdZB1ZFoIr8ZY-XjUXYyHKE9Ansj0,3890
|
|
17
|
-
tinybird/ch_utils/engine.py,sha256=BZuPM7MFS7vaEKK5tOMR2bwSAgJudPrJt27uVEwZmTY,40512
|
|
18
|
-
tinybird/tb/__cli__.py,sha256=yrZISOnuZA2cFwARxKlPwsNs0Ot_jk2nvuUtNLbV6_g,252
|
|
19
|
-
tinybird/tb/cli.py,sha256=uDLwcbwSJfVFw-pceijZJqaq26z5jNsey0QaUGFjt7w,1097
|
|
20
|
-
tinybird/tb/modules/auth.py,sha256=NF0yfkGGBOtZRot-JPYbLD53i2kQ6lxJMD1140xtfzc,9034
|
|
21
|
-
tinybird/tb/modules/build.py,sha256=Lx1Q-kcxJN0G3pN3qCD8c8RmTpsmMoxCPhmn4DS2QMM,15563
|
|
22
|
-
tinybird/tb/modules/cicd.py,sha256=A7zJZF9HkJ6NPokplgNjmefMrpUlRbFxBbjMZhq5OTI,7110
|
|
23
|
-
tinybird/tb/modules/cli.py,sha256=cyvTGb17eWHdfI61Rom0ooD5D2aI1gRqx2nSi1gqtWA,16143
|
|
24
|
-
tinybird/tb/modules/common.py,sha256=IP9SHV7Qv0YFUcZiJrkUf4NeHRzt2a6uwsL9p_QK9ms,83990
|
|
25
|
-
tinybird/tb/modules/config.py,sha256=FqdLpLaKpYubqw3xkB4EX06ufZYDgGRxONR_9i-y-KE,11416
|
|
26
|
-
tinybird/tb/modules/connection.py,sha256=fhpkAGhY5mqFVqXn69B90ngaKX88rXznlMGjohDgqpM,6336
|
|
27
|
-
tinybird/tb/modules/copy.py,sha256=MAVqKip8_QhOYq99U_XuqSO6hCLJEh5sFtbhcXtI3SI,5802
|
|
28
|
-
tinybird/tb/modules/create.py,sha256=K851M8N6kDemUDJUs3ukUWPl6G6z2CVnlME13ttDutk,16573
|
|
29
|
-
tinybird/tb/modules/datasource.py,sha256=dNCK9iCR2xPLfwqqwg2ixyE6NuoVEiJU2mBZBmOYrVY,16906
|
|
30
|
-
tinybird/tb/modules/deployment.py,sha256=4Zt7jPbqt18fB5kPx7DbO91Bh6xzBBTEUFY7O89shuU,19560
|
|
31
|
-
tinybird/tb/modules/endpoint.py,sha256=EhVoGAXsFz-83Fiwj1gI-I73iRRvL49d0W81un7hvPE,12080
|
|
32
|
-
tinybird/tb/modules/exceptions.py,sha256=4A2sSjCEqKUMqpP3WI00zouCWW4uLaghXXLZBSw04mY,3363
|
|
33
|
-
tinybird/tb/modules/feedback_manager.py,sha256=4Somda9qWcibNRteE-aj50WpQ4gdEzhdpY6mh1LiGL0,73984
|
|
34
|
-
tinybird/tb/modules/fmt.py,sha256=qpf9APqKTKL2uphNgdbj4OMVyLkAxZn6dn4eHF99L5g,3553
|
|
35
|
-
tinybird/tb/modules/infra.py,sha256=fnbsfx8paRE8RHPbjdSOiOEvtyQbJ95OrHZuCighgKA,33203
|
|
36
|
-
tinybird/tb/modules/job.py,sha256=956Pj8BEEsiD2GZsV9RKKVM3I_CveOLgS82lykO5ukk,2963
|
|
37
|
-
tinybird/tb/modules/llm.py,sha256=AC0VSphTOM2t-v1_3NLvNN_FIbgMo4dTyMqIv5nniPo,835
|
|
38
|
-
tinybird/tb/modules/llm_utils.py,sha256=nS9r4FAElJw8yXtmdYrx-rtI2zXR8qXfi1QqUDCfxvg,3469
|
|
39
|
-
tinybird/tb/modules/local.py,sha256=n2BRj51yRmYfd_2fuNPv0iNLKftCP-OvYVtZsUTXQsk,11028
|
|
40
|
-
tinybird/tb/modules/local_common.py,sha256=RN5OEncHdq7ua4AZ--WgKtaFuEsLvIhq_ROHJadRXXA,3188
|
|
41
|
-
tinybird/tb/modules/login.py,sha256=lLCJ1kIq3sLcoSMH1kZge5isHh-fDwHPRHApIqbaCkw,6350
|
|
42
|
-
tinybird/tb/modules/logout.py,sha256=ULooy1cDBD02-r7voZmhV7udA0ML5tVuflJyShrh56Y,1022
|
|
43
|
-
tinybird/tb/modules/materialization.py,sha256=r8Q9HXcYEmfrEzP4WpiasCKDJdSkTPaAKJtZMoJKhi8,5749
|
|
44
|
-
tinybird/tb/modules/mock.py,sha256=2E26N8TMK1sP7eRc9N1nODdc_vU1jBeGRs8e-fbQ5Dc,4516
|
|
45
|
-
tinybird/tb/modules/open.py,sha256=s3eJLFtF6OnXX5OLZzBz58dYaG-TGDCYFSJHttm919g,1317
|
|
46
|
-
tinybird/tb/modules/pipe.py,sha256=gcLz0qHgwKDLsWFY3yFLO9a0ETAV1dFbI8YeLHi9460,2429
|
|
47
|
-
tinybird/tb/modules/project.py,sha256=Jpoi-3ybIixN8bHCqOMnuaKByXjrdN_Gvlpa24L-e4U,3124
|
|
48
|
-
tinybird/tb/modules/regions.py,sha256=QjsL5H6Kg-qr0aYVLrvb1STeJ5Sx_sjvbOYO0LrEGMk,166
|
|
49
|
-
tinybird/tb/modules/secret.py,sha256=xxzfKxfFN7GORib1WslCaFDHt_dgnjmfOewyptPU_VM,2820
|
|
50
|
-
tinybird/tb/modules/shell.py,sha256=7BX9fhqq2tAvdhd1Ig1e35ePYcPH3Eh7ivZDAVwrQCk,13936
|
|
51
|
-
tinybird/tb/modules/table.py,sha256=4XrtjM-N0zfNtxVkbvLDQQazno1EPXnxTyo7llivfXk,11035
|
|
52
|
-
tinybird/tb/modules/tag.py,sha256=anPmMUBc-TbFovlpFi8GPkKA18y7Y0GczMsMms5TZsU,3502
|
|
53
|
-
tinybird/tb/modules/telemetry.py,sha256=Hh2Io8ZPROSunbOLuMvuIFU4TqwWPmQTqal4WS09K1A,10449
|
|
54
|
-
tinybird/tb/modules/test.py,sha256=FUU-drY8mdjNoKsw16O5ZqvYvZqzycrZBEpSwbhGDUE,11456
|
|
55
|
-
tinybird/tb/modules/token.py,sha256=OhqLFpCHVfYeBCxJ0n7n2qoho9E9eGcUfHgL7R1MUVQ,13485
|
|
56
|
-
tinybird/tb/modules/watch.py,sha256=poNJOUNDESDNn80H2dHvE6X6pIu-t9MZFi59_TxVN2U,8822
|
|
57
|
-
tinybird/tb/modules/workspace.py,sha256=pk9_6fNxXGM1JPQcjTz7Sj77qn9ML27lGIyYEHPwORE,6611
|
|
58
|
-
tinybird/tb/modules/workspace_members.py,sha256=BnPvVfXDBUmwcN5dYOQ8VGx4J9PuykWDalouUSptpyU,8738
|
|
59
|
-
tinybird/tb/modules/datafile/build.py,sha256=jhfIJ2xt0N13XsLPe3iMQIyCPApHS13_Df2LfISYtT8,50952
|
|
60
|
-
tinybird/tb/modules/datafile/build_common.py,sha256=rT7VJ5mnQ68R_8US91DAtkusfvjWuG_NObOzNgtN_ko,4562
|
|
61
|
-
tinybird/tb/modules/datafile/build_datasource.py,sha256=CCU3eQ8Rax9RgHHfbAXDRL6rQ49N35h_GDQnGrUUUzA,17379
|
|
62
|
-
tinybird/tb/modules/datafile/build_pipe.py,sha256=w-Wd08gZYAEcak9FdBijVfIU2_Wn_PPdgAZddPpoGTo,11382
|
|
63
|
-
tinybird/tb/modules/datafile/common.py,sha256=4pvW92X9BXomaN3-WhQOjvnAHY96O4dTsp4USBdknzk,83192
|
|
64
|
-
tinybird/tb/modules/datafile/diff.py,sha256=-0J7PsBO64T7LOZSkZ4ZFHHCPvT7cKItnJkbz2PkndU,6754
|
|
65
|
-
tinybird/tb/modules/datafile/exceptions.py,sha256=8rw2umdZjtby85QbuRKFO5ETz_eRHwUY5l7eHsy1wnI,556
|
|
66
|
-
tinybird/tb/modules/datafile/fixture.py,sha256=V3WGfPLIR78el3oCNWNkySWs6LxIufyIM0mDrrT3aWc,1131
|
|
67
|
-
tinybird/tb/modules/datafile/format_common.py,sha256=WaNV4tXrQU5gjV6MJP-5TGqg_Bre6ilNS8emvFl-X3c,1967
|
|
68
|
-
tinybird/tb/modules/datafile/format_datasource.py,sha256=gpRsGnDEMxEo0pIlEHXKvyuwKIpqJJUCN9JRSiDYs_4,6156
|
|
69
|
-
tinybird/tb/modules/datafile/format_pipe.py,sha256=58iSTrJ5lg-IsbpX8TQumQTuZ6UIotMsCIkNJd1M-pM,7418
|
|
70
|
-
tinybird/tb/modules/datafile/parse_datasource.py,sha256=cW08P_IaSl3kI3-ApjPW9BZTNaClkeC28Y7nwEw6KRE,1707
|
|
71
|
-
tinybird/tb/modules/datafile/parse_pipe.py,sha256=cGz83DLCZ9y4N9_h5PumpUy3QzhBGu1JC68h1siy5WM,3472
|
|
72
|
-
tinybird/tb/modules/datafile/pipe_checker.py,sha256=LnDLGIHLJ3N7qHb2ptEbPr8CoczNfGwpjOY8EMdxfHQ,24649
|
|
73
|
-
tinybird/tb/modules/datafile/playground.py,sha256=7yblQh3jlNfdY0ySSCBrXTK6mE9e0TFI-TbaGGV-qBE,56545
|
|
74
|
-
tinybird/tb/modules/datafile/pull.py,sha256=vcjMUbjnZ9XQMGmL33J3ElpbXBTat8Yzp-haeDggZd4,5967
|
|
75
|
-
tinybird/tb/modules/tinyunit/tinyunit.py,sha256=GlDgEXc6TDO3ODxgfATAL2fvbKy-b_CzqoeDrApRm0g,11715
|
|
76
|
-
tinybird/tb/modules/tinyunit/tinyunit_lib.py,sha256=hGh1ZaXC1af7rKnX7222urkj0QJMhMWclqMy59dOqwE,1922
|
|
77
|
-
tinybird/tb_cli_modules/cicd.py,sha256=0lMkb6CVOFZl5HOwgY8mK4T4mgI7O8335UngLXtCc-c,13851
|
|
78
|
-
tinybird/tb_cli_modules/common.py,sha256=G08f1_x5YSB6n-ncRj4tB2jhtjAjlWN-QD4xMWbTNQU,83033
|
|
79
|
-
tinybird/tb_cli_modules/config.py,sha256=IsgdtFRnUrkY8-Zo32lmk6O7u3bHie1QCxLwgp4ewgA,11546
|
|
80
|
-
tinybird/tb_cli_modules/exceptions.py,sha256=pmucP4kTF4irIt7dXiG-FcnI-o3mvDusPmch1L8RCWk,3367
|
|
81
|
-
tinybird/tb_cli_modules/regions.py,sha256=QjsL5H6Kg-qr0aYVLrvb1STeJ5Sx_sjvbOYO0LrEGMk,166
|
|
82
|
-
tinybird/tb_cli_modules/telemetry.py,sha256=Hh2Io8ZPROSunbOLuMvuIFU4TqwWPmQTqal4WS09K1A,10449
|
|
83
|
-
tinybird-0.0.1.dev118.dist-info/METADATA,sha256=V_RQFDErCfGK_9Vb-dCuA9CsNMC3V-wkVlcgxIqDuVc,1612
|
|
84
|
-
tinybird-0.0.1.dev118.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
|
85
|
-
tinybird-0.0.1.dev118.dist-info/entry_points.txt,sha256=LwdHU6TfKx4Qs7BqqtaczEZbImgU7Abe9Lp920zb_fo,43
|
|
86
|
-
tinybird-0.0.1.dev118.dist-info/top_level.txt,sha256=VqqqEmkAy7UNaD8-V51FCoMMWXjLUlR0IstvK7tJYVY,54
|
|
87
|
-
tinybird-0.0.1.dev118.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|