tinybird 0.0.1.dev99__tar.gz → 0.0.1.dev101__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.dev99 → tinybird-0.0.1.dev101}/PKG-INFO +1 -1
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird/client.py +10 -0
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird/sql.py +2 -2
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird/sql_toolset.py +16 -3
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird/tb/__cli__.py +2 -2
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird/tb/modules/datafile/common.py +21 -1
- tinybird-0.0.1.dev101/tinybird/tb/modules/infra.py +624 -0
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird.egg-info/PKG-INFO +1 -1
- tinybird-0.0.1.dev99/tinybird/tb/modules/infra.py +0 -693
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/setup.cfg +0 -0
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird/__cli__.py +0 -0
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird/ch_utils/constants.py +0 -0
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird/ch_utils/engine.py +0 -0
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird/check_pypi.py +0 -0
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird/config.py +0 -0
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird/connectors.py +0 -0
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird/context.py +0 -0
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird/datafile.py +0 -0
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird/datatypes.py +0 -0
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird/feedback_manager.py +0 -0
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird/git_settings.py +0 -0
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird/prompts.py +0 -0
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird/sql_template.py +0 -0
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird/sql_template_fmt.py +0 -0
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird/syncasync.py +0 -0
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird/tb/cli.py +0 -0
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird/tb/modules/auth.py +0 -0
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird/tb/modules/build.py +0 -0
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird/tb/modules/cicd.py +0 -0
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird/tb/modules/cli.py +0 -0
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird/tb/modules/common.py +0 -0
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird/tb/modules/config.py +0 -0
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird/tb/modules/connection.py +0 -0
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird/tb/modules/copy.py +0 -0
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird/tb/modules/create.py +0 -0
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird/tb/modules/datafile/build.py +0 -0
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird/tb/modules/datafile/build_common.py +0 -0
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird/tb/modules/datafile/build_datasource.py +0 -0
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird/tb/modules/datafile/build_pipe.py +0 -0
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird/tb/modules/datafile/diff.py +0 -0
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird/tb/modules/datafile/exceptions.py +0 -0
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird/tb/modules/datafile/fixture.py +0 -0
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird/tb/modules/datafile/format_common.py +0 -0
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird/tb/modules/datafile/format_datasource.py +0 -0
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird/tb/modules/datafile/format_pipe.py +0 -0
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird/tb/modules/datafile/parse_datasource.py +0 -0
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird/tb/modules/datafile/parse_pipe.py +0 -0
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird/tb/modules/datafile/pipe_checker.py +0 -0
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird/tb/modules/datafile/playground.py +0 -0
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird/tb/modules/datafile/pull.py +0 -0
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird/tb/modules/datasource.py +0 -0
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird/tb/modules/deployment.py +0 -0
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird/tb/modules/endpoint.py +0 -0
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird/tb/modules/exceptions.py +0 -0
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird/tb/modules/feedback_manager.py +0 -0
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird/tb/modules/fmt.py +0 -0
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird/tb/modules/job.py +0 -0
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird/tb/modules/llm.py +0 -0
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird/tb/modules/llm_utils.py +0 -0
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird/tb/modules/local.py +0 -0
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird/tb/modules/local_common.py +0 -0
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird/tb/modules/login.py +0 -0
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird/tb/modules/logout.py +0 -0
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird/tb/modules/materialization.py +0 -0
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird/tb/modules/mock.py +0 -0
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird/tb/modules/open.py +0 -0
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird/tb/modules/pipe.py +0 -0
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird/tb/modules/playground.py +0 -0
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird/tb/modules/project.py +0 -0
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird/tb/modules/regions.py +0 -0
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird/tb/modules/secret.py +0 -0
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird/tb/modules/shell.py +0 -0
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird/tb/modules/table.py +0 -0
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird/tb/modules/tag.py +0 -0
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird/tb/modules/telemetry.py +0 -0
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird/tb/modules/test.py +0 -0
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird/tb/modules/tinyunit/tinyunit.py +0 -0
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird/tb/modules/tinyunit/tinyunit_lib.py +0 -0
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird/tb/modules/token.py +0 -0
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird/tb/modules/watch.py +0 -0
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird/tb/modules/workspace.py +0 -0
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird/tb/modules/workspace_members.py +0 -0
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird/tb_cli.py +0 -0
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird/tb_cli_modules/auth.py +0 -0
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird/tb_cli_modules/branch.py +0 -0
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird/tb_cli_modules/cicd.py +0 -0
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird/tb_cli_modules/cli.py +0 -0
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird/tb_cli_modules/common.py +0 -0
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird/tb_cli_modules/config.py +0 -0
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird/tb_cli_modules/connection.py +0 -0
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird/tb_cli_modules/datasource.py +0 -0
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird/tb_cli_modules/exceptions.py +0 -0
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird/tb_cli_modules/fmt.py +0 -0
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird/tb_cli_modules/job.py +0 -0
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird/tb_cli_modules/pipe.py +0 -0
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird/tb_cli_modules/regions.py +0 -0
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird/tb_cli_modules/tag.py +0 -0
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird/tb_cli_modules/telemetry.py +0 -0
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird/tb_cli_modules/test.py +0 -0
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird/tb_cli_modules/tinyunit/tinyunit.py +0 -0
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird/tb_cli_modules/tinyunit/tinyunit_lib.py +0 -0
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird/tb_cli_modules/workspace.py +0 -0
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird/tb_cli_modules/workspace_members.py +0 -0
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird/tornado_template.py +0 -0
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird.egg-info/SOURCES.txt +0 -0
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird.egg-info/dependency_links.txt +0 -0
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird.egg-info/entry_points.txt +0 -0
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird.egg-info/requires.txt +0 -0
- {tinybird-0.0.1.dev99 → tinybird-0.0.1.dev101}/tinybird.egg-info/top_level.txt +0 -0
|
@@ -915,6 +915,16 @@ class TinyB:
|
|
|
915
915
|
}
|
|
916
916
|
return await self._req(f"/v1/infra?{urlencode(params)}", method="POST")
|
|
917
917
|
|
|
918
|
+
async def infra_update(self, infra_id: str, organization_id: str, name: str, host: str) -> Dict[str, Any]:
|
|
919
|
+
params = {
|
|
920
|
+
"organization_id": organization_id,
|
|
921
|
+
}
|
|
922
|
+
if name:
|
|
923
|
+
params["name"] = name
|
|
924
|
+
if host:
|
|
925
|
+
params["host"] = host
|
|
926
|
+
return await self._req(f"/v1/infra/{infra_id}?{urlencode(params)}", method="PUT")
|
|
927
|
+
|
|
918
928
|
async def infra_list(self, organization_id: str) -> List[Dict[str, Any]]:
|
|
919
929
|
data = await self._req(f"/v1/infra?organization_id={organization_id}")
|
|
920
930
|
return data.get("infras", [])
|
|
@@ -174,7 +174,7 @@ def try_to_fix_nullable_in_simple_aggregating_function(t: str) -> Optional[str]:
|
|
|
174
174
|
return result
|
|
175
175
|
|
|
176
176
|
|
|
177
|
-
def schema_to_sql_columns(schema: List[Dict[str, Any]]) -> List[str]:
|
|
177
|
+
def schema_to_sql_columns(schema: List[Dict[str, Any]], skip_jsonpaths: bool = False) -> List[str]:
|
|
178
178
|
"""return an array with each column in SQL
|
|
179
179
|
>>> schema_to_sql_columns([{'name': 'temperature', 'type': 'Float32', 'codec': None, 'default_value': None, 'nullable': False, 'normalized_name': 'temperature'}, {'name': 'temperature_delta', 'type': 'Float32', 'codec': 'CODEC(Delta(4), LZ4))', 'default_value': 'MATERIALIZED temperature', 'nullable': False, 'normalized_name': 'temperature_delta'}])
|
|
180
180
|
['`temperature` Float32', '`temperature_delta` Float32 MATERIALIZED temperature CODEC(Delta(4), LZ4))']
|
|
@@ -198,7 +198,7 @@ def schema_to_sql_columns(schema: List[Dict[str, Any]]) -> List[str]:
|
|
|
198
198
|
else:
|
|
199
199
|
_type = x["type"]
|
|
200
200
|
parts = [col_name(name, backquotes=True), _type]
|
|
201
|
-
if x.get("jsonpath", None):
|
|
201
|
+
if x.get("jsonpath", None) and not skip_jsonpaths:
|
|
202
202
|
parts.append(f"`json:{x['jsonpath']}`")
|
|
203
203
|
if "default_value" in x and x["default_value"] not in ("", None):
|
|
204
204
|
parts.append(x["default_value"])
|
|
@@ -10,6 +10,9 @@ from toposort import toposort
|
|
|
10
10
|
|
|
11
11
|
from tinybird.ch_utils.constants import COPY_ENABLED_TABLE_FUNCTIONS, ENABLED_TABLE_FUNCTIONS
|
|
12
12
|
|
|
13
|
+
# VALID_REMOTE is used to explicitly vet queries sent to sql_toolset. In this module, when a table used in a query has
|
|
14
|
+
# VALID_REMOTE in the database portion (as in (VALID_REMOTE, "select * from cluster(tinybird, public.t_blabla)"), the
|
|
15
|
+
# query is not blocked, even if the rhs (the "select * ..." bit) is not found in the various collections of allowed tables.
|
|
13
16
|
VALID_REMOTE = "VALID_REMOTE"
|
|
14
17
|
|
|
15
18
|
|
|
@@ -351,14 +354,24 @@ def is_invalid_resource(
|
|
|
351
354
|
valid_tables: Optional[Set[Tuple[str, str]]] = None,
|
|
352
355
|
) -> bool:
|
|
353
356
|
return is_invalid_resource_from_other_workspace(
|
|
354
|
-
r, database, default_database, _replaced_with
|
|
357
|
+
r, database, default_database, _replaced_with, valid_tables
|
|
355
358
|
) or is_invalid_resource_from_current_workspace(r, database, default_database, _replaced_with, valid_tables)
|
|
356
359
|
|
|
357
360
|
|
|
358
361
|
def is_invalid_resource_from_other_workspace(
|
|
359
|
-
r: Tuple[str, str],
|
|
362
|
+
r: Tuple[str, str],
|
|
363
|
+
database: str,
|
|
364
|
+
default_database: str,
|
|
365
|
+
_replaced_with: Set[Tuple[str, str]],
|
|
366
|
+
valid_tables: Optional[Set[Tuple[str, str]]],
|
|
360
367
|
) -> bool:
|
|
361
|
-
return database not in [default_database, "tinybird", VALID_REMOTE] and r not in _replaced_with
|
|
368
|
+
# return database not in [default_database, "tinybird", VALID_REMOTE] and r not in _replaced_with
|
|
369
|
+
return bool(
|
|
370
|
+
database not in [default_database, "tinybird", VALID_REMOTE]
|
|
371
|
+
and valid_tables
|
|
372
|
+
and r not in valid_tables
|
|
373
|
+
and r not in _replaced_with
|
|
374
|
+
)
|
|
362
375
|
|
|
363
376
|
|
|
364
377
|
def is_invalid_resource_from_current_workspace(
|
|
@@ -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.dev101'
|
|
8
|
+
__revision__ = '5dc0d4b'
|
|
@@ -183,6 +183,15 @@ class DatafileKind(Enum):
|
|
|
183
183
|
return extension_map[extension]
|
|
184
184
|
|
|
185
185
|
|
|
186
|
+
KAFKA_PARAMS = {
|
|
187
|
+
"kafka_connection_name",
|
|
188
|
+
"kafka_topic",
|
|
189
|
+
"kafka_group_id",
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
REQUIRED_KAFKA_PARAMS = KAFKA_PARAMS
|
|
193
|
+
|
|
194
|
+
|
|
186
195
|
class Datafile:
|
|
187
196
|
def __init__(self) -> None:
|
|
188
197
|
self.maintainer: Optional[str] = None
|
|
@@ -248,9 +257,10 @@ class Datafile:
|
|
|
248
257
|
f"Invalid permission {token['permission']} for token {token['token_name']}. Only READ is allowed for pipes"
|
|
249
258
|
)
|
|
250
259
|
elif self.kind == DatafileKind.datasource:
|
|
251
|
-
# TODO(eclbg):
|
|
252
260
|
# [x] Just one node
|
|
253
261
|
# [x] Engine is present
|
|
262
|
+
# [x] Token permissions are valid
|
|
263
|
+
# [x] If it's a kafka datasource, all required kafka params are present
|
|
254
264
|
# [ ] ...
|
|
255
265
|
if len(self.nodes) > 1:
|
|
256
266
|
# Our users are not aware of data source data files being a single-node data file, hence this error
|
|
@@ -259,11 +269,20 @@ class Datafile:
|
|
|
259
269
|
node = self.nodes[0]
|
|
260
270
|
if "schema" not in node:
|
|
261
271
|
raise DatafileValidationError("SCHEMA is mandatory")
|
|
272
|
+
# Validate token permissions
|
|
262
273
|
for token in self.tokens:
|
|
263
274
|
if token["permission"].upper() not in {"READ", "APPEND"}:
|
|
264
275
|
raise DatafileValidationError(
|
|
265
276
|
f"Invalid permission {token['permission']} for token {token['token_name']}. Only READ and APPEND are allowed for datasources"
|
|
266
277
|
)
|
|
278
|
+
# Validate Kafka params
|
|
279
|
+
if any(param in node for param in KAFKA_PARAMS) and not all(
|
|
280
|
+
param in node for param in REQUIRED_KAFKA_PARAMS
|
|
281
|
+
):
|
|
282
|
+
missing = [param for param in REQUIRED_KAFKA_PARAMS if param not in node]
|
|
283
|
+
raise DatafileValidationError(
|
|
284
|
+
f"Some Kafka params have been provided, but the following required ones are missing: {missing}"
|
|
285
|
+
)
|
|
267
286
|
else:
|
|
268
287
|
# We cannot validate a datafile whose kind is unknown
|
|
269
288
|
pass
|
|
@@ -1427,6 +1446,7 @@ def parse(
|
|
|
1427
1446
|
"include": include,
|
|
1428
1447
|
"sql": sql("sql"),
|
|
1429
1448
|
"version": version,
|
|
1449
|
+
# TODO(eclbg): We should decide on a single place to define the kafka params. Definitely not here.
|
|
1430
1450
|
"kafka_connection_name": assign_var("kafka_connection_name"),
|
|
1431
1451
|
"kafka_topic": assign_var("kafka_topic"),
|
|
1432
1452
|
"kafka_group_id": assign_var("kafka_group_id"),
|