tinybird-cli 5.5.1.dev2__tar.gz → 5.5.1.dev4__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-cli-5.5.1.dev2 → tinybird-cli-5.5.1.dev4}/PKG-INFO +11 -1
- {tinybird-cli-5.5.1.dev2 → tinybird-cli-5.5.1.dev4}/tinybird/__cli__.py +2 -2
- {tinybird-cli-5.5.1.dev2 → tinybird-cli-5.5.1.dev4}/tinybird/datafile.py +19 -4
- {tinybird-cli-5.5.1.dev2 → tinybird-cli-5.5.1.dev4}/tinybird/feedback_manager.py +3 -0
- {tinybird-cli-5.5.1.dev2 → tinybird-cli-5.5.1.dev4}/tinybird/sql_template.py +14 -14
- {tinybird-cli-5.5.1.dev2 → tinybird-cli-5.5.1.dev4}/tinybird_cli.egg-info/PKG-INFO +11 -1
- {tinybird-cli-5.5.1.dev2 → tinybird-cli-5.5.1.dev4}/setup.cfg +0 -0
- {tinybird-cli-5.5.1.dev2 → tinybird-cli-5.5.1.dev4}/tinybird/ch_utils/constants.py +0 -0
- {tinybird-cli-5.5.1.dev2 → tinybird-cli-5.5.1.dev4}/tinybird/ch_utils/engine.py +0 -0
- {tinybird-cli-5.5.1.dev2 → tinybird-cli-5.5.1.dev4}/tinybird/check_pypi.py +0 -0
- {tinybird-cli-5.5.1.dev2 → tinybird-cli-5.5.1.dev4}/tinybird/client.py +0 -0
- {tinybird-cli-5.5.1.dev2 → tinybird-cli-5.5.1.dev4}/tinybird/config.py +0 -0
- {tinybird-cli-5.5.1.dev2 → tinybird-cli-5.5.1.dev4}/tinybird/connectors.py +0 -0
- {tinybird-cli-5.5.1.dev2 → tinybird-cli-5.5.1.dev4}/tinybird/context.py +0 -0
- {tinybird-cli-5.5.1.dev2 → tinybird-cli-5.5.1.dev4}/tinybird/datatypes.py +0 -0
- {tinybird-cli-5.5.1.dev2 → tinybird-cli-5.5.1.dev4}/tinybird/git_settings.py +0 -0
- {tinybird-cli-5.5.1.dev2 → tinybird-cli-5.5.1.dev4}/tinybird/sql.py +0 -0
- {tinybird-cli-5.5.1.dev2 → tinybird-cli-5.5.1.dev4}/tinybird/sql_template_fmt.py +0 -0
- {tinybird-cli-5.5.1.dev2 → tinybird-cli-5.5.1.dev4}/tinybird/sql_toolset.py +0 -0
- {tinybird-cli-5.5.1.dev2 → tinybird-cli-5.5.1.dev4}/tinybird/syncasync.py +0 -0
- {tinybird-cli-5.5.1.dev2 → tinybird-cli-5.5.1.dev4}/tinybird/tb_cli.py +0 -0
- {tinybird-cli-5.5.1.dev2 → tinybird-cli-5.5.1.dev4}/tinybird/tb_cli_modules/auth.py +0 -0
- {tinybird-cli-5.5.1.dev2 → tinybird-cli-5.5.1.dev4}/tinybird/tb_cli_modules/branch.py +0 -0
- {tinybird-cli-5.5.1.dev2 → tinybird-cli-5.5.1.dev4}/tinybird/tb_cli_modules/cicd.py +0 -0
- {tinybird-cli-5.5.1.dev2 → tinybird-cli-5.5.1.dev4}/tinybird/tb_cli_modules/cli.py +0 -0
- {tinybird-cli-5.5.1.dev2 → tinybird-cli-5.5.1.dev4}/tinybird/tb_cli_modules/common.py +0 -0
- {tinybird-cli-5.5.1.dev2 → tinybird-cli-5.5.1.dev4}/tinybird/tb_cli_modules/config.py +0 -0
- {tinybird-cli-5.5.1.dev2 → tinybird-cli-5.5.1.dev4}/tinybird/tb_cli_modules/connection.py +0 -0
- {tinybird-cli-5.5.1.dev2 → tinybird-cli-5.5.1.dev4}/tinybird/tb_cli_modules/datasource.py +0 -0
- {tinybird-cli-5.5.1.dev2 → tinybird-cli-5.5.1.dev4}/tinybird/tb_cli_modules/exceptions.py +0 -0
- {tinybird-cli-5.5.1.dev2 → tinybird-cli-5.5.1.dev4}/tinybird/tb_cli_modules/job.py +0 -0
- {tinybird-cli-5.5.1.dev2 → tinybird-cli-5.5.1.dev4}/tinybird/tb_cli_modules/pipe.py +0 -0
- {tinybird-cli-5.5.1.dev2 → tinybird-cli-5.5.1.dev4}/tinybird/tb_cli_modules/regions.py +0 -0
- {tinybird-cli-5.5.1.dev2 → tinybird-cli-5.5.1.dev4}/tinybird/tb_cli_modules/telemetry.py +0 -0
- {tinybird-cli-5.5.1.dev2 → tinybird-cli-5.5.1.dev4}/tinybird/tb_cli_modules/test.py +0 -0
- {tinybird-cli-5.5.1.dev2 → tinybird-cli-5.5.1.dev4}/tinybird/tb_cli_modules/tinyunit/tinyunit.py +0 -0
- {tinybird-cli-5.5.1.dev2 → tinybird-cli-5.5.1.dev4}/tinybird/tb_cli_modules/tinyunit/tinyunit_lib.py +0 -0
- {tinybird-cli-5.5.1.dev2 → tinybird-cli-5.5.1.dev4}/tinybird/tb_cli_modules/token.py +0 -0
- {tinybird-cli-5.5.1.dev2 → tinybird-cli-5.5.1.dev4}/tinybird/tb_cli_modules/workspace.py +0 -0
- {tinybird-cli-5.5.1.dev2 → tinybird-cli-5.5.1.dev4}/tinybird/tb_cli_modules/workspace_members.py +0 -0
- {tinybird-cli-5.5.1.dev2 → tinybird-cli-5.5.1.dev4}/tinybird/tornado_template.py +0 -0
- {tinybird-cli-5.5.1.dev2 → tinybird-cli-5.5.1.dev4}/tinybird_cli.egg-info/SOURCES.txt +0 -0
- {tinybird-cli-5.5.1.dev2 → tinybird-cli-5.5.1.dev4}/tinybird_cli.egg-info/dependency_links.txt +0 -0
- {tinybird-cli-5.5.1.dev2 → tinybird-cli-5.5.1.dev4}/tinybird_cli.egg-info/entry_points.txt +0 -0
- {tinybird-cli-5.5.1.dev2 → tinybird-cli-5.5.1.dev4}/tinybird_cli.egg-info/requires.txt +0 -0
- {tinybird-cli-5.5.1.dev2 → tinybird-cli-5.5.1.dev4}/tinybird_cli.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: tinybird-cli
|
|
3
|
-
Version: 5.5.1.
|
|
3
|
+
Version: 5.5.1.dev4
|
|
4
4
|
Summary: Tinybird Command Line Tool
|
|
5
5
|
Home-page: https://www.tinybird.co/docs/cli/introduction.html
|
|
6
6
|
Author: Tinybird
|
|
@@ -18,6 +18,16 @@ The Tinybird command-line tool allows you to use all the Tinybird functionality
|
|
|
18
18
|
Changelog
|
|
19
19
|
----------
|
|
20
20
|
|
|
21
|
+
5.5.1.dev4
|
|
22
|
+
**********
|
|
23
|
+
|
|
24
|
+
- `Added` Add `IMPORT_FROM_TIMESTAMP` to the list of supported directives in the CLI for S3 Data Sources, files added to the S3 bucket before that time will be ignored. [Read our docs for more information.](https://www.tinybird.co/docs/ingest/s3)
|
|
25
|
+
|
|
26
|
+
5.5.1.dev3
|
|
27
|
+
**********
|
|
28
|
+
|
|
29
|
+
- `Changed` Internal change
|
|
30
|
+
|
|
21
31
|
5.5.1.dev2
|
|
22
32
|
**********
|
|
23
33
|
|
|
@@ -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__ = '5.5.1.
|
|
8
|
-
__revision__ = '
|
|
7
|
+
__version__ = '5.5.1.dev4'
|
|
8
|
+
__revision__ = 'b16f004'
|
|
@@ -3,6 +3,7 @@ Datafile is like a Dockerfile but to describe ETL processes
|
|
|
3
3
|
"""
|
|
4
4
|
|
|
5
5
|
from asyncio import Semaphore, gather
|
|
6
|
+
from datetime import datetime
|
|
6
7
|
|
|
7
8
|
from requests import Response
|
|
8
9
|
|
|
@@ -148,6 +149,7 @@ class ImportReplacements:
|
|
|
148
149
|
("import_connector", "connector", None),
|
|
149
150
|
("import_external_datasource", "external_data_source", None),
|
|
150
151
|
("import_bucket_uri", "bucket_uri", None),
|
|
152
|
+
("import_from_timestamp", "from_time", None),
|
|
151
153
|
("import_table_arn", "dynamodb_table_arn", None),
|
|
152
154
|
("import_export_bucket", "dynamodb_export_bucket", None),
|
|
153
155
|
)
|
|
@@ -439,11 +441,15 @@ class CLIGitRelease:
|
|
|
439
441
|
raise CLIGitReleaseException(
|
|
440
442
|
FeedbackManager.error_commit_changes_to_release(path=self.path, git_output=self.status())
|
|
441
443
|
)
|
|
442
|
-
|
|
444
|
+
try:
|
|
445
|
+
if not self.is_head_outdated(current_release["commit"]):
|
|
446
|
+
if check_outdated:
|
|
447
|
+
raise CLIGitReleaseException(FeedbackManager.error_head_outdated(commit=self.head_commit()))
|
|
448
|
+
else:
|
|
449
|
+
click.echo(FeedbackManager.warning_head_outdated(commit=self.head_commit()))
|
|
450
|
+
except CLIGitReleaseException as e:
|
|
443
451
|
if check_outdated:
|
|
444
|
-
raise
|
|
445
|
-
else:
|
|
446
|
-
click.echo(FeedbackManager.warning_head_outdated(commit=self.head_commit()))
|
|
452
|
+
raise e
|
|
447
453
|
if not self.is_new_release(current_release["commit"]) and check_new:
|
|
448
454
|
raise CLIGitReleaseException(FeedbackManager.error_head_already_released(commit=current_release["commit"]))
|
|
449
455
|
|
|
@@ -1141,6 +1147,7 @@ def parse(
|
|
|
1141
1147
|
"import_strategy": assign_var("import_strategy"),
|
|
1142
1148
|
"import_external_datasource": assign_var("import_external_datasource"),
|
|
1143
1149
|
"import_bucket_uri": assign_var("import_bucket_uri"),
|
|
1150
|
+
"import_from_timestamp": assign_var("import_from_timestamp"),
|
|
1144
1151
|
"import_query": assign_var("import_query"),
|
|
1145
1152
|
"import_table_arn": assign_var("import_table_arn"),
|
|
1146
1153
|
"import_export_bucket": assign_var("import_export_bucket"),
|
|
@@ -1345,6 +1352,14 @@ async def process_file(
|
|
|
1345
1352
|
if service:
|
|
1346
1353
|
params["import_service"] = service
|
|
1347
1354
|
|
|
1355
|
+
if import_from_timestamp := params.get("import_from_timestamp", None):
|
|
1356
|
+
try:
|
|
1357
|
+
str(datetime.fromisoformat(import_from_timestamp).isoformat())
|
|
1358
|
+
except ValueError:
|
|
1359
|
+
raise click.ClickException(
|
|
1360
|
+
FeedbackManager.error_invalid_import_from_timestamp(datasource=datasource["name"])
|
|
1361
|
+
)
|
|
1362
|
+
|
|
1348
1363
|
if service in PREVIEW_CONNECTOR_SERVICES:
|
|
1349
1364
|
if not params.get("import_bucket_uri", None):
|
|
1350
1365
|
raise click.ClickException(FeedbackManager.error_missing_bucket_uri(datasource=datasource["name"]))
|
|
@@ -299,6 +299,9 @@ class FeedbackManager:
|
|
|
299
299
|
error_missing_bucket_uri = error_message(
|
|
300
300
|
"Missing IMPORT_BUCKET_URI in '{datasource}'.\n** See https://www.tinybird.co/docs/ingest/s3 to learn more."
|
|
301
301
|
)
|
|
302
|
+
error_invalid_import_from_timestamp = error_message(
|
|
303
|
+
"Invalid IMPORT_FROM_TIMESTAMP in '{datasource}'.\n** See https://www.tinybird.co/docs/ingest/s3 to learn more."
|
|
304
|
+
)
|
|
302
305
|
error_missing_table_arn = error_message(
|
|
303
306
|
"Missing IMPORT_TABLE_ARN in '{datasource}'.\n** See https://www.tinybird.co/docs/ingest/dynamodb to learn more."
|
|
304
307
|
)
|
|
@@ -190,11 +190,11 @@ class Comment:
|
|
|
190
190
|
|
|
191
191
|
class Placeholder:
|
|
192
192
|
def __init__(self, name=None, line=None):
|
|
193
|
-
self.name = name if name else "
|
|
193
|
+
self.name = name if name else "__no_value__"
|
|
194
194
|
self.line = line or "unknown"
|
|
195
195
|
|
|
196
196
|
def __str__(self):
|
|
197
|
-
return "
|
|
197
|
+
return "__no_value__"
|
|
198
198
|
|
|
199
199
|
def __getitem__(self, i):
|
|
200
200
|
if i > 2:
|
|
@@ -371,7 +371,7 @@ def array_type(types): # noqa: C901
|
|
|
371
371
|
if _type and _type in types:
|
|
372
372
|
x = ",".join(map(str, [types[_type](x) for _ in range(2)]))
|
|
373
373
|
else:
|
|
374
|
-
x = ",".join([f"
|
|
374
|
+
x = ",".join([f"__no_value__{i}" for i in range(2)])
|
|
375
375
|
elif x is None:
|
|
376
376
|
x = default
|
|
377
377
|
if x is None:
|
|
@@ -449,7 +449,7 @@ def string_type(x, default=None):
|
|
|
449
449
|
if default:
|
|
450
450
|
x = default
|
|
451
451
|
else:
|
|
452
|
-
x = "
|
|
452
|
+
x = "__no_value__"
|
|
453
453
|
return x
|
|
454
454
|
|
|
455
455
|
|
|
@@ -754,7 +754,7 @@ def json_type(x, default=None):
|
|
|
754
754
|
if default:
|
|
755
755
|
x = default
|
|
756
756
|
else:
|
|
757
|
-
x = "
|
|
757
|
+
x = "__no_value__"
|
|
758
758
|
|
|
759
759
|
try:
|
|
760
760
|
if x is None:
|
|
@@ -1003,7 +1003,7 @@ def get_transform_types(placeholders=None):
|
|
|
1003
1003
|
"String": transform_type(
|
|
1004
1004
|
"String",
|
|
1005
1005
|
str,
|
|
1006
|
-
placeholder="
|
|
1006
|
+
placeholder="__no_value__",
|
|
1007
1007
|
required=None,
|
|
1008
1008
|
description=None,
|
|
1009
1009
|
enum=None,
|
|
@@ -1212,7 +1212,7 @@ def get_transform_types(placeholders=None):
|
|
|
1212
1212
|
"String": transform_type(
|
|
1213
1213
|
"String",
|
|
1214
1214
|
str,
|
|
1215
|
-
placeholder="
|
|
1215
|
+
placeholder="__no_value__",
|
|
1216
1216
|
required=None,
|
|
1217
1217
|
description=None,
|
|
1218
1218
|
enum=None,
|
|
@@ -1310,7 +1310,7 @@ def expression_wrapper(x, name, escape_arrays: bool = False):
|
|
|
1310
1310
|
if type(x) in (unicode_type, bytes, str):
|
|
1311
1311
|
return "'" + sqlescape_for_string_expression(x) + "'"
|
|
1312
1312
|
elif isinstance(x, Placeholder):
|
|
1313
|
-
return "'
|
|
1313
|
+
return "'__no_value__'"
|
|
1314
1314
|
elif isinstance(x, Comment):
|
|
1315
1315
|
return "-- {x} \n"
|
|
1316
1316
|
if x is None:
|
|
@@ -1987,7 +1987,7 @@ def render_sql_template(
|
|
|
1987
1987
|
>>> render_sql_template("select * from table where f = {{Float32(foo)}}", test_mode=True)
|
|
1988
1988
|
("select * from table where f = toFloat32('0.0')", {}, [])
|
|
1989
1989
|
>>> render_sql_template("SELECT * FROM query_log__dev where a = {{test}}", test_mode=True)
|
|
1990
|
-
("SELECT * FROM query_log__dev where a = '
|
|
1990
|
+
("SELECT * FROM query_log__dev where a = '__no_value__'", {}, [])
|
|
1991
1991
|
>>> render_sql_template("SELECT {{test}}", {'token':'testing'})
|
|
1992
1992
|
Traceback (most recent call last):
|
|
1993
1993
|
...
|
|
@@ -1997,7 +1997,7 @@ def render_sql_template(
|
|
|
1997
1997
|
>>> render_sql_template('{% if Int32(test, 1) %}SELECT 1{% else %} select 2 {% end %}')
|
|
1998
1998
|
('SELECT 1', {}, [])
|
|
1999
1999
|
>>> render_sql_template('{% for v in test %}SELECT {{v}} {% end %}',test_mode=True)
|
|
2000
|
-
("SELECT '
|
|
2000
|
+
("SELECT '__no_value__' SELECT '__no_value__' SELECT '__no_value__' ", {}, [])
|
|
2001
2001
|
>>> render_sql_template("select {{Int32(foo, 1)}}", test_mode=True)
|
|
2002
2002
|
("select toInt32('1')", {}, [])
|
|
2003
2003
|
>>> render_sql_template("SELECT count() c FROM test_table where a > {{Float32(myvar)}} {% if defined(my_condition) %} and c = Int32({{my_condition}}){% end %}", {'myvar': 1.0})
|
|
@@ -2031,11 +2031,11 @@ def render_sql_template(
|
|
|
2031
2031
|
>>> render_sql_template("SELECT {{Array(foo, 'Int32')}}", test_mode=True)
|
|
2032
2032
|
('SELECT [0,0]', {}, [])
|
|
2033
2033
|
>>> render_sql_template("SELECT {{Array(foo)}}", test_mode=True)
|
|
2034
|
-
("SELECT ['
|
|
2034
|
+
("SELECT ['__no_value__0','__no_value__1']", {}, [])
|
|
2035
2035
|
>>> render_sql_template("{{max_threads(2)}} SELECT 1")
|
|
2036
2036
|
('-- max_threads 2\\n SELECT 1', {'max_threads': 2}, [])
|
|
2037
2037
|
>>> render_sql_template("SELECT {{String(foo)}}", test_mode=True)
|
|
2038
|
-
("SELECT '
|
|
2038
|
+
("SELECT '__no_value__'", {}, [])
|
|
2039
2039
|
>>> render_sql_template("SELECT {{String(foo, 'test')}}", test_mode=True)
|
|
2040
2040
|
("SELECT 'test'", {}, [])
|
|
2041
2041
|
>>> render_sql_template("SELECT {{String(foo, 'test')}}", {'foo': 'tt'})
|
|
@@ -2065,7 +2065,7 @@ def render_sql_template(
|
|
|
2065
2065
|
>>> render_sql_template('{% if not defined(test) %}custom_error({error: "This is an error"}){% end %}', {})
|
|
2066
2066
|
('custom_error({error: "This is an error"})', {}, [])
|
|
2067
2067
|
>>> render_sql_template("SELECT {{String(foo + 'abcd')}}", test_mode=True)
|
|
2068
|
-
("SELECT '
|
|
2068
|
+
("SELECT '__no_value__'", {}, [])
|
|
2069
2069
|
>>> render_sql_template("SELECT {{columns(agg)}}", {})
|
|
2070
2070
|
Traceback (most recent call last):
|
|
2071
2071
|
...
|
|
@@ -2131,7 +2131,7 @@ def render_sql_template(
|
|
|
2131
2131
|
>>> render_sql_template("% {% for kv in JSON(payload) %} department = {{kv['dp']}} {% end %}", test_mode=True)
|
|
2132
2132
|
Traceback (most recent call last):
|
|
2133
2133
|
...
|
|
2134
|
-
tinybird.sql_template.SQLTemplateException: Template Syntax Error: Error parsing JSON: '
|
|
2134
|
+
tinybird.sql_template.SQLTemplateException: Template Syntax Error: Error parsing JSON: '__no_value__' - Expecting value: line 1 column 1 (char 0)
|
|
2135
2135
|
>>> render_sql_template("% {% for kv in JSON(payload, '') %} department = {{kv['dp']}} {% end %}")
|
|
2136
2136
|
Traceback (most recent call last):
|
|
2137
2137
|
...
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: tinybird-cli
|
|
3
|
-
Version: 5.5.1.
|
|
3
|
+
Version: 5.5.1.dev4
|
|
4
4
|
Summary: Tinybird Command Line Tool
|
|
5
5
|
Home-page: https://www.tinybird.co/docs/cli/introduction.html
|
|
6
6
|
Author: Tinybird
|
|
@@ -18,6 +18,16 @@ The Tinybird command-line tool allows you to use all the Tinybird functionality
|
|
|
18
18
|
Changelog
|
|
19
19
|
----------
|
|
20
20
|
|
|
21
|
+
5.5.1.dev4
|
|
22
|
+
**********
|
|
23
|
+
|
|
24
|
+
- `Added` Add `IMPORT_FROM_TIMESTAMP` to the list of supported directives in the CLI for S3 Data Sources, files added to the S3 bucket before that time will be ignored. [Read our docs for more information.](https://www.tinybird.co/docs/ingest/s3)
|
|
25
|
+
|
|
26
|
+
5.5.1.dev3
|
|
27
|
+
**********
|
|
28
|
+
|
|
29
|
+
- `Changed` Internal change
|
|
30
|
+
|
|
21
31
|
5.5.1.dev2
|
|
22
32
|
**********
|
|
23
33
|
|
|
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-cli-5.5.1.dev2 → tinybird-cli-5.5.1.dev4}/tinybird/tb_cli_modules/tinyunit/tinyunit.py
RENAMED
|
File without changes
|
{tinybird-cli-5.5.1.dev2 → tinybird-cli-5.5.1.dev4}/tinybird/tb_cli_modules/tinyunit/tinyunit_lib.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{tinybird-cli-5.5.1.dev2 → tinybird-cli-5.5.1.dev4}/tinybird/tb_cli_modules/workspace_members.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{tinybird-cli-5.5.1.dev2 → tinybird-cli-5.5.1.dev4}/tinybird_cli.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|