tinybird 0.0.1.dev222__py3-none-any.whl → 0.0.1.dev224__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/ch_utils/constants.py +1 -0
- tinybird/prompts.py +55 -1
- tinybird/tb/__cli__.py +2 -2
- tinybird/tb/modules/create.py +12 -1
- tinybird/tb/modules/token.py +9 -17
- {tinybird-0.0.1.dev222.dist-info → tinybird-0.0.1.dev224.dist-info}/METADATA +1 -1
- {tinybird-0.0.1.dev222.dist-info → tinybird-0.0.1.dev224.dist-info}/RECORD +10 -10
- {tinybird-0.0.1.dev222.dist-info → tinybird-0.0.1.dev224.dist-info}/WHEEL +0 -0
- {tinybird-0.0.1.dev222.dist-info → tinybird-0.0.1.dev224.dist-info}/entry_points.txt +0 -0
- {tinybird-0.0.1.dev222.dist-info → tinybird-0.0.1.dev224.dist-info}/top_level.txt +0 -0
tinybird/ch_utils/constants.py
CHANGED
tinybird/prompts.py
CHANGED
|
@@ -420,9 +420,11 @@ You are a Tinybird expert. You will be given a prompt to generate new or update
|
|
|
420
420
|
{pipe_example}
|
|
421
421
|
{copy_pipe_instructions}
|
|
422
422
|
{materialized_pipe_instructions}
|
|
423
|
+
{sink_pipe_instructions}
|
|
423
424
|
{connection_instructions}
|
|
424
425
|
{kafka_connection_example}
|
|
425
426
|
{gcs_connection_example}
|
|
427
|
+
{gcs_hmac_connection_example}
|
|
426
428
|
{s3_connection_example}
|
|
427
429
|
|
|
428
430
|
{feedback_history}
|
|
@@ -445,9 +447,11 @@ Use the following format to generate the response and do not wrap it in any othe
|
|
|
445
447
|
pipe_example=pipe_example,
|
|
446
448
|
copy_pipe_instructions=copy_pipe_instructions,
|
|
447
449
|
materialized_pipe_instructions=materialized_pipe_instructions,
|
|
450
|
+
sink_pipe_instructions=sink_pipe_instructions,
|
|
448
451
|
connection_instructions=connection_instructions,
|
|
449
452
|
kafka_connection_example=kafka_connection_example,
|
|
450
453
|
gcs_connection_example=gcs_connection_example,
|
|
454
|
+
gcs_hmac_connection_example=gcs_hmac_connection_example,
|
|
451
455
|
s3_connection_example=s3_connection_example,
|
|
452
456
|
feedback_history=feedback_history,
|
|
453
457
|
)
|
|
@@ -639,6 +643,43 @@ COPY_SCHEDULE 0 * * * *
|
|
|
639
643
|
</copy_pipe_instructions>
|
|
640
644
|
"""
|
|
641
645
|
|
|
646
|
+
sink_pipe_instructions = """
|
|
647
|
+
<sink_pipe_instructions>
|
|
648
|
+
- Do not create sink pipes by default, unless the user asks for it.
|
|
649
|
+
- Sink pipes should be created in the /sinks folder.
|
|
650
|
+
- In a .pipe file you can define how to export the result of a Pipe to an external system, optionally with a schedule.
|
|
651
|
+
- Valid external systems are Kafka, S3, GCS.
|
|
652
|
+
- Sink pipes depend on a connection, if no connection is provided, search for an existing connection that suits the request. If none, create a new connection.
|
|
653
|
+
- Do not include EXPORT_SCHEDULE in the .pipe file unless is specifically requested by the user.
|
|
654
|
+
- EXPORT_SCHEDULE is a cron expression that defines the schedule of the sink pipe.
|
|
655
|
+
- EXPORT_SCHEDULE is optional and if not provided, the sink pipe will be executed only once.
|
|
656
|
+
- EXPORT_CONNECTION_NAME is the name of the connection used to export.
|
|
657
|
+
- TYPE SINK is the type of the pipe and it is mandatory for sink pipes.
|
|
658
|
+
- If the sink pipe uses parameters, you must include the % character and a newline on top of every query to be able to use the parameters.
|
|
659
|
+
- The content of the .pipe file must follow this format:
|
|
660
|
+
DESCRIPTION Sink Pipe to export sales hour every hour using my_connection
|
|
661
|
+
|
|
662
|
+
NODE daily_sales
|
|
663
|
+
SQL >
|
|
664
|
+
%
|
|
665
|
+
SELECT toStartOfDay(starting_date) day, country, sum(sales) as total_sales
|
|
666
|
+
FROM teams
|
|
667
|
+
WHERE
|
|
668
|
+
day BETWEEN toStartOfDay(now()) - interval 1 day AND toStartOfDay(now())
|
|
669
|
+
and country = {{ String(country, 'US')}}
|
|
670
|
+
GROUP BY day, country
|
|
671
|
+
|
|
672
|
+
TYPE sink
|
|
673
|
+
EXPORT_CONNECTION_NAME "my_connection"
|
|
674
|
+
EXPORT_BUCKET_URI "s3://tinybird-sinks"
|
|
675
|
+
EXPORT_FILE_TEMPLATE "daily_prices"
|
|
676
|
+
EXPORT_SCHEDULE "*/5 * * * *"
|
|
677
|
+
EXPORT_FORMAT "csv"
|
|
678
|
+
EXPORT_COMPRESSION "gz"
|
|
679
|
+
EXPORT_WRITE_STRATEGY "truncate"
|
|
680
|
+
</sink_pipe_instructions>
|
|
681
|
+
"""
|
|
682
|
+
|
|
642
683
|
materialized_pipe_instructions = """
|
|
643
684
|
<materialized_pipe_instructions>
|
|
644
685
|
- Do not create materialized pipes by default, unless the user asks for it.
|
|
@@ -709,6 +750,14 @@ GCS_SERVICE_ACCOUNT_CREDENTIALS_JSON {{ tb_secret("PRODUCTION_GCS_SERVICE_ACCOUN
|
|
|
709
750
|
</gcs_connection_content>
|
|
710
751
|
"""
|
|
711
752
|
|
|
753
|
+
gcs_hmac_connection_example = """
|
|
754
|
+
<gcs_hmac_connection_content>
|
|
755
|
+
TYPE gcs
|
|
756
|
+
GCS_HMAC_ACCESS_ID {{ tb_secret("gcs_hmac_access_id") }}
|
|
757
|
+
GCS_HMAC_SECRET {{ tb_secret("gcs_hmac_secret") }}
|
|
758
|
+
</gcs_hmac_connection_content>
|
|
759
|
+
"""
|
|
760
|
+
|
|
712
761
|
s3_connection_example = """
|
|
713
762
|
<s3_connection_content>
|
|
714
763
|
TYPE s3
|
|
@@ -767,7 +816,7 @@ pipe_instructions = """
|
|
|
767
816
|
- Nodes can't have the same exact name as the Pipe they belong to.
|
|
768
817
|
- Avoid more than one node per pipe unless it is really necessary or requested by the user.
|
|
769
818
|
- No indentation is allowed for property names: DESCRIPTION, NODE, SQL, TYPE, etc.
|
|
770
|
-
- Allowed TYPE values are: endpoint, copy, materialized.
|
|
819
|
+
- Allowed TYPE values are: endpoint, copy, materialized, sink.
|
|
771
820
|
- Add always the output node in the TYPE section or in the last node of the pipe.
|
|
772
821
|
</pipe_file_instructions>
|
|
773
822
|
"""
|
|
@@ -858,6 +907,7 @@ When you need to work with resources or data in cloud, add always the --cloud fl
|
|
|
858
907
|
- When asking to create a tinybird data project, if the needed folders are not already created, use the following structure:
|
|
859
908
|
├── connections
|
|
860
909
|
├── copies
|
|
910
|
+
├── sinks
|
|
861
911
|
├── datasources
|
|
862
912
|
├── endpoints
|
|
863
913
|
├── fixtures
|
|
@@ -890,9 +940,11 @@ Follow these instructions when creating or updating .pipe files:
|
|
|
890
940
|
{pipe_example}
|
|
891
941
|
{copy_pipe_instructions}
|
|
892
942
|
{materialized_pipe_instructions}
|
|
943
|
+
{sink_pipe_instructions}
|
|
893
944
|
{connection_instructions}
|
|
894
945
|
{kafka_connection_example}
|
|
895
946
|
{gcs_connection_example}
|
|
947
|
+
{gcs_hmac_connection_example}
|
|
896
948
|
{s3_connection_example}
|
|
897
949
|
</pipe_file_instructions>
|
|
898
950
|
<test_file_instructions>
|
|
@@ -912,11 +964,13 @@ Follow these instructions when evolving a datasource schema:
|
|
|
912
964
|
pipe_example=pipe_example,
|
|
913
965
|
copy_pipe_instructions=copy_pipe_instructions,
|
|
914
966
|
materialized_pipe_instructions=materialized_pipe_instructions,
|
|
967
|
+
sink_pipe_instructions=sink_pipe_instructions,
|
|
915
968
|
test_instructions=test_instructions,
|
|
916
969
|
deployment_instructions=deployment_instructions,
|
|
917
970
|
connection_instructions=connection_instructions,
|
|
918
971
|
kafka_connection_example=kafka_connection_example,
|
|
919
972
|
gcs_connection_example=gcs_connection_example,
|
|
973
|
+
gcs_hmac_connection_example=gcs_hmac_connection_example,
|
|
920
974
|
s3_connection_example=s3_connection_example,
|
|
921
975
|
)
|
|
922
976
|
|
tinybird/tb/__cli__.py
CHANGED
|
@@ -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__ = '0.0.1.
|
|
8
|
-
__revision__ = '
|
|
7
|
+
__version__ = '0.0.1.dev224'
|
|
8
|
+
__revision__ = 'c632cc3'
|
tinybird/tb/modules/create.py
CHANGED
|
@@ -197,7 +197,17 @@ async def create(
|
|
|
197
197
|
raise CLICreateException(FeedbackManager.error(message=str(e)))
|
|
198
198
|
|
|
199
199
|
|
|
200
|
-
PROJECT_PATHS = (
|
|
200
|
+
PROJECT_PATHS = (
|
|
201
|
+
"datasources",
|
|
202
|
+
"endpoints",
|
|
203
|
+
"materializations",
|
|
204
|
+
"copies",
|
|
205
|
+
"sinks",
|
|
206
|
+
"pipes",
|
|
207
|
+
"fixtures",
|
|
208
|
+
"tests",
|
|
209
|
+
"connections",
|
|
210
|
+
)
|
|
201
211
|
|
|
202
212
|
|
|
203
213
|
def validate_project_structure(project: Project) -> bool:
|
|
@@ -248,6 +258,7 @@ def create_project_structure(folder: str):
|
|
|
248
258
|
"endpoints →": "Expose real-time HTTP APIs of your transformed data.",
|
|
249
259
|
"materializations →": "Stream continuous updates of the result of a pipe into a new data source.",
|
|
250
260
|
"copies →": "Capture the result of a pipe at a moment in time and write it into a target data source.",
|
|
261
|
+
"sinks →": "Export your data to external systems on a scheduled or on-demand basis.",
|
|
251
262
|
"pipes →": "Transform your data and reuse the logic in endpoints, materializations and copies.",
|
|
252
263
|
"fixtures →": "Files with sample data for your project.",
|
|
253
264
|
"tests →": "Test your pipe files with data validation tests.",
|
tinybird/tb/modules/token.py
CHANGED
|
@@ -165,22 +165,20 @@ def parse_fixed_params(fixed_params_list):
|
|
|
165
165
|
def create(ctx: Context) -> None:
|
|
166
166
|
"""Token creation commands.
|
|
167
167
|
|
|
168
|
-
You can create two types of tokens:
|
|
168
|
+
You can create two types of tokens: Static or JWT.
|
|
169
|
+
|
|
170
|
+
* Static Tokens do not have a TTL and can have any valid scope (ADMIN, TOKENS, or ORG_DATASOURCES:READ).
|
|
169
171
|
|
|
170
172
|
* JWT tokens have a TTL and can only have the PIPES:READ scope.Their main use case is allow your users to call your endpoints without exposing your API key.
|
|
171
173
|
|
|
172
|
-
* Static Tokens do not have a TTL and can have any valid scope (DATASOURCES:READ, DATASOURCES:APPEND, DATASOURCES:CREATE, DATASOURCES:DROP, PIPES:CREATE, PIPES:READ, PIPES:DROP).
|
|
173
174
|
|
|
174
175
|
Examples:
|
|
175
176
|
|
|
176
|
-
tb token create
|
|
177
|
-
|
|
178
|
-
tb token create static my_static_token --scope PIPES:READ --resource my_pipe
|
|
177
|
+
tb token create static my_static_token --scope ADMIN
|
|
179
178
|
|
|
180
|
-
tb token create static my_static_token --scope
|
|
181
|
-
|
|
182
|
-
tb token create static my_static_token --scope DATASOURCES:READ --resource my_datasource --filters "column_name=value"
|
|
179
|
+
tb token create static my_static_token --scope TOKENS
|
|
183
180
|
|
|
181
|
+
tb token create jwt my_jwt_token --ttl 1h --scope PIPES:READ --resource my_pipe
|
|
184
182
|
"""
|
|
185
183
|
|
|
186
184
|
|
|
@@ -248,13 +246,9 @@ async def create_jwt_token(ctx: Context, name: str, ttl: timedelta, scope, resou
|
|
|
248
246
|
|
|
249
247
|
# Valid scopes for Static Tokens
|
|
250
248
|
valid_scopes = [
|
|
251
|
-
"
|
|
252
|
-
"
|
|
253
|
-
"
|
|
254
|
-
"DATASOURCES:DROP",
|
|
255
|
-
"PIPES:CREATE",
|
|
256
|
-
"PIPES:READ",
|
|
257
|
-
"PIPES:DROP",
|
|
249
|
+
"ADMIN",
|
|
250
|
+
"TOKENS",
|
|
251
|
+
"ORG_DATASOURCES:READ",
|
|
258
252
|
]
|
|
259
253
|
|
|
260
254
|
|
|
@@ -271,8 +265,6 @@ class DynamicOptionsCommand(click.Command):
|
|
|
271
265
|
# Options
|
|
272
266
|
dynamic_options_help += "Options:\n"
|
|
273
267
|
dynamic_options_help += f" --scope [{','.join(valid_scopes)}] Scope for the token [Required]\n"
|
|
274
|
-
dynamic_options_help += " --resource TEXT Resource you want to associate the scope with\n"
|
|
275
|
-
dynamic_options_help += " --filter TEXT SQL condition used to filter the values when calling with this token (eg. --filter=value > 0) \n"
|
|
276
268
|
dynamic_options_help += " -h, --help Show this message and exit.\n"
|
|
277
269
|
|
|
278
270
|
return dynamic_options_help
|
|
@@ -3,21 +3,21 @@ tinybird/context.py,sha256=FfqYfrGX_I7PKGTQo93utaKPDNVYWelg4Hsp3evX5wM,1291
|
|
|
3
3
|
tinybird/datatypes.py,sha256=r4WCvspmrXTJHiPjjyOTiZyZl31FO3Ynkwq4LQsYm6E,11059
|
|
4
4
|
tinybird/feedback_manager.py,sha256=1INQFfRfuMCb9lfB8KNf4r6qC2khW568hoHjtk-wshI,69305
|
|
5
5
|
tinybird/git_settings.py,sha256=Sw_8rGmribEFJ4Z_6idrVytxpFYk7ez8ei0qHULzs3E,3934
|
|
6
|
-
tinybird/prompts.py,sha256=
|
|
6
|
+
tinybird/prompts.py,sha256=D8MpYXFrnlIf6VDeoD-uy0dGyYw0rsIiC8svj5ZGCi0,41199
|
|
7
7
|
tinybird/sql.py,sha256=BufnOgclQokDyihtuXesOwHBsebN6wRXIxO5wKRkOwE,48299
|
|
8
8
|
tinybird/sql_template.py,sha256=WjsTBjpQLVBHGZbY2dZuhZUurFR-rbJ_KRRy5vx4Y5E,99967
|
|
9
9
|
tinybird/sql_template_fmt.py,sha256=KUHdj5rYCYm_rKKdXYSJAE9vIyXUQLB0YSZnUXHeBlY,10196
|
|
10
10
|
tinybird/sql_toolset.py,sha256=M2rpLYkgV2W8NnYEYPC1tJdpy4uZHXVF64NBSKLQka4,19549
|
|
11
11
|
tinybird/syncasync.py,sha256=IPnOx6lMbf9SNddN1eBtssg8vCLHMt76SuZ6YNYm-Yk,27761
|
|
12
12
|
tinybird/tornado_template.py,sha256=jjNVDMnkYFWXflmT8KU_Ssbo5vR8KQq3EJMk5vYgXRw,41959
|
|
13
|
-
tinybird/ch_utils/constants.py,sha256=
|
|
13
|
+
tinybird/ch_utils/constants.py,sha256=yEKR11gLCL-irEXXF9QwShaR0JLXiBTlaxfolcCIoqY,4097
|
|
14
14
|
tinybird/ch_utils/engine.py,sha256=X4tE9OrfaUy6kO9cqVEzyI9cDcmOF3IAssRRzsTsfEQ,40781
|
|
15
15
|
tinybird/datafile/common.py,sha256=9hC1APatnfFeYXyTm_s47VmXP0JUajvpkw1vsrSXo70,91664
|
|
16
16
|
tinybird/datafile/exceptions.py,sha256=8rw2umdZjtby85QbuRKFO5ETz_eRHwUY5l7eHsy1wnI,556
|
|
17
17
|
tinybird/datafile/parse_connection.py,sha256=tRyn2Rpr1TeWet5BXmMoQgaotbGdYep1qiTak_OqC5E,1825
|
|
18
18
|
tinybird/datafile/parse_datasource.py,sha256=ssW8QeFSgglVFi3sDZj_HgkJiTJ2069v2JgqnH3CkDE,1825
|
|
19
19
|
tinybird/datafile/parse_pipe.py,sha256=xf4m0Tw44QWJzHzAm7Z7FwUoUUtr7noMYjU1NiWnX0k,3880
|
|
20
|
-
tinybird/tb/__cli__.py,sha256=
|
|
20
|
+
tinybird/tb/__cli__.py,sha256=PujnGW-G8Oj4-QEaIK25CMFn5vrp0b-YhKlTKuayFmc,247
|
|
21
21
|
tinybird/tb/check_pypi.py,sha256=i3l2L8IajeB7sreikR7oPlYJki9MtS3c_M4crnmbByc,760
|
|
22
22
|
tinybird/tb/cli.py,sha256=0xYk2Ip4vb3nNFbxfTdG3VoIgdRvUKVbUVU_mviErPA,1107
|
|
23
23
|
tinybird/tb/client.py,sha256=FKj61vY9STPW03kfVcxYuY1_csI-kP-mc1ERQfqJtg8,56505
|
|
@@ -29,7 +29,7 @@ tinybird/tb/modules/common.py,sha256=WWvbDSQmyYUy9Xyc_BqtrdRzpDdzLuE9i_pWhoA1a8k
|
|
|
29
29
|
tinybird/tb/modules/config.py,sha256=VnzYVUo4q1RBEEMMce4_OCrKp4erhgkRPHElydVlKj0,11488
|
|
30
30
|
tinybird/tb/modules/connection.py,sha256=rdEsdcP-AqyHiW3KNoETGPeTjk7Wt3It6z_SnmInGcc,18648
|
|
31
31
|
tinybird/tb/modules/copy.py,sha256=zHN1d5NA-MFsgbk2kKJq2P9qA8dNOnIsIa60QpVnSwc,4458
|
|
32
|
-
tinybird/tb/modules/create.py,sha256=
|
|
32
|
+
tinybird/tb/modules/create.py,sha256=dRpzwv1GWqu1BqZtl1-AkFbap52adA-GwY-xf0qxIcw,22262
|
|
33
33
|
tinybird/tb/modules/datasource.py,sha256=4a50A_qwB-3FUEUeB3ps6tUCJvn02rMUUwW-vHaMjTw,40846
|
|
34
34
|
tinybird/tb/modules/deployment.py,sha256=ByXIgEvwxB49pJEKKj0EJIfORWyflCYr04k8961nBkA,28391
|
|
35
35
|
tinybird/tb/modules/deprecations.py,sha256=rrszC1f_JJeJ8mUxGoCxckQTJFBCR8wREf4XXXN-PRc,4507
|
|
@@ -58,7 +58,7 @@ tinybird/tb/modules/sink.py,sha256=bIjLjog4XH42yfp944cMnaE4il7Kl7Wn7F-nLKfH2Bc,3
|
|
|
58
58
|
tinybird/tb/modules/table.py,sha256=4XrtjM-N0zfNtxVkbvLDQQazno1EPXnxTyo7llivfXk,11035
|
|
59
59
|
tinybird/tb/modules/telemetry.py,sha256=T9gtsQffWqG_4hRBaUJPzOfMkPwz7mH-R6Bn1XRYViA,11482
|
|
60
60
|
tinybird/tb/modules/test.py,sha256=XakpYi0Q2gGKItpPdtRVLKzQldkvCPqzPhwwbUxyrmc,13292
|
|
61
|
-
tinybird/tb/modules/token.py,sha256=
|
|
61
|
+
tinybird/tb/modules/token.py,sha256=pSlDed5RzcadJlvIKQh22Y49gt1Rfw-0rCTko6x4y3g,12879
|
|
62
62
|
tinybird/tb/modules/watch.py,sha256=HhruZoUrehlxL_nFIK3BlpHp2uyzKAM9cmNXBCa4Zgs,8965
|
|
63
63
|
tinybird/tb/modules/workspace.py,sha256=ngn5yGG9K9sFaUzm0W42j_vQnm3pQS2Jh38GNgbMtP0,11607
|
|
64
64
|
tinybird/tb/modules/workspace_members.py,sha256=RYLpyPM1ECCasHRg3uvpckzXplX0_KgNFsSPZn_i6qk,8744
|
|
@@ -82,8 +82,8 @@ tinybird/tb_cli_modules/config.py,sha256=IsgdtFRnUrkY8-Zo32lmk6O7u3bHie1QCxLwgp4
|
|
|
82
82
|
tinybird/tb_cli_modules/exceptions.py,sha256=pmucP4kTF4irIt7dXiG-FcnI-o3mvDusPmch1L8RCWk,3367
|
|
83
83
|
tinybird/tb_cli_modules/regions.py,sha256=QjsL5H6Kg-qr0aYVLrvb1STeJ5Sx_sjvbOYO0LrEGMk,166
|
|
84
84
|
tinybird/tb_cli_modules/telemetry.py,sha256=Hh2Io8ZPROSunbOLuMvuIFU4TqwWPmQTqal4WS09K1A,10449
|
|
85
|
-
tinybird-0.0.1.
|
|
86
|
-
tinybird-0.0.1.
|
|
87
|
-
tinybird-0.0.1.
|
|
88
|
-
tinybird-0.0.1.
|
|
89
|
-
tinybird-0.0.1.
|
|
85
|
+
tinybird-0.0.1.dev224.dist-info/METADATA,sha256=yGFt6VbHGg2Ui5NByQrsz-kNbbjYzaPNX6qhqRRukig,1682
|
|
86
|
+
tinybird-0.0.1.dev224.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
|
87
|
+
tinybird-0.0.1.dev224.dist-info/entry_points.txt,sha256=LwdHU6TfKx4Qs7BqqtaczEZbImgU7Abe9Lp920zb_fo,43
|
|
88
|
+
tinybird-0.0.1.dev224.dist-info/top_level.txt,sha256=VqqqEmkAy7UNaD8-V51FCoMMWXjLUlR0IstvK7tJYVY,54
|
|
89
|
+
tinybird-0.0.1.dev224.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|