tinybird 0.0.1.dev88__py3-none-any.whl → 0.0.1.dev89__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.

@@ -761,6 +761,16 @@ def engine_local_to_replicated(engine: str, database: str, name: str) -> str:
761
761
  return re.sub(r"(.*)MergeTree(\(([^\)]*)\))*(.*)", _replace, engine.strip())
762
762
 
763
763
 
764
+ def ttl_from_engine(engine: str) -> Optional[str]:
765
+ ttl_array = engine.split(" TTL ")
766
+ if len(ttl_array) <= 1:
767
+ return None
768
+ settings_array = engine.split(" SETTINGS ")
769
+ settings = " SETTINGS " + settings_array[1] if len(settings_array) > 1 else None
770
+ ttl = ttl_array[1][: -(len(settings))] if settings else ttl_array[1]
771
+ return ttl
772
+
773
+
764
774
  def ttl_condition_from_engine_full(engine_full: Optional[str]) -> Optional[str]:
765
775
  """
766
776
  >>> ttl_condition_from_engine_full(None)
@@ -808,13 +818,9 @@ def ttl_condition_from_engine_full(engine_full: Optional[str]) -> Optional[str]:
808
818
  return None
809
819
 
810
820
  try:
811
- ttl_array = engine_full.split(" TTL ")
812
- if len(ttl_array) <= 1:
821
+ ttl = ttl_from_engine(engine_full)
822
+ if not ttl:
813
823
  return None
814
- settings_array = engine_full.split(" SETTINGS ")
815
- settings = " SETTINGS " + settings_array[1] if len(settings_array) > 1 else None
816
- ttl = ttl_array[1][: -(len(settings))] if settings else ttl_array[1]
817
-
818
824
  groups = SIMPLE_TTL_DEFINITION.search(ttl)
819
825
  if not groups:
820
826
  return None
tinybird/config.py CHANGED
@@ -30,6 +30,7 @@ LEGACY_HOSTS = {
30
30
  "https://api.us-west-2.aws.tinybird.co": "https://app.tinybird.co/aws/us-west-2",
31
31
  "https://api.eu-central-1.aws.tinybird.co": "https://app.tinybird.co/aws/eu-central-1",
32
32
  "https://api.eu-west-1.aws.tinybird.co": "https://app.tinybird.co/aws/eu-west-1",
33
+ "https://api.europe-west2.gcp.tinybird.co": "https://cloud.tinybird.co/gcp/europe-west2",
33
34
  "https://api.ap-east.aws.tinybird.co": "https://app.tinybird.co/aws/ap-east",
34
35
  "https://api.wadus1.gcp.tinybird.co": "https://app.wadus.tinybird.co/gcp/wadus1",
35
36
  "https://api.wadus2.gcp.tinybird.co": "https://app.wadus.tinybird.co/gcp/wadus2",
@@ -48,6 +49,7 @@ LEGACY_HOSTS = {
48
49
  "https://ui.us-east.aws.tinybird.co": "https://app.tinybird.co/aws/us-east-1",
49
50
  "https://ui.us-west-2.aws.tinybird.co": "https://app.tinybird.co/aws/us-west-2",
50
51
  "https://ui.eu-central-1.aws.tinybird.co": "https://app.tinybird.co/aws/eu-central-1",
52
+ "https://ui.europe-west2.gcp.tinybird.co": "https://cloud.tinybird.co/gcp/europe-west2",
51
53
  "https://ui.ap-east.aws.tinybird.co": "https://app.tinybird.co/aws/ap-east",
52
54
  "https://ui.split.tinybird.co": "https://app.tinybird.co/aws/split-us-east",
53
55
  "https://ui.split.us-west-2.aws.tinybird.co": "https://app.tinybird.co/aws/split-us-west-2",
tinybird/context.py CHANGED
@@ -7,7 +7,7 @@ if TYPE_CHECKING:
7
7
 
8
8
  workspace_id: ContextVar[str] = ContextVar("workspace_id")
9
9
  workspace: ContextVar["User"] = ContextVar("workspace")
10
- datasource_id: ContextVar[str] = ContextVar("datasource_id")
10
+ table_id: ContextVar[str] = ContextVar("table_id")
11
11
  hfi_frequency: ContextVar[float] = ContextVar("hfi_frequency")
12
12
  hfi_frequency_gatherer: ContextVar[float] = ContextVar("hfi_frequency_gatherer")
13
13
  use_gatherer: ContextVar[bool] = ContextVar("use_gatherer")
tinybird/tb/__cli__.py CHANGED
@@ -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.dev88'
8
- __revision__ = 'fd53f21'
7
+ __version__ = '0.0.1.dev89'
8
+ __revision__ = '6153af6'
@@ -191,17 +191,19 @@ def deployment_group() -> None:
191
191
  help="Validate the deployment before creating it. Disabled by default.",
192
192
  )
193
193
  @click.option(
194
- "--allow-remove-datasources/--no-allow-remove-datasources",
194
+ "--allow-destructive-operations/--no-allow-destructive-operations",
195
195
  is_flag=True,
196
196
  default=False,
197
197
  help="Allow removing datasources. Disabled by default.",
198
198
  )
199
199
  @click.pass_context
200
- def deployment_create(ctx: click.Context, wait: bool, auto: bool, check: bool, allow_remove_datasources: bool) -> None:
200
+ def deployment_create(
201
+ ctx: click.Context, wait: bool, auto: bool, check: bool, allow_destructive_operations: bool
202
+ ) -> None:
201
203
  """
202
204
  Validate and deploy the project server side.
203
205
  """
204
- create_deployment(ctx, wait, auto, check, allow_remove_datasources)
206
+ create_deployment(ctx, wait, auto, check, allow_destructive_operations)
205
207
 
206
208
 
207
209
  @deployment_group.command(name="ls")
@@ -298,17 +300,17 @@ def deployment_rollback(ctx: click.Context, wait: bool) -> None:
298
300
  help="Validate the deployment before creating it. Disabled by default.",
299
301
  )
300
302
  @click.option(
301
- "--allow-remove-datasources/--no-allow-remove-datasources",
303
+ "--allow-destructive-operations/--no-allow-destructive-operations",
302
304
  is_flag=True,
303
305
  default=False,
304
306
  help="Allow removing datasources. Disabled by default.",
305
307
  )
306
308
  @click.pass_context
307
- def deploy(ctx: click.Context, wait: bool, auto: bool, check: bool, allow_remove_datasources: bool) -> None:
309
+ def deploy(ctx: click.Context, wait: bool, auto: bool, check: bool, allow_destructive_operations: bool) -> None:
308
310
  """
309
311
  Deploy the project.
310
312
  """
311
- create_deployment(ctx, wait, auto, check, allow_remove_datasources)
313
+ create_deployment(ctx, wait, auto, check, allow_destructive_operations)
312
314
 
313
315
 
314
316
  def create_deployment(
@@ -316,7 +318,7 @@ def create_deployment(
316
318
  wait: bool,
317
319
  auto: bool,
318
320
  check: Optional[bool] = None,
319
- allow_remove_datasources: Optional[bool] = None,
321
+ allow_destructive_operations: Optional[bool] = None,
320
322
  ) -> None:
321
323
  # TODO: This code is duplicated in build_server.py
322
324
  # Should be refactored to be shared
@@ -350,8 +352,8 @@ def create_deployment(
350
352
  if check:
351
353
  click.echo(FeedbackManager.highlight(message="\n» Validating deployment...\n"))
352
354
  params["check"] = "true"
353
- if allow_remove_datasources:
354
- params["allow_remove_datasources"] = "true"
355
+ if allow_destructive_operations:
356
+ params["allow_destructive_operations"] = "true"
355
357
  r = requests.post(TINYBIRD_API_URL, files=files, headers=HEADERS, params=params)
356
358
  result = r.json()
357
359
  logging.debug(json.dumps(result, indent=2))
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: tinybird
3
- Version: 0.0.1.dev88
3
+ Version: 0.0.1.dev89
4
4
  Summary: Tinybird Command Line Tool
5
5
  Home-page: https://www.tinybird.co/docs/cli/introduction.html
6
6
  Author: Tinybird
@@ -1,8 +1,8 @@
1
1
  tinybird/__cli__.py,sha256=esPl5QDTzuQgHe5FuxWLm-fURFigGGwjnYLh9GuWUw4,232
2
2
  tinybird/client.py,sha256=Ng4HQHum6ezf7nRZ61PbEOhYvEEPadmXKDYu2SGaL0c,53393
3
- tinybird/config.py,sha256=GQSc8v7mT79pmMANvp758i8mGVsTPd1VjJzjJmFi0LM,5885
3
+ tinybird/config.py,sha256=5UP_UZ2Qtlm5aOH5W7SbtN8r7X-8u3-r853joKqU5zs,6072
4
4
  tinybird/connectors.py,sha256=7Gjms7b5MAaBFGi3xytsJurCylprONpFcYrzp4Fw2Rc,15241
5
- tinybird/context.py,sha256=VaMhyHruH-uyMypPDfxtuo4scS18b7rxCCdeUVm6ysg,1301
5
+ tinybird/context.py,sha256=FfqYfrGX_I7PKGTQo93utaKPDNVYWelg4Hsp3evX5wM,1291
6
6
  tinybird/datatypes.py,sha256=XNypumfqNjsvLJ5iNXnbVHRvAJe0aQwI3lS6Cxox-e0,10979
7
7
  tinybird/feedback_manager.py,sha256=YSjtFDJvc8y66j2J0iIkb3SVzDdYAJbzFL-JPQ26pak,68761
8
8
  tinybird/git_settings.py,sha256=Sw_8rGmribEFJ4Z_6idrVytxpFYk7ez8ei0qHULzs3E,3934
@@ -14,8 +14,8 @@ tinybird/sql_toolset.py,sha256=32SNvxRFKQYWTvYPMJ_u3ukcd1hKZyEqx8T2cv2412w,14697
14
14
  tinybird/syncasync.py,sha256=IPnOx6lMbf9SNddN1eBtssg8vCLHMt76SuZ6YNYm-Yk,27761
15
15
  tinybird/tornado_template.py,sha256=jjNVDMnkYFWXflmT8KU_Ssbo5vR8KQq3EJMk5vYgXRw,41959
16
16
  tinybird/ch_utils/constants.py,sha256=aYvg2C_WxYWsnqPdZB1ZFoIr8ZY-XjUXYyHKE9Ansj0,3890
17
- tinybird/ch_utils/engine.py,sha256=AUAww-KjGOZg9h0IBlKA3FeacJYB4rOtqcTGJhFM-g8,40392
18
- tinybird/tb/__cli__.py,sha256=gO4_tED-nqmsmf_rs3JTBHu2MQsY0Dn0JvbUsi_2ZCE,251
17
+ tinybird/ch_utils/engine.py,sha256=BZuPM7MFS7vaEKK5tOMR2bwSAgJudPrJt27uVEwZmTY,40512
18
+ tinybird/tb/__cli__.py,sha256=xWmtpX_BrBWY-ALVqm-M8PCmUyEnwSYABEqNIkELu8M,251
19
19
  tinybird/tb/cli.py,sha256=qon0Lim-v5hHWWRW7TXaOoGo3p2kc5Xwgg3feI4mbMQ,998
20
20
  tinybird/tb/modules/auth.py,sha256=L1IatO2arRSzys3t8px8xVt8uPWUL5EVD0sFzAV_uVU,9022
21
21
  tinybird/tb/modules/build.py,sha256=-lRGBxKtuipmyl3pmiGcfp67fH1Ed-COfHAZKdgLIWo,10483
@@ -26,7 +26,7 @@ tinybird/tb/modules/config.py,sha256=BVZg-4f_R3vJTwCChXY2AXaH67SRk62xoP_IymquosI
26
26
  tinybird/tb/modules/copy.py,sha256=MAVqKip8_QhOYq99U_XuqSO6hCLJEh5sFtbhcXtI3SI,5802
27
27
  tinybird/tb/modules/create.py,sha256=KjotVfIQLfcPyQBykTHnPLn4ikrm6qqeMcbRE1d-6Jo,13280
28
28
  tinybird/tb/modules/datasource.py,sha256=dNCK9iCR2xPLfwqqwg2ixyE6NuoVEiJU2mBZBmOYrVY,16906
29
- tinybird/tb/modules/deployment.py,sha256=XAVt6a_vtH8sJ99Z9Ht1q5_ni7AFPRSeidfgfuJtqLw,17565
29
+ tinybird/tb/modules/deployment.py,sha256=oSRnQnz2Wkvp1y0yt_tVa9g0aCYyFxNAsUyxoZTIcpY,17615
30
30
  tinybird/tb/modules/endpoint.py,sha256=EhVoGAXsFz-83Fiwj1gI-I73iRRvL49d0W81un7hvPE,12080
31
31
  tinybird/tb/modules/exceptions.py,sha256=4A2sSjCEqKUMqpP3WI00zouCWW4uLaghXXLZBSw04mY,3363
32
32
  tinybird/tb/modules/feedback_manager.py,sha256=7nNiOx7OMebiheLED1r0d75SbuXCNxyBmF4e20rCBNc,69511
@@ -77,8 +77,8 @@ tinybird/tb_cli_modules/config.py,sha256=IsgdtFRnUrkY8-Zo32lmk6O7u3bHie1QCxLwgp4
77
77
  tinybird/tb_cli_modules/exceptions.py,sha256=pmucP4kTF4irIt7dXiG-FcnI-o3mvDusPmch1L8RCWk,3367
78
78
  tinybird/tb_cli_modules/regions.py,sha256=QjsL5H6Kg-qr0aYVLrvb1STeJ5Sx_sjvbOYO0LrEGMk,166
79
79
  tinybird/tb_cli_modules/telemetry.py,sha256=Hh2Io8ZPROSunbOLuMvuIFU4TqwWPmQTqal4WS09K1A,10449
80
- tinybird-0.0.1.dev88.dist-info/METADATA,sha256=D04ACuigyiZY-PtN_M1CKoBYBOUC33qeYNcb6pykA-E,2585
81
- tinybird-0.0.1.dev88.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
82
- tinybird-0.0.1.dev88.dist-info/entry_points.txt,sha256=LwdHU6TfKx4Qs7BqqtaczEZbImgU7Abe9Lp920zb_fo,43
83
- tinybird-0.0.1.dev88.dist-info/top_level.txt,sha256=VqqqEmkAy7UNaD8-V51FCoMMWXjLUlR0IstvK7tJYVY,54
84
- tinybird-0.0.1.dev88.dist-info/RECORD,,
80
+ tinybird-0.0.1.dev89.dist-info/METADATA,sha256=pKJ86pTylK2iqAqdOcWyaaApey6C8eiBM_NpLv-ZzWA,2585
81
+ tinybird-0.0.1.dev89.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
82
+ tinybird-0.0.1.dev89.dist-info/entry_points.txt,sha256=LwdHU6TfKx4Qs7BqqtaczEZbImgU7Abe9Lp920zb_fo,43
83
+ tinybird-0.0.1.dev89.dist-info/top_level.txt,sha256=VqqqEmkAy7UNaD8-V51FCoMMWXjLUlR0IstvK7tJYVY,54
84
+ tinybird-0.0.1.dev89.dist-info/RECORD,,