tinybird 0.0.1.dev119__tar.gz → 0.0.1.dev121__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.dev119 → tinybird-0.0.1.dev121}/PKG-INFO +1 -1
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/datatypes.py +29 -24
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/tb/__cli__.py +2 -2
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/tb/client.py +22 -6
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/tb/modules/common.py +18 -31
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/tb/modules/connection.py +16 -1
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/tb/modules/datafile/common.py +25 -0
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/tb/modules/feedback_manager.py +1 -0
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/tb/modules/llm.py +10 -0
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/tb/modules/local.py +5 -1
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/tb/modules/open.py +3 -2
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird.egg-info/PKG-INFO +1 -1
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/setup.cfg +0 -0
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/__cli__.py +0 -0
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/ch_utils/constants.py +0 -0
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/ch_utils/engine.py +0 -0
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/check_pypi.py +0 -0
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/client.py +0 -0
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/config.py +0 -0
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/connectors.py +0 -0
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/context.py +0 -0
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/datafile.py +0 -0
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/feedback_manager.py +0 -0
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/git_settings.py +0 -0
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/prompts.py +0 -0
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/sql.py +0 -0
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/sql_template.py +0 -0
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/sql_template_fmt.py +0 -0
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/sql_toolset.py +0 -0
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/syncasync.py +0 -0
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/tb/cli.py +0 -0
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/tb/config.py +0 -0
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/tb/modules/auth.py +0 -0
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/tb/modules/build.py +0 -0
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/tb/modules/cicd.py +0 -0
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/tb/modules/cli.py +0 -0
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/tb/modules/config.py +0 -0
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/tb/modules/copy.py +0 -0
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/tb/modules/create.py +0 -0
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/tb/modules/datafile/build.py +0 -0
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/tb/modules/datafile/build_common.py +0 -0
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/tb/modules/datafile/build_datasource.py +0 -0
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/tb/modules/datafile/build_pipe.py +0 -0
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/tb/modules/datafile/diff.py +0 -0
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/tb/modules/datafile/exceptions.py +0 -0
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/tb/modules/datafile/fixture.py +0 -0
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/tb/modules/datafile/format_common.py +0 -0
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/tb/modules/datafile/format_datasource.py +0 -0
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/tb/modules/datafile/format_pipe.py +0 -0
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/tb/modules/datafile/parse_datasource.py +0 -0
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/tb/modules/datafile/parse_pipe.py +0 -0
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/tb/modules/datafile/pipe_checker.py +0 -0
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/tb/modules/datafile/playground.py +0 -0
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/tb/modules/datafile/pull.py +0 -0
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/tb/modules/datasource.py +0 -0
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/tb/modules/deployment.py +0 -0
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/tb/modules/endpoint.py +0 -0
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/tb/modules/exceptions.py +0 -0
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/tb/modules/fmt.py +0 -0
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/tb/modules/infra.py +0 -0
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/tb/modules/job.py +0 -0
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/tb/modules/llm_utils.py +0 -0
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/tb/modules/local_common.py +0 -0
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/tb/modules/login.py +0 -0
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/tb/modules/logout.py +0 -0
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/tb/modules/materialization.py +0 -0
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/tb/modules/mock.py +0 -0
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/tb/modules/pipe.py +0 -0
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/tb/modules/project.py +0 -0
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/tb/modules/regions.py +0 -0
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/tb/modules/secret.py +0 -0
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/tb/modules/shell.py +0 -0
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/tb/modules/table.py +0 -0
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/tb/modules/tag.py +0 -0
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/tb/modules/telemetry.py +0 -0
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/tb/modules/test.py +0 -0
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/tb/modules/tinyunit/tinyunit.py +0 -0
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/tb/modules/tinyunit/tinyunit_lib.py +0 -0
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/tb/modules/token.py +0 -0
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/tb/modules/watch.py +0 -0
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/tb/modules/workspace.py +0 -0
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/tb/modules/workspace_members.py +0 -0
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/tb_cli.py +0 -0
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/tb_cli_modules/auth.py +0 -0
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/tb_cli_modules/branch.py +0 -0
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/tb_cli_modules/cicd.py +0 -0
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/tb_cli_modules/cli.py +0 -0
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/tb_cli_modules/common.py +0 -0
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/tb_cli_modules/config.py +0 -0
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/tb_cli_modules/connection.py +0 -0
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/tb_cli_modules/datasource.py +0 -0
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/tb_cli_modules/exceptions.py +0 -0
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/tb_cli_modules/fmt.py +0 -0
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/tb_cli_modules/job.py +0 -0
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/tb_cli_modules/pipe.py +0 -0
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/tb_cli_modules/regions.py +0 -0
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/tb_cli_modules/tag.py +0 -0
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/tb_cli_modules/telemetry.py +0 -0
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/tb_cli_modules/test.py +0 -0
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/tb_cli_modules/tinyunit/tinyunit.py +0 -0
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/tb_cli_modules/tinyunit/tinyunit_lib.py +0 -0
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/tb_cli_modules/workspace.py +0 -0
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/tb_cli_modules/workspace_members.py +0 -0
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/tornado_template.py +0 -0
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird.egg-info/SOURCES.txt +0 -0
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird.egg-info/dependency_links.txt +0 -0
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird.egg-info/entry_points.txt +0 -0
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird.egg-info/requires.txt +0 -0
- {tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird.egg-info/top_level.txt +0 -0
|
@@ -5,11 +5,14 @@ from decimal import Decimal
|
|
|
5
5
|
from typing import Callable, Dict, List, Optional, Tuple
|
|
6
6
|
|
|
7
7
|
datetime64_patterns = [
|
|
8
|
-
r"\d\d\d\d.\d\d.\d\d(T|\s)\d\d:\d\d:\d\d.\d\d\d",
|
|
9
|
-
r"\d\d.\d\d.\d\d\d\d.\d{1,2}:\d{1,2}:\d{1,2}.\d{1,3}",
|
|
8
|
+
re.compile(r"\d\d\d\d.\d\d.\d\d(T|\s)\d\d:\d\d:\d\d.\d\d\d"),
|
|
9
|
+
re.compile(r"\d\d.\d\d.\d\d\d\d.\d{1,2}:\d{1,2}:\d{1,2}.\d{1,3}"),
|
|
10
10
|
]
|
|
11
11
|
|
|
12
|
-
datetime_patterns = [
|
|
12
|
+
datetime_patterns = [
|
|
13
|
+
re.compile(r"\d\d\d\d.\d\d.\d\d(T|\s)\d\d:\d\d:\d\d"),
|
|
14
|
+
re.compile(r"\d\d.\d\d.\d\d\d\d.\d{1,2}:\d{1,2}:\d{1,2}"),
|
|
15
|
+
]
|
|
13
16
|
|
|
14
17
|
int_8_max = 2**7
|
|
15
18
|
int16_max = 2**15
|
|
@@ -23,13 +26,15 @@ uint32_max = 2**32
|
|
|
23
26
|
uint64_max = 2**64
|
|
24
27
|
uint128_max = 2**128
|
|
25
28
|
uint256_max = 2**256
|
|
26
|
-
intx_re = r"^[+-]?\d+$"
|
|
27
|
-
uintx_re = r"^\d+$"
|
|
29
|
+
intx_re = re.compile(r"^[+-]?\d+$")
|
|
30
|
+
uintx_re = re.compile(r"^\d+$")
|
|
28
31
|
float32_max = 2**23 # 23 bits is the fractional part of float 32 ieee754
|
|
29
32
|
float64_max = 2**52 # 51 bits is the fractional part of float 64 ieee754
|
|
30
33
|
|
|
31
|
-
|
|
32
|
-
|
|
34
|
+
date_pattern = re.compile(r"\d\d\d\d-\d\d-\d\d$")
|
|
35
|
+
|
|
36
|
+
datetime64_type_pattern = re.compile(r"^DateTime64(\([1-9](, ?'.+')?\))?$")
|
|
37
|
+
datetime_type_pattern = re.compile(r"^DateTime(\(('.+')?)?\)?$")
|
|
33
38
|
|
|
34
39
|
# List from https://github.com/tinybirdco/ClickHousePrivate/blob/153473d9c1c871974688a1d72dcff7a13fc2076c/src/DataTypes/Serializations/SerializationBool.cpp#L216
|
|
35
40
|
bool_allowed_values = {
|
|
@@ -71,7 +76,7 @@ def is_type_datetime64(type_to_check: str) -> bool:
|
|
|
71
76
|
>>> is_type_datetime64("datetime64")
|
|
72
77
|
False
|
|
73
78
|
"""
|
|
74
|
-
return
|
|
79
|
+
return datetime64_type_pattern.match(type_to_check) is not None
|
|
75
80
|
|
|
76
81
|
|
|
77
82
|
def is_type_datetime(type_to_check: str) -> bool:
|
|
@@ -87,7 +92,7 @@ def is_type_datetime(type_to_check: str) -> bool:
|
|
|
87
92
|
>>> is_type_datetime("datetime")
|
|
88
93
|
False
|
|
89
94
|
"""
|
|
90
|
-
return
|
|
95
|
+
return datetime_type_pattern.match(type_to_check) is not None
|
|
91
96
|
|
|
92
97
|
|
|
93
98
|
def string_test(x: str) -> bool:
|
|
@@ -95,63 +100,63 @@ def string_test(x: str) -> bool:
|
|
|
95
100
|
|
|
96
101
|
|
|
97
102
|
def date_test(x: str) -> bool:
|
|
98
|
-
return
|
|
103
|
+
return date_pattern.match(x) is not None
|
|
99
104
|
|
|
100
105
|
|
|
101
106
|
def datetime64_test(x: str) -> bool:
|
|
102
|
-
return any([
|
|
107
|
+
return any([p.match(x) for p in datetime64_patterns])
|
|
103
108
|
|
|
104
109
|
|
|
105
110
|
def datetime_test(x: str) -> bool:
|
|
106
|
-
return any([
|
|
111
|
+
return any([p.match(x) for p in datetime_patterns])
|
|
107
112
|
|
|
108
113
|
|
|
109
114
|
def int_8_test(x: str) -> bool:
|
|
110
|
-
return
|
|
115
|
+
return intx_re.match(x) is not None and -int_8_max <= int(x) < int_8_max
|
|
111
116
|
|
|
112
117
|
|
|
113
118
|
def int16_test(x: str) -> bool:
|
|
114
|
-
return
|
|
119
|
+
return intx_re.match(x) is not None and -int16_max <= int(x) < int16_max
|
|
115
120
|
|
|
116
121
|
|
|
117
122
|
def int32_test(x: str) -> bool:
|
|
118
|
-
return
|
|
123
|
+
return intx_re.match(x) is not None and -int32_max <= int(x) < int32_max
|
|
119
124
|
|
|
120
125
|
|
|
121
126
|
def int64_test(x: str) -> bool:
|
|
122
|
-
return
|
|
127
|
+
return intx_re.match(x) is not None and -int64_max <= int(x) < int64_max
|
|
123
128
|
|
|
124
129
|
|
|
125
130
|
def int128_test(x: str) -> bool:
|
|
126
|
-
return
|
|
131
|
+
return intx_re.match(x) is not None and -int128_max <= int(x) < int128_max
|
|
127
132
|
|
|
128
133
|
|
|
129
134
|
def int256_test(x: str) -> bool:
|
|
130
|
-
return
|
|
135
|
+
return intx_re.match(x) is not None and -int256_max <= int(x) < int256_max
|
|
131
136
|
|
|
132
137
|
|
|
133
138
|
def uint_8_test(x: str) -> bool:
|
|
134
|
-
return
|
|
139
|
+
return uintx_re.match(x) is not None and 0 <= int(x) < uint_8_max
|
|
135
140
|
|
|
136
141
|
|
|
137
142
|
def uint16_test(x: str) -> bool:
|
|
138
|
-
return
|
|
143
|
+
return uintx_re.match(x) is not None and 0 <= int(x) < uint16_max
|
|
139
144
|
|
|
140
145
|
|
|
141
146
|
def uint32_test(x: str) -> bool:
|
|
142
|
-
return
|
|
147
|
+
return uintx_re.match(x) is not None and 0 <= int(x) < uint32_max
|
|
143
148
|
|
|
144
149
|
|
|
145
150
|
def uint64_test(x: str) -> bool:
|
|
146
|
-
return
|
|
151
|
+
return uintx_re.match(x) is not None and 0 <= int(x) < uint64_max
|
|
147
152
|
|
|
148
153
|
|
|
149
154
|
def uint128_test(x: str) -> bool:
|
|
150
|
-
return
|
|
155
|
+
return intx_re.match(x) is not None and 0 <= int(x) < uint128_max
|
|
151
156
|
|
|
152
157
|
|
|
153
158
|
def uint256_test(x: str) -> bool:
|
|
154
|
-
return
|
|
159
|
+
return intx_re.match(x) is not None and 0 <= int(x) < uint256_max
|
|
155
160
|
|
|
156
161
|
|
|
157
162
|
def float_test(x: str) -> bool:
|
|
@@ -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.dev121'
|
|
8
|
+
__revision__ = '3609440'
|
|
@@ -1170,14 +1170,30 @@ class TinyB:
|
|
|
1170
1170
|
response = await self._req(f"/v0/connectors/snowflake/warehouses?{urlencode(params)}", method="POST", data="")
|
|
1171
1171
|
return response["warehouses"]
|
|
1172
1172
|
|
|
1173
|
-
async def
|
|
1174
|
-
|
|
1173
|
+
async def check_aws_credentials(self) -> bool:
|
|
1174
|
+
try:
|
|
1175
|
+
await self._req("/v0/integrations/s3/settings")
|
|
1176
|
+
return True
|
|
1177
|
+
except Exception:
|
|
1178
|
+
return False
|
|
1175
1179
|
|
|
1176
|
-
async def
|
|
1177
|
-
|
|
1180
|
+
async def get_trust_policy(self, service: str, external_id_seed: Optional[str] = None) -> Dict[str, Any]:
|
|
1181
|
+
params = {}
|
|
1182
|
+
if external_id_seed:
|
|
1183
|
+
params["external_id_seed"] = external_id_seed
|
|
1184
|
+
return await self._req(f"/v0/integrations/{service}/policies/trust-policy?{urlencode(params)}")
|
|
1178
1185
|
|
|
1179
|
-
async def
|
|
1180
|
-
|
|
1186
|
+
async def get_access_write_policy(self, service: str, bucket: Optional[str] = None) -> Dict[str, Any]:
|
|
1187
|
+
params = {}
|
|
1188
|
+
if bucket:
|
|
1189
|
+
params["bucket"] = bucket
|
|
1190
|
+
return await self._req(f"/v0/integrations/{service}/policies/write-access-policy?{urlencode(params)}")
|
|
1191
|
+
|
|
1192
|
+
async def get_access_read_policy(self, service: str, bucket: Optional[str] = None) -> Dict[str, Any]:
|
|
1193
|
+
params = {}
|
|
1194
|
+
if bucket:
|
|
1195
|
+
params["bucket"] = bucket
|
|
1196
|
+
return await self._req(f"/v0/integrations/{service}/policies/read-access-policy?{urlencode(params)}")
|
|
1181
1197
|
|
|
1182
1198
|
async def sql_get_format(self, sql: str, with_clickhouse_format: bool = False) -> str:
|
|
1183
1199
|
try:
|
|
@@ -1758,6 +1758,7 @@ async def run_aws_iamrole_connection_flow(
|
|
|
1758
1758
|
client: TinyB,
|
|
1759
1759
|
service: str,
|
|
1760
1760
|
environment: str,
|
|
1761
|
+
connection_name: str,
|
|
1761
1762
|
) -> Tuple[str, str, str]:
|
|
1762
1763
|
if service == DataConnectorType.AMAZON_DYNAMODB:
|
|
1763
1764
|
raise NotImplementedError("DynamoDB is not supported")
|
|
@@ -1771,8 +1772,9 @@ async def run_aws_iamrole_connection_flow(
|
|
|
1771
1772
|
region = click.prompt("🌐 Region (the region where the bucket is located, e.g. 'us-east-1')", prompt_suffix="\n> ")
|
|
1772
1773
|
validate_string_connector_param("Region", region)
|
|
1773
1774
|
|
|
1774
|
-
access_policy, trust_policy, _ = await get_aws_iamrole_policies(
|
|
1775
|
-
|
|
1775
|
+
access_policy, trust_policy, _ = await get_aws_iamrole_policies(
|
|
1776
|
+
client, service=service, policy="read", bucket=bucket_name, external_id_seed=connection_name
|
|
1777
|
+
)
|
|
1776
1778
|
|
|
1777
1779
|
click.echo(FeedbackManager.prompt_s3_iamrole_connection_login_aws())
|
|
1778
1780
|
click.echo(FeedbackManager.click_enter_to_continue())
|
|
@@ -1834,8 +1836,11 @@ async def production_aws_iamrole_only(
|
|
|
1834
1836
|
region: str,
|
|
1835
1837
|
bucket_name: str,
|
|
1836
1838
|
environment: str,
|
|
1839
|
+
connection_name: str,
|
|
1837
1840
|
) -> Tuple[str, str, str]:
|
|
1838
|
-
_, trust_policy, external_id = await get_aws_iamrole_policies(
|
|
1841
|
+
_, trust_policy, external_id = await get_aws_iamrole_policies(
|
|
1842
|
+
prod_client, service=service, policy="read", bucket=bucket_name, external_id_seed=connection_name
|
|
1843
|
+
)
|
|
1839
1844
|
|
|
1840
1845
|
trust_policy_copied = True
|
|
1841
1846
|
try:
|
|
@@ -1868,15 +1873,21 @@ async def production_aws_iamrole_only(
|
|
|
1868
1873
|
return role_arn, region, external_id
|
|
1869
1874
|
|
|
1870
1875
|
|
|
1871
|
-
async def get_aws_iamrole_policies(
|
|
1876
|
+
async def get_aws_iamrole_policies(
|
|
1877
|
+
client: TinyB,
|
|
1878
|
+
service: str,
|
|
1879
|
+
policy: str = "write",
|
|
1880
|
+
bucket: Optional[str] = None,
|
|
1881
|
+
external_id_seed: Optional[str] = None,
|
|
1882
|
+
):
|
|
1872
1883
|
access_policy: Dict[str, Any] = {}
|
|
1873
1884
|
if service == DataConnectorType.AMAZON_S3_IAMROLE:
|
|
1874
1885
|
service = DataConnectorType.AMAZON_S3
|
|
1875
1886
|
try:
|
|
1876
1887
|
if policy == "write":
|
|
1877
|
-
access_policy = await client.get_access_write_policy(service)
|
|
1888
|
+
access_policy = await client.get_access_write_policy(service, bucket)
|
|
1878
1889
|
elif policy == "read":
|
|
1879
|
-
access_policy = await client.get_access_read_policy(service)
|
|
1890
|
+
access_policy = await client.get_access_read_policy(service, bucket)
|
|
1880
1891
|
else:
|
|
1881
1892
|
raise Exception(f"Access policy {policy} not supported. Choose from 'read' or 'write'")
|
|
1882
1893
|
if not len(access_policy) > 0:
|
|
@@ -1886,7 +1897,7 @@ async def get_aws_iamrole_policies(client: TinyB, service: str, policy: str = "w
|
|
|
1886
1897
|
|
|
1887
1898
|
trust_policy: Dict[str, Any] = {}
|
|
1888
1899
|
try:
|
|
1889
|
-
trust_policy = await client.get_trust_policy(service)
|
|
1900
|
+
trust_policy = await client.get_trust_policy(service, external_id_seed)
|
|
1890
1901
|
if not len(trust_policy) > 0:
|
|
1891
1902
|
raise Exception(f"{service.upper()} Integration not supported in this region")
|
|
1892
1903
|
except Exception as e:
|
|
@@ -2187,30 +2198,6 @@ async def get_user_token(config: CLIConfig, user_token: Optional[str] = None) ->
|
|
|
2187
2198
|
return user_token
|
|
2188
2199
|
|
|
2189
2200
|
|
|
2190
|
-
def get_ui_url(api_host: str) -> str:
|
|
2191
|
-
"""Transforms API URLs into their corresponding UI URLs.
|
|
2192
|
-
Examples:
|
|
2193
|
-
>>> get_ui_url("http://localhost:8000")
|
|
2194
|
-
'https://cloud.tinybird.co/local/8000'
|
|
2195
|
-
>>> get_ui_url("https://api.europe-west2.gcp.tinybird.co")
|
|
2196
|
-
'https://cloud.tinybird.co/gcp/europe-west2'
|
|
2197
|
-
>>> get_ui_url("https://other-domain.com")
|
|
2198
|
-
'https://other-domain.com'
|
|
2199
|
-
"""
|
|
2200
|
-
if "//localhost" in api_host:
|
|
2201
|
-
port = api_host.split(":")[-1] or "80"
|
|
2202
|
-
return f"https://cloud.tinybird.co/local/{port}"
|
|
2203
|
-
|
|
2204
|
-
if api_host.endswith("tinybird.co") and "api." in api_host:
|
|
2205
|
-
parts = api_host.split(".")
|
|
2206
|
-
if len(parts) >= 4:
|
|
2207
|
-
region = parts[1] or "europe-west2"
|
|
2208
|
-
cloud = parts[2] or "gcp"
|
|
2209
|
-
return f"https://cloud.tinybird.co/{cloud}/{region}"
|
|
2210
|
-
|
|
2211
|
-
return api_host
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
2201
|
async def ask_for_organization(
|
|
2215
2202
|
organizations: Optional[List[Dict[str, Any]]],
|
|
2216
2203
|
organization_id: Optional[str] = None,
|
|
@@ -151,6 +151,15 @@ async def connection_create_s3(ctx: Context) -> None:
|
|
|
151
151
|
obj: Dict[str, Any] = ctx.ensure_object(dict)
|
|
152
152
|
client: TinyB = obj["client"]
|
|
153
153
|
|
|
154
|
+
if obj["env"] == "local" and not await client.check_aws_credentials():
|
|
155
|
+
click.echo(
|
|
156
|
+
FeedbackManager.error(
|
|
157
|
+
message="No AWS credentials found. Please run `tb local restart --use-aws-creds` to pass your credentials. "
|
|
158
|
+
"Read more about this in https://www.tinybird.co/docs/forward/get-data-in/connectors/s3#local-environment"
|
|
159
|
+
)
|
|
160
|
+
)
|
|
161
|
+
return
|
|
162
|
+
|
|
154
163
|
service = DataConnectorType.AMAZON_S3
|
|
155
164
|
click.echo(FeedbackManager.prompt_s3_connection_header())
|
|
156
165
|
connection_name = get_s3_connection_name(project.folder)
|
|
@@ -158,6 +167,7 @@ async def connection_create_s3(ctx: Context) -> None:
|
|
|
158
167
|
client,
|
|
159
168
|
service=service,
|
|
160
169
|
environment=obj["env"],
|
|
170
|
+
connection_name=connection_name,
|
|
161
171
|
)
|
|
162
172
|
unique_suffix = uuid.uuid4().hex[:8] # Use first 8 chars of a UUID for brevity
|
|
163
173
|
secret_name = f"s3_role_arn_{connection_name}_{unique_suffix}"
|
|
@@ -179,7 +189,12 @@ async def connection_create_s3(ctx: Context) -> None:
|
|
|
179
189
|
staging=False,
|
|
180
190
|
)
|
|
181
191
|
prod_role_arn, _, _ = await production_aws_iamrole_only(
|
|
182
|
-
prod_client,
|
|
192
|
+
prod_client,
|
|
193
|
+
service=service,
|
|
194
|
+
region=region,
|
|
195
|
+
bucket_name=bucket_name,
|
|
196
|
+
environment="cloud",
|
|
197
|
+
connection_name=connection_name,
|
|
183
198
|
)
|
|
184
199
|
await prod_client.create_secret(name=secret_name, value=prod_role_arn)
|
|
185
200
|
|
|
@@ -810,6 +810,31 @@ def _parse_table_structure(schema: str) -> List[Dict[str, Any]]:
|
|
|
810
810
|
detected_type = parse_expr(
|
|
811
811
|
[NULL, NOTNULL, DEFAULT, MATERIALIZED, ALIAS, CODEC, TTL, JSONPATH, COMMA], "TYPE"
|
|
812
812
|
)
|
|
813
|
+
|
|
814
|
+
# Boolean type is supported in ClickHouse but its behavior is strange and will lead to unexpected results.
|
|
815
|
+
# Better to use Bool or UInt8 instead. An example:
|
|
816
|
+
#
|
|
817
|
+
# SELECT
|
|
818
|
+
# CAST(true, 'Boolean') AS bool,
|
|
819
|
+
# toTypeName(bool)
|
|
820
|
+
#
|
|
821
|
+
# ┌─bool─┬─toTypeName(bool)─┐
|
|
822
|
+
# │ true │ Bool │
|
|
823
|
+
# └──────┴──────────────────┘
|
|
824
|
+
if "boolean" in detected_type.lower():
|
|
825
|
+
raise SchemaSyntaxError(
|
|
826
|
+
message="Boolean type is not supported",
|
|
827
|
+
hint="Hint: use Bool or UInt8 instead",
|
|
828
|
+
lineno=line,
|
|
829
|
+
pos=pos,
|
|
830
|
+
)
|
|
831
|
+
if "datetime64" in detected_type.lower() and "datetime64(" not in detected_type.lower():
|
|
832
|
+
raise SchemaSyntaxError(
|
|
833
|
+
message="DateTime64 type without precision is not supported",
|
|
834
|
+
hint="Hint: use DateTime64(3) instead",
|
|
835
|
+
lineno=line,
|
|
836
|
+
pos=pos,
|
|
837
|
+
)
|
|
813
838
|
try:
|
|
814
839
|
# Imported in the body to be compatible with the CLI
|
|
815
840
|
from chtoolset.query import check_compatible_types
|
|
@@ -441,6 +441,7 @@ class FeedbackManager:
|
|
|
441
441
|
error_tag_generic = error_message("There was an issue updating tags. {error}")
|
|
442
442
|
error_tag_not_found = error_message("Tag {tag_name} not found.")
|
|
443
443
|
error_build_failed = error_message("Build failed")
|
|
444
|
+
error_request_failed = error_message("Request failed with status code {status_code}, please try again later.")
|
|
444
445
|
|
|
445
446
|
info_incl_relative_path = info_message("** Relative path {path} does not exist, skipping.")
|
|
446
447
|
info_ignoring_incl_file = info_message(
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import requests
|
|
2
2
|
|
|
3
|
+
from tinybird.tb.modules.feedback_manager import FeedbackManager
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class LLMException(Exception):
|
|
7
|
+
pass
|
|
8
|
+
|
|
3
9
|
|
|
4
10
|
class LLM:
|
|
5
11
|
def __init__(
|
|
@@ -29,4 +35,8 @@ class LLM:
|
|
|
29
35
|
headers={"Authorization": f"Bearer {self.user_token}"},
|
|
30
36
|
data=data,
|
|
31
37
|
)
|
|
38
|
+
|
|
39
|
+
if not response.ok:
|
|
40
|
+
raise LLMException(FeedbackManager.error_request_failed(status_code=response.status_code))
|
|
41
|
+
|
|
32
42
|
return response.json().get("result", "")
|
|
@@ -207,7 +207,11 @@ def update_cli() -> None:
|
|
|
207
207
|
text=True,
|
|
208
208
|
)
|
|
209
209
|
except FileNotFoundError:
|
|
210
|
-
raise CLIException(
|
|
210
|
+
raise CLIException(
|
|
211
|
+
FeedbackManager.error(
|
|
212
|
+
message="Cannot find required tool: uv. Reinstall using: curl https://tinybird.co | sh"
|
|
213
|
+
)
|
|
214
|
+
)
|
|
211
215
|
|
|
212
216
|
stdout, stderr = process.communicate()
|
|
213
217
|
if "Nothing to upgrade" not in stdout + stderr:
|
|
@@ -3,8 +3,9 @@ import webbrowser
|
|
|
3
3
|
import click
|
|
4
4
|
from click import Context
|
|
5
5
|
|
|
6
|
+
from tinybird.tb.config import get_display_cloud_host
|
|
6
7
|
from tinybird.tb.modules.cli import cli
|
|
7
|
-
from tinybird.tb.modules.common import coro
|
|
8
|
+
from tinybird.tb.modules.common import coro
|
|
8
9
|
from tinybird.tb.modules.exceptions import CLIException
|
|
9
10
|
from tinybird.tb.modules.feedback_manager import FeedbackManager
|
|
10
11
|
from tinybird.tb.modules.local_common import get_build_workspace_name
|
|
@@ -24,7 +25,7 @@ async def open(ctx: Context, workspace: str):
|
|
|
24
25
|
client = ctx.ensure_object(dict)["client"]
|
|
25
26
|
env = ctx.ensure_object(dict)["env"]
|
|
26
27
|
|
|
27
|
-
url_host =
|
|
28
|
+
url_host = get_display_cloud_host(client.host)
|
|
28
29
|
|
|
29
30
|
if not workspace:
|
|
30
31
|
workspace = get_build_workspace_name(config.get("path")) if env == "build" else config.get("name")
|
|
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-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/tb/modules/datafile/build_common.py
RENAMED
|
File without changes
|
{tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/tb/modules/datafile/build_datasource.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/tb/modules/datafile/format_common.py
RENAMED
|
File without changes
|
{tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/tb/modules/datafile/format_datasource.py
RENAMED
|
File without changes
|
|
File without changes
|
{tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/tb/modules/datafile/parse_datasource.py
RENAMED
|
File without changes
|
|
File without changes
|
{tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/tb/modules/datafile/pipe_checker.py
RENAMED
|
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-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/tb/modules/tinyunit/tinyunit_lib.py
RENAMED
|
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-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/tb_cli_modules/tinyunit/tinyunit.py
RENAMED
|
File without changes
|
{tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/tb_cli_modules/tinyunit/tinyunit_lib.py
RENAMED
|
File without changes
|
|
File without changes
|
{tinybird-0.0.1.dev119 → tinybird-0.0.1.dev121}/tinybird/tb_cli_modules/workspace_members.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|