tinybird 3.5.2__tar.gz → 3.5.2.dev0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/PKG-INFO +1 -1
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/config.py +1 -1
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/__cli__.py +2 -2
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/config.py +1 -1
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/modules/agent/tools/analyze.py +1 -1
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/modules/common.py +1 -1
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/modules/create.py +1 -1
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/modules/deployment_common.py +124 -48
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird.egg-info/PKG-INFO +1 -1
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/setup.cfg +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/__cli__.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/ch_utils/constants.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/ch_utils/engine.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/check_pypi.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/client.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/context.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/datafile/common.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/datafile/exceptions.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/datafile/parse_connection.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/datafile/parse_datasource.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/datafile/parse_pipe.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/datatypes.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/feedback_manager.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/git_settings.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/prompts.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/service_datasources.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/sql.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/sql_template.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/sql_template_fmt.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/sql_toolset.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/syncasync.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/check_pypi.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/cli.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/client.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/modules/agent/__init__.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/modules/agent/agent.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/modules/agent/animations.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/modules/agent/banner.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/modules/agent/command_agent.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/modules/agent/compactor.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/modules/agent/explore_agent.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/modules/agent/file_agent.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/modules/agent/memory.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/modules/agent/mock_agent.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/modules/agent/models.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/modules/agent/prompts.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/modules/agent/testing_agent.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/modules/agent/tools/__init__.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/modules/agent/tools/append.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/modules/agent/tools/build.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/modules/agent/tools/datafile.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/modules/agent/tools/deploy.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/modules/agent/tools/deploy_check.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/modules/agent/tools/diff_resource.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/modules/agent/tools/execute_query.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/modules/agent/tools/file.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/modules/agent/tools/get_endpoint_stats.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/modules/agent/tools/get_openapi_definition.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/modules/agent/tools/mock.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/modules/agent/tools/plan.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/modules/agent/tools/request_endpoint.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/modules/agent/tools/run_command.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/modules/agent/tools/secret.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/modules/agent/tools/test.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/modules/agent/utils.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/modules/branch.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/modules/build.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/modules/build_common.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/modules/cicd.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/modules/cli.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/modules/config.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/modules/connection.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/modules/connection_kafka.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/modules/connection_s3.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/modules/copy.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/modules/datafile/build.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/modules/datafile/build_common.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/modules/datafile/build_datasource.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/modules/datafile/build_pipe.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/modules/datafile/diff.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/modules/datafile/fixture.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/modules/datafile/format_common.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/modules/datafile/format_connection.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/modules/datafile/format_datasource.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/modules/datafile/format_pipe.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/modules/datafile/pipe_checker.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/modules/datafile/playground.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/modules/datafile/pull.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/modules/datasource.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/modules/deployment.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/modules/deprecations.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/modules/dev_server.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/modules/endpoint.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/modules/exceptions.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/modules/feedback_manager.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/modules/fmt.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/modules/info.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/modules/infra.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/modules/job.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/modules/job_common.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/modules/llm.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/modules/llm_utils.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/modules/local.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/modules/local_common.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/modules/local_logs.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/modules/login.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/modules/login_common.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/modules/logout.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/modules/materialization.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/modules/mock.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/modules/mock_common.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/modules/open.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/modules/pipe.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/modules/project.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/modules/project_commands.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/modules/regions.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/modules/secret.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/modules/secret_common.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/modules/shell.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/modules/sink.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/modules/table.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/modules/telemetry.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/modules/test.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/modules/test_common.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/modules/tinyunit/tinyunit.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/modules/tinyunit/tinyunit_lib.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/modules/token.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/modules/watch.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/modules/workspace.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/modules/workspace_members.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb_cli.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb_cli_modules/auth.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb_cli_modules/branch.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb_cli_modules/cicd.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb_cli_modules/cli.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb_cli_modules/common.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb_cli_modules/config.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb_cli_modules/connection.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb_cli_modules/datasource.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb_cli_modules/exceptions.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb_cli_modules/fmt.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb_cli_modules/job.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb_cli_modules/pipe.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb_cli_modules/regions.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb_cli_modules/tag.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb_cli_modules/telemetry.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb_cli_modules/test.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb_cli_modules/tinyunit/tinyunit.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb_cli_modules/tinyunit/tinyunit_lib.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb_cli_modules/workspace.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb_cli_modules/workspace_members.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tornado_template.py +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird.egg-info/SOURCES.txt +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird.egg-info/dependency_links.txt +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird.egg-info/entry_points.txt +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird.egg-info/requires.txt +0 -0
- {tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird.egg-info/top_level.txt +0 -0
|
@@ -124,7 +124,7 @@ def get_display_host(ui_host: str):
|
|
|
124
124
|
def get_display_cloud_host(api_host: str) -> str:
|
|
125
125
|
is_local = "localhost" in api_host
|
|
126
126
|
if is_local:
|
|
127
|
-
port = api_host.
|
|
127
|
+
port = api_host.split(":")[-1]
|
|
128
128
|
return f"http://cloud.tinybird.co/local/{port}"
|
|
129
129
|
return CLOUD_HOSTS.get(api_host, api_host)
|
|
130
130
|
|
|
@@ -4,5 +4,5 @@ __description__ = 'Tinybird Command Line Tool'
|
|
|
4
4
|
__url__ = 'https://www.tinybird.co/docs/forward/commands'
|
|
5
5
|
__author__ = 'Tinybird'
|
|
6
6
|
__author_email__ = 'support@tinybird.co'
|
|
7
|
-
__version__ = '3.5.2'
|
|
8
|
-
__revision__ = '
|
|
7
|
+
__version__ = '3.5.2.dev0'
|
|
8
|
+
__revision__ = '296fce5'
|
|
@@ -96,7 +96,7 @@ def write_config(config: Dict[str, Any], dest_file: str = ".tinyb") -> None:
|
|
|
96
96
|
def get_display_cloud_host(api_host: str) -> str:
|
|
97
97
|
is_local = "localhost" in api_host
|
|
98
98
|
if is_local:
|
|
99
|
-
port = api_host.
|
|
99
|
+
port = api_host.split(":")[-1]
|
|
100
100
|
return f"http://cloud.tinybird.co/local/{port}"
|
|
101
101
|
return CLOUD_HOSTS.get(api_host, api_host)
|
|
102
102
|
|
|
@@ -74,7 +74,7 @@ def analyze_url(ctx: RunContext[TinybirdAgentContext], fixture_url: str):
|
|
|
74
74
|
ctx.deps.thinking_animation.start()
|
|
75
75
|
return f"{fixture_url} is not a valid url. Please check the url and try again."
|
|
76
76
|
|
|
77
|
-
fixture_extension = fixture_url.
|
|
77
|
+
fixture_extension = fixture_url.split(".")[-1]
|
|
78
78
|
|
|
79
79
|
response = ctx.deps.analyze_fixture(fixture_path=fixture_url, format=fixture_extension)
|
|
80
80
|
click.echo(FeedbackManager.success(message="✓ Done!\n"))
|
|
@@ -2308,7 +2308,7 @@ def sys_exit(event: str, msg: str) -> None:
|
|
|
2308
2308
|
|
|
2309
2309
|
def get_error_event(error: str) -> Tuple[str, str]:
|
|
2310
2310
|
try:
|
|
2311
|
-
error_event = error.split(event_error_separator
|
|
2311
|
+
error_event = error.split(event_error_separator)[0]
|
|
2312
2312
|
silent_error_msg = error.split(event_error_separator)[1]
|
|
2313
2313
|
except Exception:
|
|
2314
2314
|
error_event = "error"
|
|
@@ -500,7 +500,7 @@ def create_resources_from_url(
|
|
|
500
500
|
) -> List[Path]:
|
|
501
501
|
result: List[Path] = []
|
|
502
502
|
local_client = get_tinybird_local_client(config)
|
|
503
|
-
format = url.
|
|
503
|
+
format = url.split(".")[-1]
|
|
504
504
|
ds_file = _generate_datafile(url, local_client, format=format, force=True, folder=project.folder)
|
|
505
505
|
result.append(ds_file)
|
|
506
506
|
name = ds_file.stem
|
|
@@ -87,6 +87,63 @@ def api_post(
|
|
|
87
87
|
return {}
|
|
88
88
|
|
|
89
89
|
|
|
90
|
+
def _is_first_deployment_with_seed_live(host: Optional[str], headers: dict) -> bool:
|
|
91
|
+
"""Best-effort check for first real deployment when seed deployment (id=0) is still live."""
|
|
92
|
+
try:
|
|
93
|
+
response = requests.get(f"{host}/v1/deployments", headers=headers)
|
|
94
|
+
if response.status_code >= 300:
|
|
95
|
+
return False
|
|
96
|
+
|
|
97
|
+
result = response.json()
|
|
98
|
+
logging.debug(json.dumps(result, indent=2))
|
|
99
|
+
deployments = result.get("deployments") or []
|
|
100
|
+
if not deployments:
|
|
101
|
+
return False
|
|
102
|
+
|
|
103
|
+
live_deployment = next((deployment for deployment in deployments if deployment.get("live")), deployments[0])
|
|
104
|
+
return str(live_deployment.get("id")) == "0"
|
|
105
|
+
except Exception:
|
|
106
|
+
# Hint calculation must never break deployment flow.
|
|
107
|
+
return False
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
def _get_deployment_job(client: TinyB, deployment_id: Optional[Union[str, int]]) -> Optional[Dict[str, Any]]:
|
|
111
|
+
if deployment_id is None:
|
|
112
|
+
return None
|
|
113
|
+
|
|
114
|
+
try:
|
|
115
|
+
deployment_id = str(deployment_id)
|
|
116
|
+
jobs = client.jobs()
|
|
117
|
+
return next(
|
|
118
|
+
(job for job in jobs if job.get("kind") == "deployment" and str(job.get("deployment_id")) == deployment_id),
|
|
119
|
+
None,
|
|
120
|
+
)
|
|
121
|
+
except Exception:
|
|
122
|
+
return None
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
def _cancel_deployment_job(client: TinyB, deployment_job: Optional[Dict[str, Any]]) -> None:
|
|
126
|
+
if not deployment_job:
|
|
127
|
+
return
|
|
128
|
+
|
|
129
|
+
job_id = str(deployment_job.get("id") or deployment_job.get("job_id") or "")
|
|
130
|
+
if not job_id:
|
|
131
|
+
return
|
|
132
|
+
|
|
133
|
+
try:
|
|
134
|
+
result = client.job_cancel(job_id)
|
|
135
|
+
except Exception:
|
|
136
|
+
return
|
|
137
|
+
|
|
138
|
+
current_job_status = result.get("status")
|
|
139
|
+
if current_job_status == "cancelling":
|
|
140
|
+
click.echo(FeedbackManager.success_job_cancellation_cancelling(job_id=job_id))
|
|
141
|
+
elif current_job_status == "cancelled":
|
|
142
|
+
click.echo(FeedbackManager.success_job_cancellation_cancelled(job_id=job_id))
|
|
143
|
+
else:
|
|
144
|
+
click.echo(FeedbackManager.error_job_cancelled_but_status_unknown(job_id=job_id))
|
|
145
|
+
|
|
146
|
+
|
|
90
147
|
# TODO(eclbg): This logic should be in the server, and there should be a dedicated endpoint for promoting a deployment
|
|
91
148
|
# potato
|
|
92
149
|
def promote_deployment(host: Optional[str], headers: dict, wait: bool, ingest_hint: Optional[bool] = True) -> None:
|
|
@@ -272,12 +329,15 @@ def create_deployment(
|
|
|
272
329
|
)
|
|
273
330
|
|
|
274
331
|
deployment = None
|
|
332
|
+
deployment_job: Optional[Dict[str, Any]] = None
|
|
275
333
|
try:
|
|
276
334
|
HEADERS = {"Authorization": f"Bearer {TINYBIRD_API_KEY}"}
|
|
277
335
|
params = {}
|
|
278
336
|
if check:
|
|
279
337
|
click.echo(FeedbackManager.highlight(message="\n» Validating deployment...\n"))
|
|
280
338
|
params["check"] = "true"
|
|
339
|
+
elif auto:
|
|
340
|
+
params["auto_promote"] = "true"
|
|
281
341
|
if allow_destructive_operations:
|
|
282
342
|
params["allow_destructive_operations"] = "true"
|
|
283
343
|
|
|
@@ -338,15 +398,7 @@ def create_deployment(
|
|
|
338
398
|
FeedbackManager.gray(message="Deployment URL: ")
|
|
339
399
|
+ f"{bcolors.UNDERLINE}{host}/{config.get('name')}/deployments/{deployment.get('id')}{bcolors.ENDC}"
|
|
340
400
|
)
|
|
341
|
-
|
|
342
|
-
deployment_job = next(
|
|
343
|
-
(
|
|
344
|
-
job
|
|
345
|
-
for job in jobs
|
|
346
|
-
if job.get("kind") == "deployment" and job.get("deployment_id") == deployment.get("id")
|
|
347
|
-
),
|
|
348
|
-
None,
|
|
349
|
-
)
|
|
401
|
+
deployment_job = _get_deployment_job(client, deployment.get("id"))
|
|
350
402
|
if deployment_job:
|
|
351
403
|
echo_job_url(
|
|
352
404
|
token=client.token,
|
|
@@ -379,52 +431,76 @@ def create_deployment(
|
|
|
379
431
|
|
|
380
432
|
if deployment and wait and not check:
|
|
381
433
|
click.echo(FeedbackManager.highlight(message="» Waiting for deployment to be ready..."))
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
feedback = deployment.get("feedback")
|
|
394
|
-
|
|
395
|
-
if status == "failed":
|
|
396
|
-
# Just wait until we poll again and see deleting or deleted to report errors
|
|
397
|
-
pass
|
|
398
|
-
|
|
399
|
-
if status == "data_ready":
|
|
400
|
-
break
|
|
434
|
+
waiting_auto_promote = False
|
|
435
|
+
is_first_deployment = str(deployment.get("id")) == "1"
|
|
436
|
+
try:
|
|
437
|
+
while True:
|
|
438
|
+
url = f"{client.host}/v1/deployments/{deployment.get('id')}"
|
|
439
|
+
res = api_fetch(url, HEADERS)
|
|
440
|
+
deployment = res.get("deployment")
|
|
441
|
+
if not deployment:
|
|
442
|
+
click.echo(FeedbackManager.error(message="Error parsing deployment from response"))
|
|
443
|
+
sys_exit("deployment_error", "Error parsing deployment from response")
|
|
444
|
+
return
|
|
401
445
|
|
|
402
|
-
|
|
446
|
+
status = deployment.get("status")
|
|
403
447
|
errors = deployment.get("errors")
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
448
|
+
feedback = deployment.get("feedback")
|
|
449
|
+
|
|
450
|
+
if status == "failed":
|
|
451
|
+
# Just wait until we poll again and see deleting or deleted to report errors
|
|
452
|
+
pass
|
|
453
|
+
|
|
454
|
+
if status == "data_ready":
|
|
455
|
+
if auto and not deployment.get("live"):
|
|
456
|
+
if not waiting_auto_promote:
|
|
457
|
+
click.echo(FeedbackManager.info(message="✓ Deployment is ready"))
|
|
458
|
+
click.echo(FeedbackManager.highlight(message="» Waiting for deployment to be promoted..."))
|
|
459
|
+
if not is_first_deployment:
|
|
460
|
+
is_first_deployment = _is_first_deployment_with_seed_live(client.host, HEADERS)
|
|
461
|
+
waiting_auto_promote = True
|
|
462
|
+
time.sleep(5)
|
|
463
|
+
continue
|
|
464
|
+
break
|
|
465
|
+
|
|
466
|
+
if status in ["deleting", "deleted"]:
|
|
467
|
+
errors = deployment.get("errors")
|
|
468
|
+
if errors:
|
|
469
|
+
verb = "is being" if status == "deleting" else "was"
|
|
470
|
+
click.echo(
|
|
471
|
+
FeedbackManager.error(
|
|
472
|
+
message=f"Deployment failed and {verb} deleted automatically. Deployment errors:"
|
|
473
|
+
)
|
|
409
474
|
)
|
|
475
|
+
for error in errors:
|
|
476
|
+
click.echo(FeedbackManager.error(message=f"* {error}"))
|
|
477
|
+
sys_exit(
|
|
478
|
+
"deployment_error",
|
|
479
|
+
f"Deployment deleted after failure. Errors: {str(errors + (feedback or []))}",
|
|
410
480
|
)
|
|
411
|
-
for error in errors:
|
|
412
|
-
click.echo(FeedbackManager.error(message=f"* {error}"))
|
|
413
|
-
sys_exit(
|
|
414
|
-
"deployment_error", f"Deployment deleted after failure. Errors: {str(errors + (feedback or []))}"
|
|
415
|
-
)
|
|
416
|
-
|
|
417
|
-
time.sleep(5)
|
|
418
481
|
|
|
419
|
-
|
|
482
|
+
time.sleep(5)
|
|
483
|
+
except KeyboardInterrupt:
|
|
484
|
+
if auto:
|
|
485
|
+
if not deployment_job:
|
|
486
|
+
deployment_job = _get_deployment_job(client, deployment.get("id") if deployment else None)
|
|
487
|
+
_cancel_deployment_job(client, deployment_job)
|
|
488
|
+
raise click.Abort()
|
|
420
489
|
|
|
421
490
|
if auto:
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
491
|
+
if not waiting_auto_promote:
|
|
492
|
+
click.echo(FeedbackManager.info(message="✓ Deployment is ready"))
|
|
493
|
+
click.echo(FeedbackManager.highlight(message="» Waiting for deployment to be promoted..."))
|
|
494
|
+
click.echo(FeedbackManager.info(message="✓ Deployment promoted"))
|
|
495
|
+
click.echo(FeedbackManager.success(message=f"✓ Deployment #{deployment.get('id')} is live!"))
|
|
496
|
+
if ingest_hint and len(deployment.get("new_data_connector_ids", [])) == 0 and is_first_deployment:
|
|
497
|
+
click.echo(
|
|
498
|
+
FeedbackManager.info(
|
|
499
|
+
message="Need help ingesting your data? Learn how at https://www.tinybird.co/docs/forward/get-data-in"
|
|
500
|
+
)
|
|
501
|
+
)
|
|
502
|
+
else:
|
|
503
|
+
click.echo(FeedbackManager.info(message="✓ Deployment is ready"))
|
|
428
504
|
|
|
429
505
|
# Output JSON at the appropriate time based on the execution path
|
|
430
506
|
if output == "json" and deployment:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/modules/agent/tools/get_endpoint_stats.py
RENAMED
|
File without changes
|
{tinybird-3.5.2 → tinybird-3.5.2.dev0}/tinybird/tb/modules/agent/tools/get_openapi_definition.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|