tinybird 0.0.1.dev118__py3-none-any.whl → 0.0.1.dev119__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/tb/__cli__.py +2 -2
- tinybird/{client.py → tb/client.py} +1 -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 +1 -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/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/infra.py +1 -1
- tinybird/tb/modules/job.py +1 -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.dev119.dist-info}/METADATA +1 -1
- {tinybird-0.0.1.dev118.dist-info → tinybird-0.0.1.dev119.dist-info}/RECORD +41 -42
- tinybird/__cli__.py +0 -7
- tinybird/config.py +0 -146
- {tinybird-0.0.1.dev118.dist-info → tinybird-0.0.1.dev119.dist-info}/WHEEL +0 -0
- {tinybird-0.0.1.dev118.dist-info → tinybird-0.0.1.dev119.dist-info}/entry_points.txt +0 -0
- {tinybird-0.0.1.dev118.dist-info → tinybird-0.0.1.dev119.dist-info}/top_level.txt +0 -0
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.dev119'
|
|
8
|
+
__revision__ = 'bbe4729'
|
|
@@ -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
|
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,
|
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
|
|
@@ -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
|
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
|
|
@@ -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,
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
tinybird/__cli__.py,sha256=esPl5QDTzuQgHe5FuxWLm-fURFigGGwjnYLh9GuWUw4,232
|
|
2
|
-
tinybird/client.py,sha256=yc2BP2HiQhaUjU-t7nBuZEiJsb2nQMH3vBfOhKCciyU,55468
|
|
3
|
-
tinybird/config.py,sha256=iGOwxuWXpY82gBNoL71huJvQixe2IZEJ4jE3Y5thRA4,7548
|
|
4
1
|
tinybird/connectors.py,sha256=7Gjms7b5MAaBFGi3xytsJurCylprONpFcYrzp4Fw2Rc,15241
|
|
5
2
|
tinybird/context.py,sha256=FfqYfrGX_I7PKGTQo93utaKPDNVYWelg4Hsp3evX5wM,1291
|
|
6
3
|
tinybird/datatypes.py,sha256=XNypumfqNjsvLJ5iNXnbVHRvAJe0aQwI3lS6Cxox-e0,10979
|
|
@@ -15,64 +12,66 @@ tinybird/syncasync.py,sha256=IPnOx6lMbf9SNddN1eBtssg8vCLHMt76SuZ6YNYm-Yk,27761
|
|
|
15
12
|
tinybird/tornado_template.py,sha256=jjNVDMnkYFWXflmT8KU_Ssbo5vR8KQq3EJMk5vYgXRw,41959
|
|
16
13
|
tinybird/ch_utils/constants.py,sha256=aYvg2C_WxYWsnqPdZB1ZFoIr8ZY-XjUXYyHKE9Ansj0,3890
|
|
17
14
|
tinybird/ch_utils/engine.py,sha256=BZuPM7MFS7vaEKK5tOMR2bwSAgJudPrJt27uVEwZmTY,40512
|
|
18
|
-
tinybird/tb/__cli__.py,sha256=
|
|
15
|
+
tinybird/tb/__cli__.py,sha256=17vHNVcPbqx_TWEowqxodoPtHhbxEqUTKuhIYCtjQDY,252
|
|
19
16
|
tinybird/tb/cli.py,sha256=uDLwcbwSJfVFw-pceijZJqaq26z5jNsey0QaUGFjt7w,1097
|
|
20
|
-
tinybird/tb/
|
|
21
|
-
tinybird/tb/
|
|
17
|
+
tinybird/tb/client.py,sha256=4SQE1Ke8ZAIbCkGfGlDm2ChCESRy_oYtWK7ZW6aZmhA,55464
|
|
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
|
|
22
21
|
tinybird/tb/modules/cicd.py,sha256=A7zJZF9HkJ6NPokplgNjmefMrpUlRbFxBbjMZhq5OTI,7110
|
|
23
|
-
tinybird/tb/modules/cli.py,sha256=
|
|
24
|
-
tinybird/tb/modules/common.py,sha256=
|
|
25
|
-
tinybird/tb/modules/config.py,sha256=
|
|
26
|
-
tinybird/tb/modules/connection.py,sha256=
|
|
27
|
-
tinybird/tb/modules/copy.py,sha256=
|
|
28
|
-
tinybird/tb/modules/create.py,sha256=
|
|
29
|
-
tinybird/tb/modules/datasource.py,sha256
|
|
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=IVp2-E5mcwABc6FtdjhLhz0Nbr3xR5oSP9M7IEEraLA,6339
|
|
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
|
|
30
29
|
tinybird/tb/modules/deployment.py,sha256=4Zt7jPbqt18fB5kPx7DbO91Bh6xzBBTEUFY7O89shuU,19560
|
|
31
|
-
tinybird/tb/modules/endpoint.py,sha256=
|
|
30
|
+
tinybird/tb/modules/endpoint.py,sha256=XySDt3pk66vxOZ0egUfz4bY8bEk3BjOXkv-L0OIJ3sc,12083
|
|
32
31
|
tinybird/tb/modules/exceptions.py,sha256=4A2sSjCEqKUMqpP3WI00zouCWW4uLaghXXLZBSw04mY,3363
|
|
33
32
|
tinybird/tb/modules/feedback_manager.py,sha256=4Somda9qWcibNRteE-aj50WpQ4gdEzhdpY6mh1LiGL0,73984
|
|
34
33
|
tinybird/tb/modules/fmt.py,sha256=qpf9APqKTKL2uphNgdbj4OMVyLkAxZn6dn4eHF99L5g,3553
|
|
35
|
-
tinybird/tb/modules/infra.py,sha256=
|
|
36
|
-
tinybird/tb/modules/job.py,sha256=
|
|
34
|
+
tinybird/tb/modules/infra.py,sha256=eX0StUipaXaxIhMxO82cnAnFKTCa7EPOt-e8pWoSLX0,33206
|
|
35
|
+
tinybird/tb/modules/job.py,sha256=n4dSSBgnA8NqD7srGahf2xRj6wxkmX9Vl0J-QJ_a2w0,2966
|
|
37
36
|
tinybird/tb/modules/llm.py,sha256=AC0VSphTOM2t-v1_3NLvNN_FIbgMo4dTyMqIv5nniPo,835
|
|
38
37
|
tinybird/tb/modules/llm_utils.py,sha256=nS9r4FAElJw8yXtmdYrx-rtI2zXR8qXfi1QqUDCfxvg,3469
|
|
39
38
|
tinybird/tb/modules/local.py,sha256=n2BRj51yRmYfd_2fuNPv0iNLKftCP-OvYVtZsUTXQsk,11028
|
|
40
|
-
tinybird/tb/modules/local_common.py,sha256=
|
|
41
|
-
tinybird/tb/modules/login.py,sha256=
|
|
39
|
+
tinybird/tb/modules/local_common.py,sha256=DqTHHcq4JitohYvHiqCz2Av4REPhmwwS6naQTOf1Mdk,3191
|
|
40
|
+
tinybird/tb/modules/login.py,sha256=rLYdV7MLCTT1F4VBAWGv6SO9efMiM9-977ayLecUzjI,6842
|
|
42
41
|
tinybird/tb/modules/logout.py,sha256=ULooy1cDBD02-r7voZmhV7udA0ML5tVuflJyShrh56Y,1022
|
|
43
|
-
tinybird/tb/modules/materialization.py,sha256=
|
|
44
|
-
tinybird/tb/modules/mock.py,sha256=
|
|
42
|
+
tinybird/tb/modules/materialization.py,sha256=yIns8ypdFVLWwuCcvAZPBChsuJl2DIxJe6M8UCBHNsU,5752
|
|
43
|
+
tinybird/tb/modules/mock.py,sha256=Z_1nYMO8mmjZkBjikqHNqSd4ssdmcfaXUqIh8jY-z6o,4519
|
|
45
44
|
tinybird/tb/modules/open.py,sha256=s3eJLFtF6OnXX5OLZzBz58dYaG-TGDCYFSJHttm919g,1317
|
|
46
|
-
tinybird/tb/modules/pipe.py,sha256=
|
|
45
|
+
tinybird/tb/modules/pipe.py,sha256=AQKEDagO6e3psPVjJkS_MDbn8aK-apAiLp26k7jgAV0,2432
|
|
47
46
|
tinybird/tb/modules/project.py,sha256=Jpoi-3ybIixN8bHCqOMnuaKByXjrdN_Gvlpa24L-e4U,3124
|
|
48
47
|
tinybird/tb/modules/regions.py,sha256=QjsL5H6Kg-qr0aYVLrvb1STeJ5Sx_sjvbOYO0LrEGMk,166
|
|
49
|
-
tinybird/tb/modules/secret.py,sha256=
|
|
50
|
-
tinybird/tb/modules/shell.py,sha256=
|
|
48
|
+
tinybird/tb/modules/secret.py,sha256=rhCRxHKSiUZ4iYY5_EKH57iHzA2mZtjCyuHRsQcA-DY,2823
|
|
49
|
+
tinybird/tb/modules/shell.py,sha256=swVozzVnECuHrQt1BD2Vl14LipFql6ESgc3Ym4mKYog,13939
|
|
51
50
|
tinybird/tb/modules/table.py,sha256=4XrtjM-N0zfNtxVkbvLDQQazno1EPXnxTyo7llivfXk,11035
|
|
52
51
|
tinybird/tb/modules/tag.py,sha256=anPmMUBc-TbFovlpFi8GPkKA18y7Y0GczMsMms5TZsU,3502
|
|
53
|
-
tinybird/tb/modules/telemetry.py,sha256=
|
|
54
|
-
tinybird/tb/modules/test.py,sha256=
|
|
55
|
-
tinybird/tb/modules/token.py,sha256=
|
|
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
|
|
56
55
|
tinybird/tb/modules/watch.py,sha256=poNJOUNDESDNn80H2dHvE6X6pIu-t9MZFi59_TxVN2U,8822
|
|
57
|
-
tinybird/tb/modules/workspace.py,sha256=
|
|
58
|
-
tinybird/tb/modules/workspace_members.py,sha256=
|
|
59
|
-
tinybird/tb/modules/datafile/build.py,sha256=
|
|
60
|
-
tinybird/tb/modules/datafile/build_common.py,sha256=
|
|
61
|
-
tinybird/tb/modules/datafile/build_datasource.py,sha256=
|
|
62
|
-
tinybird/tb/modules/datafile/build_pipe.py,sha256=
|
|
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
|
|
63
62
|
tinybird/tb/modules/datafile/common.py,sha256=4pvW92X9BXomaN3-WhQOjvnAHY96O4dTsp4USBdknzk,83192
|
|
64
|
-
tinybird/tb/modules/datafile/diff.py,sha256
|
|
63
|
+
tinybird/tb/modules/datafile/diff.py,sha256=MTmj53RYjER4neLgWVjabn-FKVFgh8h8uYiBo55lFQg,6757
|
|
65
64
|
tinybird/tb/modules/datafile/exceptions.py,sha256=8rw2umdZjtby85QbuRKFO5ETz_eRHwUY5l7eHsy1wnI,556
|
|
66
65
|
tinybird/tb/modules/datafile/fixture.py,sha256=V3WGfPLIR78el3oCNWNkySWs6LxIufyIM0mDrrT3aWc,1131
|
|
67
66
|
tinybird/tb/modules/datafile/format_common.py,sha256=WaNV4tXrQU5gjV6MJP-5TGqg_Bre6ilNS8emvFl-X3c,1967
|
|
68
|
-
tinybird/tb/modules/datafile/format_datasource.py,sha256=
|
|
67
|
+
tinybird/tb/modules/datafile/format_datasource.py,sha256=FgjwxNe0rYVeZbuxnZ5FnD_1ceCENUX2QABKWOznvAA,6159
|
|
69
68
|
tinybird/tb/modules/datafile/format_pipe.py,sha256=58iSTrJ5lg-IsbpX8TQumQTuZ6UIotMsCIkNJd1M-pM,7418
|
|
70
69
|
tinybird/tb/modules/datafile/parse_datasource.py,sha256=cW08P_IaSl3kI3-ApjPW9BZTNaClkeC28Y7nwEw6KRE,1707
|
|
71
70
|
tinybird/tb/modules/datafile/parse_pipe.py,sha256=cGz83DLCZ9y4N9_h5PumpUy3QzhBGu1JC68h1siy5WM,3472
|
|
72
71
|
tinybird/tb/modules/datafile/pipe_checker.py,sha256=LnDLGIHLJ3N7qHb2ptEbPr8CoczNfGwpjOY8EMdxfHQ,24649
|
|
73
|
-
tinybird/tb/modules/datafile/playground.py,sha256=
|
|
74
|
-
tinybird/tb/modules/datafile/pull.py,sha256=
|
|
75
|
-
tinybird/tb/modules/tinyunit/tinyunit.py,sha256=
|
|
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
|
|
76
75
|
tinybird/tb/modules/tinyunit/tinyunit_lib.py,sha256=hGh1ZaXC1af7rKnX7222urkj0QJMhMWclqMy59dOqwE,1922
|
|
77
76
|
tinybird/tb_cli_modules/cicd.py,sha256=0lMkb6CVOFZl5HOwgY8mK4T4mgI7O8335UngLXtCc-c,13851
|
|
78
77
|
tinybird/tb_cli_modules/common.py,sha256=G08f1_x5YSB6n-ncRj4tB2jhtjAjlWN-QD4xMWbTNQU,83033
|
|
@@ -80,8 +79,8 @@ tinybird/tb_cli_modules/config.py,sha256=IsgdtFRnUrkY8-Zo32lmk6O7u3bHie1QCxLwgp4
|
|
|
80
79
|
tinybird/tb_cli_modules/exceptions.py,sha256=pmucP4kTF4irIt7dXiG-FcnI-o3mvDusPmch1L8RCWk,3367
|
|
81
80
|
tinybird/tb_cli_modules/regions.py,sha256=QjsL5H6Kg-qr0aYVLrvb1STeJ5Sx_sjvbOYO0LrEGMk,166
|
|
82
81
|
tinybird/tb_cli_modules/telemetry.py,sha256=Hh2Io8ZPROSunbOLuMvuIFU4TqwWPmQTqal4WS09K1A,10449
|
|
83
|
-
tinybird-0.0.1.
|
|
84
|
-
tinybird-0.0.1.
|
|
85
|
-
tinybird-0.0.1.
|
|
86
|
-
tinybird-0.0.1.
|
|
87
|
-
tinybird-0.0.1.
|
|
82
|
+
tinybird-0.0.1.dev119.dist-info/METADATA,sha256=ZAd9dK656El6TZCSUO-aTlsD0GzJf32p826lOLBxvIQ,1612
|
|
83
|
+
tinybird-0.0.1.dev119.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
|
84
|
+
tinybird-0.0.1.dev119.dist-info/entry_points.txt,sha256=LwdHU6TfKx4Qs7BqqtaczEZbImgU7Abe9Lp920zb_fo,43
|
|
85
|
+
tinybird-0.0.1.dev119.dist-info/top_level.txt,sha256=VqqqEmkAy7UNaD8-V51FCoMMWXjLUlR0IstvK7tJYVY,54
|
|
86
|
+
tinybird-0.0.1.dev119.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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|