tinybird 0.0.1.dev101__tar.gz → 0.0.1.dev103__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.
Potentially problematic release.
This version of tinybird might be problematic. Click here for more details.
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/PKG-INFO +2 -19
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird/feedback_manager.py +6 -0
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird/prompts.py +8 -11
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird/tb/__cli__.py +2 -2
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird/tb/modules/cicd.py +1 -1
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird/tb/modules/cli.py +0 -41
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird/tb/modules/common.py +51 -3
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird/tb/modules/create.py +2 -2
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird/tb/modules/datafile/common.py +2 -0
- tinybird-0.0.1.dev103/tinybird/tb/modules/infra.py +861 -0
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird/tb/modules/local.py +30 -0
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird/tb/modules/mock.py +23 -7
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird/tb/modules/shell.py +1 -1
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird/tb/modules/workspace.py +4 -25
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird/tb_cli_modules/connection.py +8 -2
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird.egg-info/PKG-INFO +2 -19
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird.egg-info/requires.txt +1 -19
- tinybird-0.0.1.dev101/tinybird/tb/modules/infra.py +0 -624
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/setup.cfg +0 -0
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird/__cli__.py +0 -0
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird/ch_utils/constants.py +0 -0
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird/ch_utils/engine.py +0 -0
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird/check_pypi.py +0 -0
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird/client.py +0 -0
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird/config.py +0 -0
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird/connectors.py +0 -0
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird/context.py +0 -0
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird/datafile.py +0 -0
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird/datatypes.py +0 -0
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird/git_settings.py +0 -0
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird/sql.py +0 -0
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird/sql_template.py +0 -0
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird/sql_template_fmt.py +0 -0
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird/sql_toolset.py +0 -0
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird/syncasync.py +0 -0
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird/tb/cli.py +0 -0
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird/tb/modules/auth.py +0 -0
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird/tb/modules/build.py +0 -0
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird/tb/modules/config.py +0 -0
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird/tb/modules/connection.py +0 -0
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird/tb/modules/copy.py +0 -0
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird/tb/modules/datafile/build.py +0 -0
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird/tb/modules/datafile/build_common.py +0 -0
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird/tb/modules/datafile/build_datasource.py +0 -0
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird/tb/modules/datafile/build_pipe.py +0 -0
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird/tb/modules/datafile/diff.py +0 -0
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird/tb/modules/datafile/exceptions.py +0 -0
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird/tb/modules/datafile/fixture.py +0 -0
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird/tb/modules/datafile/format_common.py +0 -0
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird/tb/modules/datafile/format_datasource.py +0 -0
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird/tb/modules/datafile/format_pipe.py +0 -0
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird/tb/modules/datafile/parse_datasource.py +0 -0
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird/tb/modules/datafile/parse_pipe.py +0 -0
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird/tb/modules/datafile/pipe_checker.py +0 -0
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird/tb/modules/datafile/playground.py +0 -0
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird/tb/modules/datafile/pull.py +0 -0
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird/tb/modules/datasource.py +0 -0
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird/tb/modules/deployment.py +0 -0
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird/tb/modules/endpoint.py +0 -0
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird/tb/modules/exceptions.py +0 -0
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird/tb/modules/feedback_manager.py +0 -0
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird/tb/modules/fmt.py +0 -0
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird/tb/modules/job.py +0 -0
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird/tb/modules/llm.py +0 -0
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird/tb/modules/llm_utils.py +0 -0
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird/tb/modules/local_common.py +0 -0
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird/tb/modules/login.py +0 -0
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird/tb/modules/logout.py +0 -0
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird/tb/modules/materialization.py +0 -0
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird/tb/modules/open.py +0 -0
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird/tb/modules/pipe.py +0 -0
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird/tb/modules/playground.py +0 -0
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird/tb/modules/project.py +0 -0
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird/tb/modules/regions.py +0 -0
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird/tb/modules/secret.py +0 -0
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird/tb/modules/table.py +0 -0
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird/tb/modules/tag.py +0 -0
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird/tb/modules/telemetry.py +0 -0
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird/tb/modules/test.py +0 -0
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird/tb/modules/tinyunit/tinyunit.py +0 -0
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird/tb/modules/tinyunit/tinyunit_lib.py +0 -0
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird/tb/modules/token.py +0 -0
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird/tb/modules/watch.py +0 -0
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird/tb/modules/workspace_members.py +0 -0
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird/tb_cli.py +0 -0
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird/tb_cli_modules/auth.py +0 -0
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird/tb_cli_modules/branch.py +0 -0
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird/tb_cli_modules/cicd.py +0 -0
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird/tb_cli_modules/cli.py +0 -0
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird/tb_cli_modules/common.py +0 -0
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird/tb_cli_modules/config.py +0 -0
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird/tb_cli_modules/datasource.py +0 -0
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird/tb_cli_modules/exceptions.py +0 -0
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird/tb_cli_modules/fmt.py +0 -0
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird/tb_cli_modules/job.py +0 -0
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird/tb_cli_modules/pipe.py +0 -0
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird/tb_cli_modules/regions.py +0 -0
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird/tb_cli_modules/tag.py +0 -0
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird/tb_cli_modules/telemetry.py +0 -0
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird/tb_cli_modules/test.py +0 -0
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird/tb_cli_modules/tinyunit/tinyunit.py +0 -0
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird/tb_cli_modules/tinyunit/tinyunit_lib.py +0 -0
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird/tb_cli_modules/workspace.py +0 -0
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird/tb_cli_modules/workspace_members.py +0 -0
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird/tornado_template.py +0 -0
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird.egg-info/SOURCES.txt +0 -0
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird.egg-info/dependency_links.txt +0 -0
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird.egg-info/entry_points.txt +0 -0
- {tinybird-0.0.1.dev101 → tinybird-0.0.1.dev103}/tinybird.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: tinybird
|
|
3
|
-
Version: 0.0.1.
|
|
3
|
+
Version: 0.0.1.dev103
|
|
4
4
|
Summary: Tinybird Command Line Tool
|
|
5
5
|
Home-page: https://www.tinybird.co/docs/cli/introduction.html
|
|
6
6
|
Author: Tinybird
|
|
@@ -9,6 +9,7 @@ Requires-Python: >=3.9, <3.14
|
|
|
9
9
|
Description-Content-Type: text/x-rst
|
|
10
10
|
Requires-Dist: aiofiles==24.1.0
|
|
11
11
|
Requires-Dist: anthropic==0.42.0
|
|
12
|
+
Requires-Dist: boto3
|
|
12
13
|
Requires-Dist: click<8.2,>=8.1.6
|
|
13
14
|
Requires-Dist: clickhouse-toolset==0.34.dev0
|
|
14
15
|
Requires-Dist: colorama==0.4.6
|
|
@@ -32,29 +33,11 @@ Requires-Dist: wheel
|
|
|
32
33
|
Requires-Dist: packaging<24,>=23.1
|
|
33
34
|
Requires-Dist: llm>=0.19
|
|
34
35
|
Requires-Dist: thefuzz==0.22.1
|
|
35
|
-
Provides-Extra: bigquery
|
|
36
|
-
Requires-Dist: gsutil==4.58; extra == "bigquery"
|
|
37
|
-
Requires-Dist: google-api-python-client==2.0.2; extra == "bigquery"
|
|
38
|
-
Requires-Dist: google-auth==1.27.1; extra == "bigquery"
|
|
39
|
-
Requires-Dist: google-auth-httplib2==0.1.0; extra == "bigquery"
|
|
40
|
-
Requires-Dist: google-cloud-storage==2.4.0; extra == "bigquery"
|
|
41
|
-
Requires-Dist: google-cloud-bigquery==2.11.0; extra == "bigquery"
|
|
42
|
-
Provides-Extra: snowflake
|
|
43
|
-
Requires-Dist: snowflake-connector-python~=3.12.3; extra == "snowflake"
|
|
44
|
-
Requires-Dist: gsutil==4.58; extra == "snowflake"
|
|
45
|
-
Requires-Dist: google-api-python-client==2.0.2; extra == "snowflake"
|
|
46
|
-
Requires-Dist: google-auth==1.27.1; extra == "snowflake"
|
|
47
|
-
Requires-Dist: google-auth-httplib2==0.1.0; extra == "snowflake"
|
|
48
|
-
Requires-Dist: google-cloud-storage==2.4.0; extra == "snowflake"
|
|
49
|
-
Requires-Dist: oauth2client==3.0.0; extra == "snowflake"
|
|
50
|
-
Requires-Dist: chardet<4,>=3.0.2; extra == "snowflake"
|
|
51
|
-
Requires-Dist: pyOpenSSL<20.0.0,>=16.2.0; extra == "snowflake"
|
|
52
36
|
Dynamic: author
|
|
53
37
|
Dynamic: author-email
|
|
54
38
|
Dynamic: description
|
|
55
39
|
Dynamic: description-content-type
|
|
56
40
|
Dynamic: home-page
|
|
57
|
-
Dynamic: provides-extra
|
|
58
41
|
Dynamic: requires-dist
|
|
59
42
|
Dynamic: requires-python
|
|
60
43
|
Dynamic: summary
|
|
@@ -651,6 +651,12 @@ Ready? """
|
|
|
651
651
|
warning_tag_remove = prompt_message(
|
|
652
652
|
"Tag {tag_name} is used by {resources_len} resources. Do you want to remove it?"
|
|
653
653
|
)
|
|
654
|
+
warning_bigquery_connector_deprecated = warning_message(
|
|
655
|
+
"🚨🚨🚨 [DEPRECATED] BigQuery connector is deprecated. Use ingestion from GCS instead. https://www.tinybird.co/docs/get-data-in/guides/ingest-from-bigquery-using-google-cloud-storage **"
|
|
656
|
+
)
|
|
657
|
+
warning_s3_access_key_secret_deprecated = warning_message(
|
|
658
|
+
"🚨🚨🚨 [DEPRECATED] S3 (Access Key + Secret) connector is deprecated. Use S3 IAM role instead. https://www.tinybird.co/docs/get-data-in/connectors/s3 **"
|
|
659
|
+
)
|
|
654
660
|
|
|
655
661
|
info_fixtures_branch = info_message("** Data Fixtures are only pushed to Branches")
|
|
656
662
|
info_materialize_push_datasource_exists = warning_message("** Data Source {name} already exists")
|
|
@@ -448,16 +448,13 @@ Use the following format to generate the response and do not wrap it in any othe
|
|
|
448
448
|
)
|
|
449
449
|
|
|
450
450
|
|
|
451
|
-
def mock_prompt(rows: int, feedback: str = ""
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
{feedback}
|
|
459
|
-
History of previous results:
|
|
460
|
-
{history}"""
|
|
451
|
+
def mock_prompt(rows: int, feedback: str = "") -> str:
|
|
452
|
+
if feedback:
|
|
453
|
+
feedback = f"""In case the <feedback> tag is present and not empty,
|
|
454
|
+
it means there was a previous attempt to generate the resources and the system provided feedback about the previous response.
|
|
455
|
+
Use the following feedback to regenerate the response:
|
|
456
|
+
<feedback>{feedback}</feedback>
|
|
457
|
+
"""
|
|
461
458
|
|
|
462
459
|
return f"""
|
|
463
460
|
Given the schema for a Tinybird datasource, return a can you create a clickhouse sql query to generate some random data that matches that schema.
|
|
@@ -600,7 +597,7 @@ Follow the instructions and generate the following response with no additional t
|
|
|
600
597
|
<sql>[raw sql query here]</sql>
|
|
601
598
|
</response>
|
|
602
599
|
|
|
603
|
-
{
|
|
600
|
+
{feedback}
|
|
604
601
|
|
|
605
602
|
"""
|
|
606
603
|
|
|
@@ -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.dev103'
|
|
8
|
+
__revision__ = 'e2e3b60'
|
|
@@ -55,7 +55,7 @@ jobs:
|
|
|
55
55
|
- name: Test project
|
|
56
56
|
run: tb test run
|
|
57
57
|
- name: Deployment check
|
|
58
|
-
run: tb --cloud --host ${{! TINYBIRD_HOST }} --token ${{! TINYBIRD_TOKEN }} deploy --check
|
|
58
|
+
run: tb --cloud --host ${{! env.TINYBIRD_HOST }} --token ${{! env.TINYBIRD_TOKEN }} deploy --check
|
|
59
59
|
"""
|
|
60
60
|
|
|
61
61
|
|
|
@@ -158,47 +158,6 @@ async def pull(ctx: Context, force: bool, fmt: bool) -> None:
|
|
|
158
158
|
return await folder_pull(client, project.path, force, fmt=fmt)
|
|
159
159
|
|
|
160
160
|
|
|
161
|
-
@cli.command(hidden=True)
|
|
162
|
-
@click.option("--no-deps", is_flag=True, default=False, help="Print only data sources with no pipes using them")
|
|
163
|
-
@click.option("--match", default=None, help="Retrieve any resource matching the pattern")
|
|
164
|
-
@click.option("--pipe", default=None, help="Retrieve any resource used by pipe")
|
|
165
|
-
@click.option("--datasource", default=None, help="Retrieve resources depending on this data source")
|
|
166
|
-
@click.option(
|
|
167
|
-
"--check-for-partial-replace",
|
|
168
|
-
is_flag=True,
|
|
169
|
-
default=False,
|
|
170
|
-
help="Retrieve dependant data sources that will have their data replaced if a partial replace is executed in the data source selected",
|
|
171
|
-
)
|
|
172
|
-
@click.option("--recursive", is_flag=True, default=False, help="Calculate recursive dependencies")
|
|
173
|
-
@click.pass_context
|
|
174
|
-
@coro
|
|
175
|
-
async def dependencies(
|
|
176
|
-
ctx: Context,
|
|
177
|
-
no_deps: bool,
|
|
178
|
-
match: Optional[str],
|
|
179
|
-
pipe: Optional[str],
|
|
180
|
-
datasource: Optional[str],
|
|
181
|
-
check_for_partial_replace: bool,
|
|
182
|
-
recursive: bool,
|
|
183
|
-
) -> None:
|
|
184
|
-
"""Print all data sources dependencies."""
|
|
185
|
-
|
|
186
|
-
client = ctx.ensure_object(dict)["client"]
|
|
187
|
-
|
|
188
|
-
response = await client.datasource_dependencies(
|
|
189
|
-
no_deps, match, pipe, datasource, check_for_partial_replace, recursive
|
|
190
|
-
)
|
|
191
|
-
for ds in response["dependencies"]:
|
|
192
|
-
click.echo(FeedbackManager.info_dependency_list(dependency=ds))
|
|
193
|
-
for pipe in response["dependencies"][ds]:
|
|
194
|
-
click.echo(FeedbackManager.info_dependency_list_item(dependency=pipe))
|
|
195
|
-
if "incompatible_datasources" in response and len(response["incompatible_datasources"]):
|
|
196
|
-
click.echo(FeedbackManager.info_no_compatible_dependencies_found())
|
|
197
|
-
for ds in response["incompatible_datasources"]:
|
|
198
|
-
click.echo(FeedbackManager.info_dependency_list(dependency=ds))
|
|
199
|
-
raise CLIException(FeedbackManager.error_partial_replace_cant_be_executed(datasource=datasource))
|
|
200
|
-
|
|
201
|
-
|
|
202
161
|
@cli.command(
|
|
203
162
|
name="diff",
|
|
204
163
|
short_help="Diff local datafiles to the corresponding remote files in the workspace. Only diffs VERSION and SCHEMA for .datasource files.",
|
|
@@ -1984,12 +1984,12 @@ async def send_batch_events(
|
|
|
1984
1984
|
click.echo(FeedbackManager.highlight(message=f"» {rows} rows x {cols} cols in {elapsed_time:.1f}s"))
|
|
1985
1985
|
|
|
1986
1986
|
|
|
1987
|
-
async def get_organizations_by_user(config: CLIConfig, user_token: str) -> List[Dict[str,
|
|
1987
|
+
async def get_organizations_by_user(config: CLIConfig, user_token: Optional[str] = None) -> List[Dict[str, str]]:
|
|
1988
1988
|
"""Fetches all organizations by user using the provided user token"""
|
|
1989
1989
|
organizations = []
|
|
1990
1990
|
|
|
1991
1991
|
try:
|
|
1992
|
-
user_client = config.get_client(token=user_token)
|
|
1992
|
+
user_client = config.get_client(token=user_token) if user_token else config.get_user_client()
|
|
1993
1993
|
user_workspaces = await user_client.user_workspaces_with_organization(version="v1")
|
|
1994
1994
|
admin_org_id = user_workspaces.get("organization_id")
|
|
1995
1995
|
seen_org_ids = set()
|
|
@@ -2089,7 +2089,7 @@ async def ask_for_organization_name(config: CLIConfig) -> str:
|
|
|
2089
2089
|
user_email.split("@")[0] if user_email else None
|
|
2090
2090
|
) # Example: "jane.doe@gmail.com" -> "jane.doe"
|
|
2091
2091
|
return click.prompt(
|
|
2092
|
-
"\nYou need to create an organization to continue
|
|
2092
|
+
"\nYou need to create an organization to continue.\nEnter organization name",
|
|
2093
2093
|
hide_input=False,
|
|
2094
2094
|
show_default=True,
|
|
2095
2095
|
default=default_organization_name,
|
|
@@ -2166,3 +2166,51 @@ def get_ui_url(api_host: str) -> str:
|
|
|
2166
2166
|
return f"https://cloud.tinybird.co/{cloud}/{region}"
|
|
2167
2167
|
|
|
2168
2168
|
return api_host
|
|
2169
|
+
|
|
2170
|
+
|
|
2171
|
+
async def ask_for_organization(
|
|
2172
|
+
organizations: Optional[List[Dict[str, Any]]],
|
|
2173
|
+
organization_id: Optional[str] = None,
|
|
2174
|
+
user_token: Optional[str] = None,
|
|
2175
|
+
) -> Tuple[Optional[str], Optional[str]]:
|
|
2176
|
+
config = CLIConfig.get_project_config()
|
|
2177
|
+
user_email = config.get_user_email()
|
|
2178
|
+
|
|
2179
|
+
if organization_id:
|
|
2180
|
+
if organizations and len(organizations) > 0:
|
|
2181
|
+
organization = next(
|
|
2182
|
+
(org for org in organizations if org.get("id") == organization_id), None
|
|
2183
|
+
)
|
|
2184
|
+
if not organization:
|
|
2185
|
+
raise CLIException(
|
|
2186
|
+
FeedbackManager.error_organization_not_found(
|
|
2187
|
+
organization_id=organization_id
|
|
2188
|
+
)
|
|
2189
|
+
)
|
|
2190
|
+
organization_name = organization.get("name")
|
|
2191
|
+
return organization_id, organization_name
|
|
2192
|
+
|
|
2193
|
+
if organizations is None or len(organizations) == 0:
|
|
2194
|
+
organization_name = await ask_for_organization_name(config)
|
|
2195
|
+
user_token = await get_user_token(config, user_token)
|
|
2196
|
+
organization = await create_organization_and_add_workspaces(
|
|
2197
|
+
config, organization_name, user_token
|
|
2198
|
+
)
|
|
2199
|
+
organization_id = organization.get("id")
|
|
2200
|
+
else:
|
|
2201
|
+
if len(organizations) == 1:
|
|
2202
|
+
organization_name = organizations[0]["name"]
|
|
2203
|
+
organization_id = organizations[0]["id"]
|
|
2204
|
+
else:
|
|
2205
|
+
sorted_organizations = sort_organizations_by_user(
|
|
2206
|
+
organizations, user_email=user_email
|
|
2207
|
+
)
|
|
2208
|
+
current_organization = await ask_for_organization_interactively(
|
|
2209
|
+
sorted_organizations
|
|
2210
|
+
)
|
|
2211
|
+
if current_organization:
|
|
2212
|
+
organization_id = current_organization.get("id")
|
|
2213
|
+
organization_name = current_organization.get("name")
|
|
2214
|
+
else:
|
|
2215
|
+
return None, None
|
|
2216
|
+
return organization_id, organization_name
|
|
@@ -299,9 +299,9 @@ def init_git(folder: str):
|
|
|
299
299
|
if gitignore_file.exists():
|
|
300
300
|
content = gitignore_file.read_text()
|
|
301
301
|
if ".tinyb" not in content:
|
|
302
|
-
gitignore_file.write_text(content + "\n.tinyb\n")
|
|
302
|
+
gitignore_file.write_text(content + "\n.tinyb\n.terraform\n")
|
|
303
303
|
else:
|
|
304
|
-
gitignore_file.write_text(".tinyb\n")
|
|
304
|
+
gitignore_file.write_text(".tinyb\n.terraform\n")
|
|
305
305
|
|
|
306
306
|
click.echo(FeedbackManager.info_file_created(file=".gitignore"))
|
|
307
307
|
except Exception as e:
|
|
@@ -1464,6 +1464,8 @@ def parse(
|
|
|
1464
1464
|
"kafka_security_protocol": assign_var("kafka_security_protocol"),
|
|
1465
1465
|
"kafka_sasl_mechanism": assign_var("kafka_sasl_mechanism"),
|
|
1466
1466
|
"import_service": assign_var("import_service"),
|
|
1467
|
+
"s3_region": assign_var("s3_region"),
|
|
1468
|
+
"s3_arn": assign_var("s3_arn"),
|
|
1467
1469
|
"import_connection_name": assign_var("import_connection_name"),
|
|
1468
1470
|
"import_schedule": assign_var("import_schedule"),
|
|
1469
1471
|
"import_strategy": assign_var("import_strategy"),
|