tinybird 0.0.1.dev143__tar.gz → 0.0.1.dev144__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.

Files changed (111) hide show
  1. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/PKG-INFO +1 -1
  2. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird/tb/__cli__.py +2 -2
  3. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird/tb/cli.py +0 -1
  4. tinybird-0.0.1.dev144/tinybird/tb/modules/deprecations.py +127 -0
  5. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird.egg-info/PKG-INFO +1 -1
  6. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird.egg-info/SOURCES.txt +0 -1
  7. tinybird-0.0.1.dev143/tinybird/tb/modules/deprecations.py +0 -20
  8. tinybird-0.0.1.dev143/tinybird/tb/modules/tag.py +0 -100
  9. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/setup.cfg +0 -0
  10. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird/__cli__.py +0 -0
  11. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird/ch_utils/constants.py +0 -0
  12. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird/ch_utils/engine.py +0 -0
  13. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird/check_pypi.py +0 -0
  14. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird/client.py +0 -0
  15. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird/config.py +0 -0
  16. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird/connectors.py +0 -0
  17. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird/context.py +0 -0
  18. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird/datafile.py +0 -0
  19. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird/datatypes.py +0 -0
  20. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird/feedback_manager.py +0 -0
  21. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird/git_settings.py +0 -0
  22. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird/prompts.py +0 -0
  23. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird/sql.py +0 -0
  24. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird/sql_template.py +0 -0
  25. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird/sql_template_fmt.py +0 -0
  26. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird/sql_toolset.py +0 -0
  27. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird/syncasync.py +0 -0
  28. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird/tb/check_pypi.py +0 -0
  29. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird/tb/client.py +0 -0
  30. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird/tb/config.py +0 -0
  31. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird/tb/modules/auth.py +0 -0
  32. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird/tb/modules/build.py +0 -0
  33. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird/tb/modules/cicd.py +0 -0
  34. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird/tb/modules/cli.py +0 -0
  35. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird/tb/modules/common.py +0 -0
  36. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird/tb/modules/config.py +0 -0
  37. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird/tb/modules/connection.py +0 -0
  38. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird/tb/modules/copy.py +0 -0
  39. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird/tb/modules/create.py +0 -0
  40. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird/tb/modules/datafile/build.py +0 -0
  41. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird/tb/modules/datafile/build_common.py +0 -0
  42. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird/tb/modules/datafile/build_datasource.py +0 -0
  43. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird/tb/modules/datafile/build_pipe.py +0 -0
  44. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird/tb/modules/datafile/common.py +0 -0
  45. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird/tb/modules/datafile/diff.py +0 -0
  46. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird/tb/modules/datafile/exceptions.py +0 -0
  47. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird/tb/modules/datafile/fixture.py +0 -0
  48. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird/tb/modules/datafile/format_common.py +0 -0
  49. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird/tb/modules/datafile/format_datasource.py +0 -0
  50. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird/tb/modules/datafile/format_pipe.py +0 -0
  51. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird/tb/modules/datafile/parse_datasource.py +0 -0
  52. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird/tb/modules/datafile/parse_pipe.py +0 -0
  53. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird/tb/modules/datafile/pipe_checker.py +0 -0
  54. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird/tb/modules/datafile/playground.py +0 -0
  55. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird/tb/modules/datafile/pull.py +0 -0
  56. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird/tb/modules/datasource.py +0 -0
  57. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird/tb/modules/deployment.py +0 -0
  58. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird/tb/modules/endpoint.py +0 -0
  59. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird/tb/modules/exceptions.py +0 -0
  60. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird/tb/modules/feedback_manager.py +0 -0
  61. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird/tb/modules/infra.py +0 -0
  62. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird/tb/modules/job.py +0 -0
  63. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird/tb/modules/llm.py +0 -0
  64. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird/tb/modules/llm_utils.py +0 -0
  65. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird/tb/modules/local.py +0 -0
  66. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird/tb/modules/local_common.py +0 -0
  67. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird/tb/modules/login.py +0 -0
  68. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird/tb/modules/logout.py +0 -0
  69. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird/tb/modules/materialization.py +0 -0
  70. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird/tb/modules/mock.py +0 -0
  71. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird/tb/modules/open.py +0 -0
  72. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird/tb/modules/pipe.py +0 -0
  73. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird/tb/modules/project.py +0 -0
  74. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird/tb/modules/regions.py +0 -0
  75. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird/tb/modules/secret.py +0 -0
  76. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird/tb/modules/shell.py +0 -0
  77. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird/tb/modules/table.py +0 -0
  78. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird/tb/modules/telemetry.py +0 -0
  79. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird/tb/modules/test.py +0 -0
  80. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird/tb/modules/tinyunit/tinyunit.py +0 -0
  81. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird/tb/modules/tinyunit/tinyunit_lib.py +0 -0
  82. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird/tb/modules/token.py +0 -0
  83. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird/tb/modules/watch.py +0 -0
  84. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird/tb/modules/workspace.py +0 -0
  85. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird/tb/modules/workspace_members.py +0 -0
  86. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird/tb_cli.py +0 -0
  87. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird/tb_cli_modules/auth.py +0 -0
  88. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird/tb_cli_modules/branch.py +0 -0
  89. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird/tb_cli_modules/cicd.py +0 -0
  90. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird/tb_cli_modules/cli.py +0 -0
  91. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird/tb_cli_modules/common.py +0 -0
  92. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird/tb_cli_modules/config.py +0 -0
  93. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird/tb_cli_modules/connection.py +0 -0
  94. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird/tb_cli_modules/datasource.py +0 -0
  95. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird/tb_cli_modules/exceptions.py +0 -0
  96. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird/tb_cli_modules/fmt.py +0 -0
  97. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird/tb_cli_modules/job.py +0 -0
  98. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird/tb_cli_modules/pipe.py +0 -0
  99. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird/tb_cli_modules/regions.py +0 -0
  100. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird/tb_cli_modules/tag.py +0 -0
  101. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird/tb_cli_modules/telemetry.py +0 -0
  102. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird/tb_cli_modules/test.py +0 -0
  103. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird/tb_cli_modules/tinyunit/tinyunit.py +0 -0
  104. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird/tb_cli_modules/tinyunit/tinyunit_lib.py +0 -0
  105. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird/tb_cli_modules/workspace.py +0 -0
  106. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird/tb_cli_modules/workspace_members.py +0 -0
  107. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird/tornado_template.py +0 -0
  108. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird.egg-info/dependency_links.txt +0 -0
  109. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird.egg-info/entry_points.txt +0 -0
  110. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird.egg-info/requires.txt +0 -0
  111. {tinybird-0.0.1.dev143 → tinybird-0.0.1.dev144}/tinybird.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: tinybird
3
- Version: 0.0.1.dev143
3
+ Version: 0.0.1.dev144
4
4
  Summary: Tinybird Command Line Tool
5
5
  Home-page: https://www.tinybird.co/docs/cli/introduction.html
6
6
  Author: Tinybird
@@ -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.dev143'
8
- __revision__ = '1424df6'
7
+ __version__ = '0.0.1.dev144'
8
+ __revision__ = 'aaeb0de'
@@ -25,7 +25,6 @@ import tinybird.tb.modules.mock
25
25
  import tinybird.tb.modules.open
26
26
  import tinybird.tb.modules.pipe
27
27
  import tinybird.tb.modules.secret
28
- import tinybird.tb.modules.tag
29
28
  import tinybird.tb.modules.test
30
29
  import tinybird.tb.modules.token
31
30
  import tinybird.tb.modules.workspace
@@ -0,0 +1,127 @@
1
+ import click
2
+
3
+ from tinybird.tb.modules.cli import cli
4
+ from tinybird.tb.modules.feedback_manager import FeedbackManager
5
+
6
+
7
+ @cli.command(
8
+ name="branch",
9
+ context_settings=dict(
10
+ ignore_unknown_options=True,
11
+ ),
12
+ )
13
+ @click.argument("args", nargs=-1, type=click.UNPROCESSED)
14
+ def branch(args) -> None:
15
+ """
16
+ `tb branch` is deprecated. You should rely on your version control system to manage branches.
17
+ """
18
+ click.echo(FeedbackManager.warning(
19
+ message="This command is deprecated. You should rely on your version control system to manage branches."
20
+ ))
21
+ click.echo("You are using Tinybird Forward CLI.\nYou can find more information in the docs at https://www.tinybird.co/docs/forward")
22
+
23
+
24
+ @cli.command(
25
+ name="check",
26
+ context_settings=dict(
27
+ ignore_unknown_options=True,
28
+ ),
29
+ )
30
+ @click.argument("args", nargs=-1, type=click.UNPROCESSED)
31
+ def check(args) -> None:
32
+ """
33
+ `tb check` is deprecated.
34
+ """
35
+ click.echo(FeedbackManager.warning(
36
+ message="This command is deprecated."
37
+ ))
38
+ click.echo("You are using Tinybird Forward CLI.\nYou can find more information in the docs at https://www.tinybird.co/docs/forward")
39
+
40
+
41
+ @cli.command(
42
+ name="diff",
43
+ context_settings=dict(
44
+ ignore_unknown_options=True,
45
+ ),
46
+ )
47
+ @click.argument("args", nargs=-1, type=click.UNPROCESSED)
48
+ def diff(args) -> None:
49
+ """
50
+ `tb diff` is deprecated.
51
+ """
52
+ click.echo(FeedbackManager.warning(
53
+ message="This command is deprecated."
54
+ ))
55
+ click.echo("You are using Tinybird Forward CLI.\nYou can find more information in the docs at https://www.tinybird.co/docs/forward")
56
+
57
+
58
+ @cli.command(
59
+ name="fmt",
60
+ context_settings=dict(
61
+ ignore_unknown_options=True,
62
+ ),
63
+ )
64
+ @click.argument("args", nargs=-1, type=click.UNPROCESSED)
65
+ def fmt(args) -> None:
66
+ """
67
+ `tb fmt` is deprecated.
68
+ """
69
+ click.echo(FeedbackManager.warning(
70
+ message="This command is deprecated."
71
+ ))
72
+ click.echo("You are using Tinybird Forward CLI.\nYou can find more information in the docs at https://www.tinybird.co/docs/forward")
73
+
74
+
75
+ @cli.command(
76
+ name="init",
77
+ context_settings=dict(
78
+ ignore_unknown_options=True,
79
+ ),
80
+ )
81
+ @click.argument("args", nargs=-1, type=click.UNPROCESSED)
82
+ def init(args) -> None:
83
+ """
84
+ `tb init` is deprecated. Use `tb create` instead.
85
+ """
86
+ click.echo(FeedbackManager.warning(
87
+ message="This command is deprecated. Use `tb create` instead."
88
+ ))
89
+ click.echo("You are using Tinybird Forward CLI.\nYou can find more information in the docs at https://www.tinybird.co/docs/forward")
90
+
91
+
92
+
93
+ @cli.command(
94
+ name="push",
95
+ context_settings=dict(
96
+ ignore_unknown_options=True,
97
+ ),
98
+ )
99
+ @click.argument("args", nargs=-1, type=click.UNPROCESSED)
100
+ def push(args) -> None:
101
+ """
102
+ `tb push` is deprecated. Use `tb deploy` instead.
103
+ """
104
+ click.echo(FeedbackManager.warning(
105
+ message="This command is deprecated. Use `tb deploy` instead."
106
+ ))
107
+ click.echo("You are using Tinybird Forward CLI.\nYou can find more information in the docs at https://www.tinybird.co/docs/forward")
108
+
109
+
110
+
111
+ @cli.command(
112
+ name="tag",
113
+ context_settings=dict(
114
+ ignore_unknown_options=True,
115
+ ),
116
+ )
117
+ @click.argument("args", nargs=-1, type=click.UNPROCESSED)
118
+ def tag(args) -> None:
119
+ """
120
+ `tb tag` is deprecated
121
+ """
122
+ click.echo(FeedbackManager.warning(
123
+ message="This command is deprecated."
124
+ ))
125
+ click.echo("You are using Tinybird Forward CLI.\nYou can find more information in the docs at https://www.tinybird.co/docs/forward")
126
+
127
+
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: tinybird
3
- Version: 0.0.1.dev143
3
+ Version: 0.0.1.dev144
4
4
  Summary: Tinybird Command Line Tool
5
5
  Home-page: https://www.tinybird.co/docs/cli/introduction.html
6
6
  Author: Tinybird
@@ -61,7 +61,6 @@ tinybird/tb/modules/regions.py
61
61
  tinybird/tb/modules/secret.py
62
62
  tinybird/tb/modules/shell.py
63
63
  tinybird/tb/modules/table.py
64
- tinybird/tb/modules/tag.py
65
64
  tinybird/tb/modules/telemetry.py
66
65
  tinybird/tb/modules/test.py
67
66
  tinybird/tb/modules/token.py
@@ -1,20 +0,0 @@
1
- import click
2
-
3
- from tinybird.tb.modules.cli import cli
4
-
5
-
6
- @cli.command(
7
- name="push",
8
- context_settings=dict(
9
- ignore_unknown_options=True,
10
- ),
11
- )
12
- @click.argument("args", nargs=-1, type=click.UNPROCESSED)
13
- def push(args) -> None:
14
- """
15
- `tb push` is deprecated. Use `tb deploy` instead.
16
- """
17
- click.echo(
18
- "You are using Tinybird Forward CLI. This command is deprecated. Use `tb deploy` instead. "
19
- "You can find more information in the docs at https://www.tinybird.co/docs/forward"
20
- )
@@ -1,100 +0,0 @@
1
- from typing import Optional
2
-
3
- import click
4
- from click import Context
5
-
6
- from tinybird.tb.modules.cli import cli
7
- from tinybird.tb.modules.common import coro, echo_safe_humanfriendly_tables_format_smart_table
8
- from tinybird.tb.modules.feedback_manager import FeedbackManager
9
-
10
-
11
- @cli.group(hidden=True)
12
- @click.pass_context
13
- def tag(ctx: Context) -> None:
14
- """Tag commands"""
15
-
16
-
17
- @tag.command(name="ls")
18
- @click.argument("tag_name", required=False)
19
- @click.pass_context
20
- @coro
21
- async def tag_ls(ctx: Context, tag_name: Optional[str]) -> None:
22
- """List all the tags of the current Workspace or the resources associated to a specific tag."""
23
-
24
- client = ctx.ensure_object(dict)["client"]
25
- response = await client.get_all_tags()
26
-
27
- if tag_name:
28
- the_tag = [tag for tag in response["tags"] if tag["name"] == tag_name]
29
-
30
- columns = ["name", "id", "type"]
31
- table = []
32
-
33
- if len(the_tag) > 0:
34
- for resource in the_tag[0]["resources"]:
35
- table.append([resource["name"], resource["id"], resource["type"]])
36
-
37
- click.echo(FeedbackManager.info_tag_resources(tag_name=tag_name))
38
- echo_safe_humanfriendly_tables_format_smart_table(table, column_names=columns)
39
- return
40
-
41
- columns = ["tag", "resources"]
42
- table = []
43
-
44
- for tag in response["tags"]:
45
- unique_resources = []
46
- for resource in tag["resources"]:
47
- if resource.get("name", "") not in unique_resources:
48
- unique_resources.append(resource) # Reducing by name in case there are duplicates.
49
- table.append([tag["name"], len(unique_resources)])
50
-
51
- click.echo(FeedbackManager.info_tag_list())
52
- echo_safe_humanfriendly_tables_format_smart_table(table, column_names=columns)
53
-
54
-
55
- @tag.command(name="create")
56
- @click.argument("tag_name")
57
- @click.pass_context
58
- @coro
59
- async def tag_create(ctx: Context, tag_name: str) -> None:
60
- """Create a tag in the current Workspace."""
61
-
62
- client = ctx.ensure_object(dict)["client"]
63
- await client.create_tag(name=tag_name)
64
-
65
- click.echo(FeedbackManager.success_tag_created(tag_name=tag_name))
66
-
67
-
68
- @tag.command(name="rm")
69
- @click.argument("tag_name")
70
- @click.option("--yes", is_flag=True, default=False, help="Do not ask for confirmation to delete the tag.")
71
- @click.pass_context
72
- @coro
73
- async def tag_rm(ctx: Context, tag_name: str, yes: bool) -> None:
74
- """Remove a tag from the current Workspace."""
75
-
76
- client = ctx.ensure_object(dict)["client"]
77
- remove_tag = True
78
-
79
- if not yes:
80
- all_tags = await client.get_all_tags()
81
- the_tag = [tag for tag in all_tags["tags"] if tag["name"] == tag_name]
82
- if len(the_tag) > 0:
83
- unique_resources = []
84
- for resource in the_tag[0]["resources"]:
85
- if resource.get("name", "") not in unique_resources:
86
- unique_resources.append(resource) # Reducing by name in case there are duplicates.
87
-
88
- if len(unique_resources) > 0:
89
- remove_tag = click.confirm(
90
- FeedbackManager.warning_tag_remove(tag_name=tag_name, resources_len=len(unique_resources))
91
- )
92
- else:
93
- remove_tag = click.confirm(FeedbackManager.warning_tag_remove_no_resources(tag_name=tag_name))
94
- else:
95
- remove_tag = False
96
- click.echo(FeedbackManager.error_tag_not_found(tag_name=tag_name))
97
-
98
- if remove_tag:
99
- await client.delete_tag(tag_name)
100
- click.echo(FeedbackManager.success_tag_removed(tag_name=tag_name))