tinybird 0.0.1.dev230__py3-none-any.whl → 0.0.1.dev232__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/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.dev230'
8
- __revision__ = '45e2fd2'
7
+ __version__ = '0.0.1.dev232'
8
+ __revision__ = 'd58086c'
@@ -398,6 +398,15 @@ async def connection_create_kafka(ctx: Context) -> Tuple[str, str, str, str, str
398
398
  except Exception as e:
399
399
  raise CLIConnectionException(FeedbackManager.error(message=str(e)))
400
400
 
401
+ security_protocol_options = ["SASL_SSL", "PLAINTEXT"]
402
+ security_protocol = click.prompt(
403
+ FeedbackManager.highlight(message="? Security Protocol (SASL_SSL, PLAINTEXT) [SASL_SSL]"),
404
+ type=click.Choice(security_protocol_options),
405
+ show_default=False,
406
+ show_choices=False,
407
+ default="SASL_SSL",
408
+ )
409
+
401
410
  sasl_mechanism_options = ["PLAIN", "SCRAM-SHA-256", "SCRAM-SHA-512"]
402
411
  sasl_mechanism = click.prompt(
403
412
  FeedbackManager.highlight(message="? SASL Mechanism (PLAIN, SCRAM-SHA-256, SCRAM-SHA-512) [PLAIN]"),
@@ -455,7 +464,7 @@ async def connection_create_kafka(ctx: Context) -> Tuple[str, str, str, str, str
455
464
  )
456
465
  validate_kafka_auto_offset_reset(auto_offset_reset)
457
466
  click.echo(FeedbackManager.gray(message="» Validating connection..."))
458
- security_protocol = "SASL_SSL"
467
+
459
468
  topics = list_kafka_topics(bootstrap_servers, key, secret, security_protocol, sasl_mechanism)
460
469
 
461
470
  if topics is None:
@@ -470,11 +479,11 @@ async def connection_create_kafka(ctx: Context) -> Tuple[str, str, str, str, str
470
479
  tb_secret_key=tb_secret_key,
471
480
  secret=secret,
472
481
  tb_secret_secret=tb_secret_secret,
473
- security_protocol="SASL_SSL",
482
+ security_protocol=security_protocol,
474
483
  sasl_mechanism=sasl_mechanism,
475
484
  folder=project.folder,
476
485
  )
477
- click.echo(FeedbackManager.info(message=f"/connections/{name}.connection"))
486
+ click.echo(FeedbackManager.info_file_created(file=f"connections/{name}.connection"))
478
487
  click.echo(FeedbackManager.success(message="✓ Connection created!"))
479
488
  return (
480
489
  name,
@@ -788,7 +788,6 @@ async def datasource_create(
788
788
  connection_required = datasource_type in ("kafka", "s3", "gcs")
789
789
 
790
790
  if connection_required:
791
- click.echo(FeedbackManager.gray(message="\n» Creating .connection file..."))
792
791
 
793
792
  def get_connection_files():
794
793
  connection_files = []
@@ -801,6 +800,8 @@ async def datasource_create(
801
800
  return connection_files
802
801
 
803
802
  connection_files = get_connection_files()
803
+
804
+ click.echo(FeedbackManager.gray(message="\n» Selecting connection..."))
804
805
  connection_name = ""
805
806
  topics: List[str] = []
806
807
  if len(connection_files) == 0:
@@ -849,7 +850,7 @@ async def datasource_create(
849
850
  folder=project.folder,
850
851
  )
851
852
  if datasource_type != "kafka":
852
- click.echo(FeedbackManager.info(message=f"/connections/{connection_name}.connection"))
853
+ click.echo(FeedbackManager.info_file_created(file=f"connections/{connection_name}.connection"))
853
854
  click.echo(FeedbackManager.success(message="✓ .connection created!"))
854
855
  connection_files = get_connection_files()
855
856
  else:
@@ -857,9 +858,29 @@ async def datasource_create(
857
858
  return
858
859
 
859
860
  if not connection_file:
860
- connection_file = connection_files[0]
861
- connection_path = Path(connection_file)
862
- connection = connection_path.stem
861
+ if len(connection_files) > 1:
862
+ click.echo(
863
+ FeedbackManager.highlight(
864
+ message=f"? Multiple {datasource_types[datasource_type][0]} connections found. Please select one:"
865
+ )
866
+ )
867
+ connection_index = -1
868
+ while connection_index == -1:
869
+ for index, conn_file in enumerate(connection_files):
870
+ conn_path = Path(conn_file)
871
+ click.echo(f" [{index + 1}] {conn_path.stem}")
872
+ connection_index = click.prompt("\nSelect option", default=1)
873
+ try:
874
+ connection_file = connection_files[int(connection_index) - 1]
875
+ connection_path = Path(connection_file)
876
+ connection = connection_path.stem
877
+ except Exception:
878
+ connection_index = -1
879
+ else:
880
+ connection_file = connection_files[0]
881
+ connection_path = Path(connection_file)
882
+ connection = connection_path.stem
883
+ click.echo(FeedbackManager.info(message=f"Using connection: {connection}"))
863
884
 
864
885
  click.echo(FeedbackManager.gray(message="\n» Creating .datasource file..."))
865
886
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: tinybird
3
- Version: 0.0.1.dev230
3
+ Version: 0.0.1.dev232
4
4
  Summary: Tinybird Command Line Tool
5
5
  Home-page: https://www.tinybird.co/docs/forward/commands
6
6
  Author: Tinybird
@@ -17,7 +17,7 @@ tinybird/datafile/exceptions.py,sha256=8rw2umdZjtby85QbuRKFO5ETz_eRHwUY5l7eHsy1w
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=74d7saA-6Srgl_5lAe0EHS41KrA0HpZjHHjG-kLMPA8,247
20
+ tinybird/tb/__cli__.py,sha256=0UBC5RBj5wMDEwCGOSS0ufzt8GHPKZxxes7QxuvmHeo,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
@@ -27,10 +27,10 @@ tinybird/tb/modules/cicd.py,sha256=H22MaMsqAeDv-OmeHFOlUOAmfNzEzTFaEV9TQ0g4ehs,7
27
27
  tinybird/tb/modules/cli.py,sha256=I1G7q3-hjYZuwq1GQoZd5_2i8btl33s6ms8I0yF5XDc,16332
28
28
  tinybird/tb/modules/common.py,sha256=F6oaoFZ3aBxEMjiDKYhthsEIUqSFPkcdlMJ7h7A49Ac,83114
29
29
  tinybird/tb/modules/config.py,sha256=VnzYVUo4q1RBEEMMce4_OCrKp4erhgkRPHElydVlKj0,11488
30
- tinybird/tb/modules/connection.py,sha256=KHZgu7sK1C4UBgwkKAMeNdKB0RrTls0LG3YoaUfeAfw,17648
30
+ tinybird/tb/modules/connection.py,sha256=2W4fh7C5pKJryFnC2NUUIktF4xBs1ILqmHnzuEp3ftQ,17970
31
31
  tinybird/tb/modules/copy.py,sha256=zHN1d5NA-MFsgbk2kKJq2P9qA8dNOnIsIa60QpVnSwc,4458
32
32
  tinybird/tb/modules/create.py,sha256=56_x6nwj_oAr72X7AvdxXAuXCDKGJp-w1dP6E2XdxqU,23376
33
- tinybird/tb/modules/datasource.py,sha256=UiQXDkSEmQIPj4NcUD_I4bAJe9IGVmlVW07yGgSu6kY,40941
33
+ tinybird/tb/modules/datasource.py,sha256=9ncWkDVJ3dMc15q2GME40gHZf8REymOIjNn76m4CUNo,42028
34
34
  tinybird/tb/modules/deployment.py,sha256=ByXIgEvwxB49pJEKKj0EJIfORWyflCYr04k8961nBkA,28391
35
35
  tinybird/tb/modules/deprecations.py,sha256=rrszC1f_JJeJ8mUxGoCxckQTJFBCR8wREf4XXXN-PRc,4507
36
36
  tinybird/tb/modules/dev_server.py,sha256=57FCKuWpErwYUYgHspYDkLWEm9F4pbvVOtMrFXX1fVU,10129
@@ -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.dev230.dist-info/METADATA,sha256=v4gUOshqYC8ekjqDD-6Vii3ijifIHdWAVrDJCPi5Br0,1682
86
- tinybird-0.0.1.dev230.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
87
- tinybird-0.0.1.dev230.dist-info/entry_points.txt,sha256=LwdHU6TfKx4Qs7BqqtaczEZbImgU7Abe9Lp920zb_fo,43
88
- tinybird-0.0.1.dev230.dist-info/top_level.txt,sha256=VqqqEmkAy7UNaD8-V51FCoMMWXjLUlR0IstvK7tJYVY,54
89
- tinybird-0.0.1.dev230.dist-info/RECORD,,
85
+ tinybird-0.0.1.dev232.dist-info/METADATA,sha256=tYkjFtgiHT1P3mBLaOYdj53Z8RrUr_Bn5kp_x6u7mWA,1682
86
+ tinybird-0.0.1.dev232.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
87
+ tinybird-0.0.1.dev232.dist-info/entry_points.txt,sha256=LwdHU6TfKx4Qs7BqqtaczEZbImgU7Abe9Lp920zb_fo,43
88
+ tinybird-0.0.1.dev232.dist-info/top_level.txt,sha256=VqqqEmkAy7UNaD8-V51FCoMMWXjLUlR0IstvK7tJYVY,54
89
+ tinybird-0.0.1.dev232.dist-info/RECORD,,