tinybird 0.0.1.dev1__py3-none-any.whl → 0.0.1.dev2__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/__cli__.py +2 -2
- tinybird/client.py +8 -5
- tinybird/config.py +1 -1
- tinybird/datafile.py +540 -6
- tinybird/feedback_manager.py +6 -0
- tinybird/tb_cli.py +2 -0
- tinybird/tb_cli_modules/build.py +221 -0
- tinybird/tb_cli_modules/cli.py +67 -0
- tinybird/tb_cli_modules/common.py +2 -3
- tinybird/tb_cli_modules/create.py +226 -0
- tinybird/tb_cli_modules/datasource.py +10 -2
- tinybird/tb_cli_modules/prompts.py +133 -0
- {tinybird-0.0.1.dev1.dist-info → tinybird-0.0.1.dev2.dist-info}/METADATA +4 -1
- {tinybird-0.0.1.dev1.dist-info → tinybird-0.0.1.dev2.dist-info}/RECORD +17 -14
- {tinybird-0.0.1.dev1.dist-info → tinybird-0.0.1.dev2.dist-info}/WHEEL +0 -0
- {tinybird-0.0.1.dev1.dist-info → tinybird-0.0.1.dev2.dist-info}/entry_points.txt +0 -0
- {tinybird-0.0.1.dev1.dist-info → tinybird-0.0.1.dev2.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
create_project_prompt = """
|
|
2
|
+
You are a Tinybird expert. You will be given a prompt describing a data project and you will generate all the associated datasources and pipes.
|
|
3
|
+
<datasource>
|
|
4
|
+
name: The name of the datasource.
|
|
5
|
+
content: The content of the datasource datafile in the following format:
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
DESCRIPTION >
|
|
9
|
+
Some meaningful description of the datasource
|
|
10
|
+
|
|
11
|
+
SCHEMA >
|
|
12
|
+
`<column_name_1>` <clickhouse_tinybird_compatible_data_type> `json:$.<column_name_1>`,
|
|
13
|
+
`<column_name_2>` <clickhouse_tinybird_compatible_data_type> `json:$.<column_name_2>`,
|
|
14
|
+
...
|
|
15
|
+
`<column_name_n>` <clickhouse_tinybird_compatible_data_type> `json:$.<column_name_n>`
|
|
16
|
+
|
|
17
|
+
ENGINE "MergeTree"
|
|
18
|
+
ENGINE_PARTITION_KEY "<partition_key>"
|
|
19
|
+
ENGINE_SORTING_KEY "<sorting_key_1, sorting_key_2, ...>"
|
|
20
|
+
```
|
|
21
|
+
</datasource>
|
|
22
|
+
<pipe>
|
|
23
|
+
name: The name of the pipe.
|
|
24
|
+
content: The content of the pipe datafile in the following format:
|
|
25
|
+
```
|
|
26
|
+
DESCRIPTION >
|
|
27
|
+
Some meaningful description of the pipe
|
|
28
|
+
|
|
29
|
+
NODE node_1
|
|
30
|
+
SQL >
|
|
31
|
+
<sql_query_using_clickhouse_syntax_and_tinybird_templating_syntax>
|
|
32
|
+
|
|
33
|
+
...
|
|
34
|
+
|
|
35
|
+
NODE node_n
|
|
36
|
+
SQL >
|
|
37
|
+
<sql_query_using_clickhouse_syntax_and_tinybird_templating_syntax>
|
|
38
|
+
```
|
|
39
|
+
</pipe>
|
|
40
|
+
<instructions>
|
|
41
|
+
- The datasource name must be unique.
|
|
42
|
+
- The pipe name must be unique.
|
|
43
|
+
- The datasource will be the landing table for the data.
|
|
44
|
+
- Create multiple pipes to show different use cases over the same datasource.
|
|
45
|
+
- The SQL query must be a valid ClickHouse SQL query that mixes ClickHouse syntax and Tinybird templating syntax.
|
|
46
|
+
- If you need to use dynamic parameters you must start the whole sql query ALWAYS with "%" symbol on top. e.g: SQL >\n %\n SELECT * FROM <table> WHERE <condition> LIMIT 10
|
|
47
|
+
- The Parameter functions like this one {{String(<my_param_name>,<default_value>)}} can be one of the following: String, DateTime, Date, Float32, Float64, Int, Integer, UInt8, UInt16, UInt32, UInt64, UInt128, UInt256, Int8, Int16, Int32, Int64, Int128, Int256
|
|
48
|
+
- Parameter names must be different from column names. Pass always the param name and a default value to the function.
|
|
49
|
+
- Nodes can't have the same exact name as the Pipe they belong to.
|
|
50
|
+
</instructions>
|
|
51
|
+
"""
|
|
52
|
+
|
|
53
|
+
sample_data_prompt = """Your role is to generate sample data for a given data source. A data source is a table in Tinybird. You will be given a schema for the data source, and you will need to generate a set of rows that fit that schema.
|
|
54
|
+
|
|
55
|
+
The schema will be provided to you at the end of this prompt in the following format:
|
|
56
|
+
|
|
57
|
+
```
|
|
58
|
+
SCHEMA >
|
|
59
|
+
`span_id` String `json:$.span_id`,
|
|
60
|
+
`operation_id` String `json:$.operation_name`,
|
|
61
|
+
`duration` Nullable(Float32) `json:$.duration`,
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
In the example above, `span_id` are column names, String and Float32 are column types, and `json:$.duration` is a JSON path expression that points to the duration value in the JSON data. Use this information to generate valid data.
|
|
65
|
+
|
|
66
|
+
You will generate {row_count} rows of data in JSON format, newlines separated. Your reponse will only contain the {row_count} rows of data, without any other text. Do not format the data in any way, and do not place it inside any markers for a code block of any kind. Most importantly, do not use backticks on the first or last line or anywhere else in the response. This is extremely important, ensure that your response doesn't include any backticks.
|
|
67
|
+
|
|
68
|
+
Remember that for a JSON to be valid, there can't be a trailing comma after the last value in an object.
|
|
69
|
+
|
|
70
|
+
Make sure to include all columns in the schema, and use valid JSON. You may leave some columns empty only if the column type allows it (e.g. Nullable(String)). Use realistic values for the data, and make sure to include a variety of values in each column.
|
|
71
|
+
|
|
72
|
+
For columns that represent timestamps, use values that are close to the current date and time. The current date and time is {current_datetime}"""
|
|
73
|
+
|
|
74
|
+
sample_data_with_errors_prompt = """Your role is to generate incorrect sample data for a given data source. A data source is a table in Tinybird. You will be given a schema for the data source, and you will need to generate a set of rows that mostly fit that schema, but with some errors.
|
|
75
|
+
|
|
76
|
+
The schema will be provided to you at the end of this prompt in the following format:
|
|
77
|
+
|
|
78
|
+
```
|
|
79
|
+
SCHEMA >
|
|
80
|
+
`span_id` String `json:$.span_id`,
|
|
81
|
+
`operation_id` String `json:$.operation_name`,
|
|
82
|
+
`duration` Nullable(Float32) `json:$.duration`,
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
In the example above, `span_id` are column names, String and Float32 are column types, and `json:$.duration` is a JSON path expression that points to the duration value in the JSON data. Use this information to generate valid data.
|
|
86
|
+
|
|
87
|
+
You will generate {row_count} rows of data in JSON format, newlines separated. Your reponse will be a single string containing all {row_count} rows, without any other text. Make sure to include all columns in the schema, and use valid JSON. Use realistic values for the data, and make sure to include a variety of values in each column. In every set of {row_count} rows, there should be at least one row that has an error. The error could be in any column, and it could be a type error (e.g. a string where a number is expected), or it could be an error in the structure of the JSON (e.g. a value in the wrong place in the document).
|
|
88
|
+
|
|
89
|
+
For columns that represent timestamps, use values that are close to the current date and time. The current date and time is {current_datetime}"""
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
sample_data_sql_prompt = """
|
|
93
|
+
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.
|
|
94
|
+
|
|
95
|
+
Response format MUST be just a valid clickhouse sql query.
|
|
96
|
+
|
|
97
|
+
# Example input:
|
|
98
|
+
|
|
99
|
+
SCHEMA >
|
|
100
|
+
experience_gained Int16 `json:$.experience_gained`,
|
|
101
|
+
level Int16 `json:$.level`,
|
|
102
|
+
monster_kills Int16 `json:$.monster_kills`,
|
|
103
|
+
player_id String `json:$.player_id`,
|
|
104
|
+
pvp_kills Int16 `json:$.pvp_kills`,
|
|
105
|
+
quest_completions Int16 `json:$.quest_completions`,
|
|
106
|
+
timestamp DateTime `json:$.timestamp`
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
# Example output:
|
|
110
|
+
|
|
111
|
+
SELECT
|
|
112
|
+
rand() % 1000 AS experience_gained, -- Random experience gained between 0 and 999
|
|
113
|
+
1 + rand() % 100 AS level, -- Random level between 1 and 100
|
|
114
|
+
rand() % 500 AS monster_kills, -- Random monster kills between 0 and 499
|
|
115
|
+
concat('player_', toString(rand() % 10000)) AS player_id, -- Random player IDs like "player_1234"
|
|
116
|
+
rand() % 50 AS pvp_kills, -- Random PvP kills between 0 and 49
|
|
117
|
+
rand() % 200 AS quest_completions, -- Random quest completions between 0 and 199
|
|
118
|
+
now() - rand() % 86400 AS timestamp -- Random timestamp within the last day
|
|
119
|
+
FROM numbers({row_count})
|
|
120
|
+
|
|
121
|
+
# Instructions:
|
|
122
|
+
|
|
123
|
+
- The query MUST return a random sample of data that matches the schema.
|
|
124
|
+
- The query MUST return a valid clickhouse sql query.
|
|
125
|
+
- The query MUST return a sample of {row_count} rows.
|
|
126
|
+
- The query MUST be valid for clickhouse and Tinybird.
|
|
127
|
+
- Return JUST the sql query, without any other text or symbols.
|
|
128
|
+
- Do NOT include ```clickhouse or ```sql or any other wrapping text.
|
|
129
|
+
- Do NOT use any of these functions: elementAt
|
|
130
|
+
- Do NOT add a semicolon at the end of the query
|
|
131
|
+
- Do NOT add any FORMAT at the end of the query, because it will be added later by Tinybird.
|
|
132
|
+
|
|
133
|
+
"""
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: tinybird
|
|
3
|
-
Version: 0.0.1.
|
|
3
|
+
Version: 0.0.1.dev2
|
|
4
4
|
Summary: Tinybird Command Line Tool
|
|
5
5
|
Home-page: https://www.tinybird.co/docs/cli/introduction.html
|
|
6
6
|
Author: Tinybird
|
|
@@ -13,6 +13,7 @@ Requires-Dist: clickhouse-toolset (==0.33.dev0)
|
|
|
13
13
|
Requires-Dist: colorama (==0.4.6)
|
|
14
14
|
Requires-Dist: cryptography (~=41.0.0)
|
|
15
15
|
Requires-Dist: croniter (==1.3.8)
|
|
16
|
+
Requires-Dist: docker (==7.1.0)
|
|
16
17
|
Requires-Dist: GitPython (~=3.1.32)
|
|
17
18
|
Requires-Dist: humanfriendly (~=8.2)
|
|
18
19
|
Requires-Dist: pydantic (~=2.8.0)
|
|
@@ -24,8 +25,10 @@ Requires-Dist: shandy-sqlfmt[jinjafmt] (==0.11.1)
|
|
|
24
25
|
Requires-Dist: toposort (==1.10)
|
|
25
26
|
Requires-Dist: tornado (~=6.0.0)
|
|
26
27
|
Requires-Dist: urllib3 (<2,>=1.26.14)
|
|
28
|
+
Requires-Dist: watchdog (==6.0.0)
|
|
27
29
|
Requires-Dist: wheel
|
|
28
30
|
Requires-Dist: packaging (<24,>=23.1)
|
|
31
|
+
Requires-Dist: llm (>=0.19)
|
|
29
32
|
Provides-Extra: bigquery
|
|
30
33
|
Requires-Dist: gsutil (==4.58) ; extra == 'bigquery'
|
|
31
34
|
Requires-Dist: google-api-python-client (==2.0.2) ; extra == 'bigquery'
|
|
@@ -1,34 +1,37 @@
|
|
|
1
|
-
tinybird/__cli__.py,sha256=
|
|
1
|
+
tinybird/__cli__.py,sha256=PHs2gdn0u2epRONYAzC2TOYLhI2SR6FPDDS5NDrS0TY,250
|
|
2
2
|
tinybird/check_pypi.py,sha256=_4NkharLyR_ELrAdit-ftqIWvOf7jZNPt3i76frlo9g,975
|
|
3
|
-
tinybird/client.py,sha256=
|
|
4
|
-
tinybird/config.py,sha256=
|
|
3
|
+
tinybird/client.py,sha256=nd97gD2-8Ap8yDonBcVwk9eXDAL43hmIYdo-Pse43RE,50738
|
|
4
|
+
tinybird/config.py,sha256=Z-BX9FrjgsLw1YwcCdF0IztLB97Zpc70VVPplO_pDSY,6089
|
|
5
5
|
tinybird/connectors.py,sha256=lkpVSUmSuViEZBa4QjTK7YmPHUop0a5UFoTrSmlVq6k,15244
|
|
6
6
|
tinybird/context.py,sha256=kutUQ0kCwparowI74_YLXx6wtTzGLRouJ6oGHVBPzBo,1291
|
|
7
|
-
tinybird/datafile.py,sha256=
|
|
7
|
+
tinybird/datafile.py,sha256=JpZX33Ilq71PiuDBs4TNF1xJoUMtTPLynIbHuo7Bn80,253510
|
|
8
8
|
tinybird/datatypes.py,sha256=IHyhZ86ib54Vnd1pbod9y2aS8DDvDKZm1HJGlThdbuQ,10460
|
|
9
|
-
tinybird/feedback_manager.py,sha256=
|
|
9
|
+
tinybird/feedback_manager.py,sha256=FT5wJ06gYPGofVgpR-XdZBxUlV9oV94rLx-vzh9ArB8,67724
|
|
10
10
|
tinybird/git_settings.py,sha256=XUL9ZUj59-ZVQJDYmMEq4UpnuuOuQOHGlNcX3JgQHjQ,3954
|
|
11
11
|
tinybird/sql.py,sha256=gfRKjdqEygcE1WOTeQ1QV2Jal8Jzl4RSX8fftu1KSEs,45825
|
|
12
12
|
tinybird/sql_template.py,sha256=IqYRfUxDYBCoOYjqqvn--_8QXLv9FSRnJ0bInx7q1Xs,93051
|
|
13
13
|
tinybird/sql_template_fmt.py,sha256=1z-PuqSZXtzso8Z_mPqUc-NxIxUrNUcVIPezNieZk-M,10196
|
|
14
14
|
tinybird/sql_toolset.py,sha256=xS_yD5N_TZT5d4uPcXdeIYX4GQPz7-7wHywMGdfgqcM,13794
|
|
15
15
|
tinybird/syncasync.py,sha256=fAvq0qkRgqXqXMKwbY2iJNYqLT_r6mDsh1MRpGKrdRU,27763
|
|
16
|
-
tinybird/tb_cli.py,sha256=
|
|
16
|
+
tinybird/tb_cli.py,sha256=cTPJfd_wOWPCwwFz_LoMREV3YSa8pltU_y-ITP13IpY,819
|
|
17
17
|
tinybird/tornado_template.py,sha256=o2HguxrL1Evnt8o3IvrsI8Zm6JtRQ3zhLJKf1XyR3SQ,41965
|
|
18
18
|
tinybird/ch_utils/constants.py,sha256=aYvg2C_WxYWsnqPdZB1ZFoIr8ZY-XjUXYyHKE9Ansj0,3890
|
|
19
19
|
tinybird/ch_utils/engine.py,sha256=OXkBhlzGjZotjD0vaT-rFIbSGV4tpiHxE8qO_ip0SyQ,40454
|
|
20
20
|
tinybird/tb_cli_modules/auth.py,sha256=cqxfGgFheuTmenQ3UwPBXTqwMm8JD7uzgLfoIRXdnyQ,9038
|
|
21
21
|
tinybird/tb_cli_modules/branch.py,sha256=Ik8rRVPXvhyChHBqdPVNtI_C-0gLYjUHaznNWE04Ecw,39120
|
|
22
|
+
tinybird/tb_cli_modules/build.py,sha256=pF6Ts2k0qCwCi1ktrGyJo1NcdWsU9O3okDdb3SiFdZo,7615
|
|
22
23
|
tinybird/tb_cli_modules/cicd.py,sha256=0lMkb6CVOFZl5HOwgY8mK4T4mgI7O8335UngLXtCc-c,13851
|
|
23
|
-
tinybird/tb_cli_modules/cli.py,sha256=
|
|
24
|
-
tinybird/tb_cli_modules/common.py,sha256=
|
|
24
|
+
tinybird/tb_cli_modules/cli.py,sha256=a738xz4DUNep_mzHTEUExd0NAuf7cHkUAlMsEus9xaM,65072
|
|
25
|
+
tinybird/tb_cli_modules/common.py,sha256=pS7kisPe4vChirSY2og5e0Cu-RNDow7X3Qdk1BEHL78,78571
|
|
25
26
|
tinybird/tb_cli_modules/config.py,sha256=6NTgIdwf0X132A1j6G_YrdPep87ymZ9b5pABabKLzh4,11484
|
|
26
27
|
tinybird/tb_cli_modules/connection.py,sha256=YggP34Qh3hCjD41lp1ZHVCwHPjI_-um2spvEV8F_tSU,28684
|
|
27
|
-
tinybird/tb_cli_modules/
|
|
28
|
+
tinybird/tb_cli_modules/create.py,sha256=wcr-GIgCz_t135UIDFt_gNxUQ0huI3oXGM5bIuC665E,7808
|
|
29
|
+
tinybird/tb_cli_modules/datasource.py,sha256=BVYwPkKvdnEv2YMkxof7n7FOffyJm-QK7Pk9Ui-MC3A,35816
|
|
28
30
|
tinybird/tb_cli_modules/exceptions.py,sha256=pmucP4kTF4irIt7dXiG-FcnI-o3mvDusPmch1L8RCWk,3367
|
|
29
31
|
tinybird/tb_cli_modules/fmt.py,sha256=_xL2AyGo3us7NpmfAXtSIhn1cGAC-A4PspdhUjm58jY,3382
|
|
30
32
|
tinybird/tb_cli_modules/job.py,sha256=AG69LPb9MbobA1awwJFZJvxqarDKfRlsBjw2V1zvYqc,2964
|
|
31
33
|
tinybird/tb_cli_modules/pipe.py,sha256=BCLAQ3ZuWKGAih2mupnw_Y2S5B5cNS-epF317whsSEE,30989
|
|
34
|
+
tinybird/tb_cli_modules/prompts.py,sha256=Esjhet-KUM1bT6RStk2voCCVjvAOUD4hDDiKpn-AYNY,7227
|
|
32
35
|
tinybird/tb_cli_modules/regions.py,sha256=QjsL5H6Kg-qr0aYVLrvb1STeJ5Sx_sjvbOYO0LrEGMk,166
|
|
33
36
|
tinybird/tb_cli_modules/tag.py,sha256=9YHnruPnUNp1IJUe4qcSEMg9EbquIRo--Nxcsbvkvq8,3488
|
|
34
37
|
tinybird/tb_cli_modules/telemetry.py,sha256=iEGnMuCuNhvF6ln__j6X9MSTwL_0Hm-GgFHHHvhfknk,10466
|
|
@@ -38,8 +41,8 @@ tinybird/tb_cli_modules/workspace.py,sha256=N8f1dl4BYc34ucmJ6oNZc4XZMGKd8m0Fhq7o
|
|
|
38
41
|
tinybird/tb_cli_modules/workspace_members.py,sha256=ksXsjd233y9-sNlz4Qb-meZbX4zn1B84e_bSm2i8rhg,8731
|
|
39
42
|
tinybird/tb_cli_modules/tinyunit/tinyunit.py,sha256=_ydOD4WxmKy7_h-d3fG62w_0_lD0uLl9w4EbEYtwd0U,11720
|
|
40
43
|
tinybird/tb_cli_modules/tinyunit/tinyunit_lib.py,sha256=hGh1ZaXC1af7rKnX7222urkj0QJMhMWclqMy59dOqwE,1922
|
|
41
|
-
tinybird-0.0.1.
|
|
42
|
-
tinybird-0.0.1.
|
|
43
|
-
tinybird-0.0.1.
|
|
44
|
-
tinybird-0.0.1.
|
|
45
|
-
tinybird-0.0.1.
|
|
44
|
+
tinybird-0.0.1.dev2.dist-info/METADATA,sha256=C0w-b-Ur4VfPVJya8uxCZvv2cBxlgaDePZnV2m2-Y9k,2404
|
|
45
|
+
tinybird-0.0.1.dev2.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
|
|
46
|
+
tinybird-0.0.1.dev2.dist-info/entry_points.txt,sha256=PKPKuPmA4IfJYnCFHHUiw-aAWZuBomFvwCklv1OyCjE,43
|
|
47
|
+
tinybird-0.0.1.dev2.dist-info/top_level.txt,sha256=pgw6AzERHBcW3YTi2PW4arjxLkulk2msOz_SomfOEuc,45
|
|
48
|
+
tinybird-0.0.1.dev2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|