tinybird 0.0.1.dev291__py3-none-any.whl → 1.0.5__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.
- tinybird/ch_utils/constants.py +5 -0
- tinybird/connectors.py +1 -7
- tinybird/context.py +3 -3
- tinybird/datafile/common.py +10 -8
- tinybird/datafile/parse_pipe.py +2 -2
- tinybird/feedback_manager.py +3 -0
- tinybird/prompts.py +1 -0
- tinybird/service_datasources.py +223 -0
- tinybird/sql_template.py +26 -11
- tinybird/sql_template_fmt.py +14 -4
- tinybird/tb/__cli__.py +2 -2
- tinybird/tb/cli.py +1 -0
- tinybird/tb/client.py +104 -26
- tinybird/tb/config.py +24 -0
- tinybird/tb/modules/agent/agent.py +103 -67
- tinybird/tb/modules/agent/banner.py +15 -15
- tinybird/tb/modules/agent/explore_agent.py +5 -0
- tinybird/tb/modules/agent/mock_agent.py +5 -1
- tinybird/tb/modules/agent/models.py +6 -2
- tinybird/tb/modules/agent/prompts.py +49 -2
- tinybird/tb/modules/agent/tools/deploy.py +1 -1
- tinybird/tb/modules/agent/tools/execute_query.py +15 -18
- tinybird/tb/modules/agent/tools/request_endpoint.py +1 -1
- tinybird/tb/modules/agent/tools/run_command.py +9 -0
- tinybird/tb/modules/agent/utils.py +38 -48
- tinybird/tb/modules/branch.py +150 -0
- tinybird/tb/modules/build.py +58 -13
- tinybird/tb/modules/build_common.py +209 -25
- tinybird/tb/modules/cli.py +129 -16
- tinybird/tb/modules/common.py +172 -146
- tinybird/tb/modules/connection.py +125 -194
- tinybird/tb/modules/connection_kafka.py +382 -0
- tinybird/tb/modules/copy.py +3 -1
- tinybird/tb/modules/create.py +83 -150
- tinybird/tb/modules/datafile/build.py +27 -38
- tinybird/tb/modules/datafile/build_datasource.py +21 -25
- tinybird/tb/modules/datafile/diff.py +1 -1
- tinybird/tb/modules/datafile/format_pipe.py +46 -7
- tinybird/tb/modules/datafile/playground.py +59 -68
- tinybird/tb/modules/datafile/pull.py +2 -3
- tinybird/tb/modules/datasource.py +477 -308
- tinybird/tb/modules/deployment.py +2 -0
- tinybird/tb/modules/deployment_common.py +84 -44
- tinybird/tb/modules/deprecations.py +4 -4
- tinybird/tb/modules/dev_server.py +33 -12
- tinybird/tb/modules/exceptions.py +14 -0
- tinybird/tb/modules/feedback_manager.py +1 -1
- tinybird/tb/modules/info.py +69 -12
- tinybird/tb/modules/infra.py +4 -5
- tinybird/tb/modules/job_common.py +15 -0
- tinybird/tb/modules/local.py +143 -23
- tinybird/tb/modules/local_common.py +347 -19
- tinybird/tb/modules/local_logs.py +209 -0
- tinybird/tb/modules/login.py +21 -2
- tinybird/tb/modules/login_common.py +254 -12
- tinybird/tb/modules/mock.py +5 -54
- tinybird/tb/modules/mock_common.py +0 -54
- tinybird/tb/modules/open.py +10 -5
- tinybird/tb/modules/project.py +14 -5
- tinybird/tb/modules/shell.py +15 -7
- tinybird/tb/modules/sink.py +3 -1
- tinybird/tb/modules/telemetry.py +11 -3
- tinybird/tb/modules/test.py +13 -9
- tinybird/tb/modules/test_common.py +13 -87
- tinybird/tb/modules/tinyunit/tinyunit.py +0 -14
- tinybird/tb/modules/tinyunit/tinyunit_lib.py +0 -6
- tinybird/tb/modules/watch.py +5 -3
- tinybird/tb_cli_modules/common.py +2 -2
- tinybird/tb_cli_modules/telemetry.py +1 -1
- tinybird/tornado_template.py +6 -7
- {tinybird-0.0.1.dev291.dist-info → tinybird-1.0.5.dist-info}/METADATA +32 -6
- tinybird-1.0.5.dist-info/RECORD +132 -0
- {tinybird-0.0.1.dev291.dist-info → tinybird-1.0.5.dist-info}/WHEEL +1 -1
- tinybird-0.0.1.dev291.dist-info/RECORD +0 -128
- {tinybird-0.0.1.dev291.dist-info → tinybird-1.0.5.dist-info}/entry_points.txt +0 -0
- {tinybird-0.0.1.dev291.dist-info → tinybird-1.0.5.dist-info}/top_level.txt +0 -0
|
@@ -214,41 +214,34 @@ def folder_playground(
|
|
|
214
214
|
error=e,
|
|
215
215
|
)
|
|
216
216
|
raise click.ClickException(exception)
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
name=name if to_run[name]["version"] is None else f"{name}__v{to_run[name]['version']}"
|
|
222
|
-
)
|
|
217
|
+
elif raise_on_exists:
|
|
218
|
+
raise AlreadyExistsException(
|
|
219
|
+
FeedbackManager.warning_name_already_exists(
|
|
220
|
+
name=name if to_run[name]["version"] is None else f"{name}__v{to_run[name]['version']}"
|
|
223
221
|
)
|
|
222
|
+
)
|
|
223
|
+
elif name_matches_existing_resource(resource, name, tb_client):
|
|
224
|
+
if resource == "pipes":
|
|
225
|
+
click.echo(FeedbackManager.error_pipe_cannot_be_pushed(name=name))
|
|
224
226
|
else:
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
name=(
|
|
234
|
-
name
|
|
235
|
-
if to_run[name]["version"] is None
|
|
236
|
-
else f"{name}__v{to_run[name]['version']}"
|
|
237
|
-
)
|
|
238
|
-
)
|
|
239
|
-
)
|
|
240
|
-
else:
|
|
227
|
+
click.echo(FeedbackManager.error_datasource_cannot_be_pushed(name=name))
|
|
228
|
+
else:
|
|
229
|
+
click.echo(
|
|
230
|
+
FeedbackManager.warning_name_already_exists(
|
|
231
|
+
name=(name if to_run[name]["version"] is None else f"{name}__v{to_run[name]['version']}")
|
|
232
|
+
)
|
|
233
|
+
)
|
|
234
|
+
if dry_run:
|
|
241
235
|
if should_push_file(name, remote_resource_names, force, run_tests):
|
|
242
236
|
extension = "pipe" if resource == "pipes" else "datasource"
|
|
243
237
|
click.echo(FeedbackManager.info_building_resource(name=f"{name}.{extension}", version=""))
|
|
244
|
-
|
|
245
|
-
if
|
|
246
|
-
|
|
247
|
-
click.echo(FeedbackManager.warning_pipe_cannot_be_pushed(name=name))
|
|
248
|
-
else:
|
|
249
|
-
click.echo(FeedbackManager.warning_datasource_cannot_be_pushed(name=name))
|
|
238
|
+
elif name_matches_existing_resource(resource, name, tb_client):
|
|
239
|
+
if resource == "pipes":
|
|
240
|
+
click.echo(FeedbackManager.warning_pipe_cannot_be_pushed(name=name))
|
|
250
241
|
else:
|
|
251
|
-
click.echo(FeedbackManager.
|
|
242
|
+
click.echo(FeedbackManager.warning_datasource_cannot_be_pushed(name=name))
|
|
243
|
+
else:
|
|
244
|
+
click.echo(FeedbackManager.warning_dry_name_already_exists(name=name))
|
|
252
245
|
|
|
253
246
|
def push_files(
|
|
254
247
|
dependency_graph: GraphDependencies,
|
|
@@ -793,44 +786,45 @@ def get_processed(
|
|
|
793
786
|
dir_path=dir_path,
|
|
794
787
|
embedded_datasources=embedded_ds,
|
|
795
788
|
)
|
|
796
|
-
|
|
797
|
-
if verbose:
|
|
798
|
-
click.echo(FeedbackManager.info_processing_file(filename=filename))
|
|
789
|
+
continue
|
|
799
790
|
|
|
800
|
-
|
|
801
|
-
|
|
791
|
+
if verbose:
|
|
792
|
+
click.echo(FeedbackManager.info_processing_file(filename=filename))
|
|
802
793
|
|
|
803
|
-
|
|
804
|
-
|
|
794
|
+
if ".incl" in filename:
|
|
795
|
+
click.echo(FeedbackManager.warning_skipping_include_file(file=filename))
|
|
805
796
|
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
tb_client=tb_client,
|
|
809
|
-
deps=deps_list,
|
|
810
|
-
dep_map=dep_map_dict,
|
|
811
|
-
to_run=to_run_dict,
|
|
812
|
-
vendor_paths=vendor_paths,
|
|
813
|
-
skip_connectors=skip_connectors,
|
|
814
|
-
current_ws=current_ws,
|
|
815
|
-
changed=changed,
|
|
816
|
-
fork_downstream=fork_downstream,
|
|
817
|
-
is_internal=is_internal,
|
|
818
|
-
dir_path=dir_path,
|
|
819
|
-
verbose=verbose,
|
|
820
|
-
embedded_datasources=embedded_ds,
|
|
821
|
-
)
|
|
822
|
-
processed_set.add(name)
|
|
797
|
+
if tb_client is None:
|
|
798
|
+
raise ValueError("tb_client cannot be None")
|
|
823
799
|
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
800
|
+
name, warnings = process(
|
|
801
|
+
filename=filename,
|
|
802
|
+
tb_client=tb_client,
|
|
803
|
+
deps=deps_list,
|
|
804
|
+
dep_map=dep_map_dict,
|
|
805
|
+
to_run=to_run_dict,
|
|
806
|
+
vendor_paths=vendor_paths,
|
|
807
|
+
skip_connectors=skip_connectors,
|
|
808
|
+
current_ws=current_ws,
|
|
809
|
+
changed=changed,
|
|
810
|
+
fork_downstream=fork_downstream,
|
|
811
|
+
is_internal=is_internal,
|
|
812
|
+
dir_path=dir_path,
|
|
813
|
+
verbose=verbose,
|
|
814
|
+
embedded_datasources=embedded_ds,
|
|
815
|
+
)
|
|
816
|
+
processed_set.add(name)
|
|
817
|
+
|
|
818
|
+
if verbose:
|
|
819
|
+
if len(warnings) == 1:
|
|
820
|
+
click.echo(FeedbackManager.warning_pipe_restricted_param(word=warnings[0]))
|
|
821
|
+
elif len(warnings) > 1:
|
|
822
|
+
click.echo(
|
|
823
|
+
FeedbackManager.warning_pipe_restricted_params(
|
|
824
|
+
words=", ".join(["'{}'".format(param) for param in warnings[:-1]]),
|
|
825
|
+
last_word=warnings[-1],
|
|
833
826
|
)
|
|
827
|
+
)
|
|
834
828
|
|
|
835
829
|
|
|
836
830
|
def build_graph(
|
|
@@ -1082,11 +1076,8 @@ def process_file(
|
|
|
1082
1076
|
raise click.ClickException(FeedbackManager.error_missing_table_arn(datasource=datasource["name"]))
|
|
1083
1077
|
if not params.get("import_export_bucket", None):
|
|
1084
1078
|
raise click.ClickException(FeedbackManager.error_missing_export_bucket(datasource=datasource["name"]))
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
raise click.ClickException(
|
|
1088
|
-
FeedbackManager.error_missing_external_datasource(datasource=datasource["name"])
|
|
1089
|
-
)
|
|
1079
|
+
elif not params.get("import_external_datasource", None):
|
|
1080
|
+
raise click.ClickException(FeedbackManager.error_missing_external_datasource(datasource=datasource["name"]))
|
|
1090
1081
|
|
|
1091
1082
|
return params
|
|
1092
1083
|
|
|
@@ -1209,7 +1200,7 @@ def process_file(
|
|
|
1209
1200
|
#
|
|
1210
1201
|
# Note: any unknown import_ parameter is leaved as is.
|
|
1211
1202
|
for key in ImportReplacements.get_datafile_parameter_keys():
|
|
1212
|
-
replacement, default_value = ImportReplacements.get_api_param_for_datafile_param(
|
|
1203
|
+
replacement, default_value = ImportReplacements.get_api_param_for_datafile_param(key)
|
|
1213
1204
|
if not replacement:
|
|
1214
1205
|
continue # We should not reach this never, but just in case...
|
|
1215
1206
|
|
|
@@ -74,9 +74,8 @@ def folder_pull(
|
|
|
74
74
|
if resource_to_write:
|
|
75
75
|
fd.write(resource_to_write)
|
|
76
76
|
return f
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
click.echo(FeedbackManager.info_skip_already_exists())
|
|
77
|
+
elif verbose:
|
|
78
|
+
click.echo(FeedbackManager.info_skip_already_exists())
|
|
80
79
|
return None
|
|
81
80
|
except Exception as e:
|
|
82
81
|
raise click.ClickException(FeedbackManager.error_exception(error=e))
|