tinybird 0.0.1.dev97__tar.gz → 0.0.1.dev98__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.dev97 → tinybird-0.0.1.dev98}/PKG-INFO +1 -1
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird/client.py +27 -11
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird/tb/__cli__.py +2 -2
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird/tb/modules/cli.py +2 -2
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird/tb/modules/common.py +10 -8
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird/tb/modules/config.py +1 -1
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird/tb/modules/datafile/build.py +1 -1
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird/tb/modules/datafile/build_datasource.py +2 -2
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird/tb/modules/datafile/build_pipe.py +2 -2
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird/tb/modules/datafile/playground.py +1 -1
- tinybird-0.0.1.dev98/tinybird/tb/modules/infra.py +693 -0
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird/tb/modules/local_common.py +5 -3
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird/tb/modules/login.py +6 -7
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird/tb/modules/workspace.py +2 -2
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird.egg-info/PKG-INFO +1 -1
- tinybird-0.0.1.dev97/tinybird/tb/modules/infra.py +0 -507
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/setup.cfg +0 -0
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird/__cli__.py +0 -0
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird/ch_utils/constants.py +0 -0
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird/ch_utils/engine.py +0 -0
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird/check_pypi.py +0 -0
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird/config.py +0 -0
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird/connectors.py +0 -0
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird/context.py +0 -0
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird/datafile.py +0 -0
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird/datatypes.py +0 -0
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird/feedback_manager.py +0 -0
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird/git_settings.py +0 -0
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird/prompts.py +0 -0
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird/sql.py +0 -0
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird/sql_template.py +0 -0
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird/sql_template_fmt.py +0 -0
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird/sql_toolset.py +0 -0
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird/syncasync.py +0 -0
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird/tb/cli.py +0 -0
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird/tb/modules/auth.py +0 -0
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird/tb/modules/build.py +0 -0
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird/tb/modules/cicd.py +0 -0
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird/tb/modules/connection.py +0 -0
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird/tb/modules/copy.py +0 -0
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird/tb/modules/create.py +0 -0
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird/tb/modules/datafile/build_common.py +0 -0
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird/tb/modules/datafile/common.py +0 -0
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird/tb/modules/datafile/diff.py +0 -0
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird/tb/modules/datafile/exceptions.py +0 -0
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird/tb/modules/datafile/fixture.py +0 -0
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird/tb/modules/datafile/format_common.py +0 -0
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird/tb/modules/datafile/format_datasource.py +0 -0
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird/tb/modules/datafile/format_pipe.py +0 -0
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird/tb/modules/datafile/parse_datasource.py +0 -0
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird/tb/modules/datafile/parse_pipe.py +0 -0
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird/tb/modules/datafile/pipe_checker.py +0 -0
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird/tb/modules/datafile/pull.py +0 -0
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird/tb/modules/datasource.py +0 -0
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird/tb/modules/deployment.py +0 -0
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird/tb/modules/endpoint.py +0 -0
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird/tb/modules/exceptions.py +0 -0
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird/tb/modules/feedback_manager.py +0 -0
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird/tb/modules/fmt.py +0 -0
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird/tb/modules/job.py +0 -0
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird/tb/modules/llm.py +0 -0
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird/tb/modules/llm_utils.py +0 -0
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird/tb/modules/local.py +0 -0
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird/tb/modules/logout.py +0 -0
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird/tb/modules/materialization.py +0 -0
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird/tb/modules/mock.py +0 -0
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird/tb/modules/open.py +0 -0
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird/tb/modules/pipe.py +0 -0
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird/tb/modules/playground.py +0 -0
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird/tb/modules/project.py +0 -0
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird/tb/modules/regions.py +0 -0
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird/tb/modules/secret.py +0 -0
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird/tb/modules/shell.py +0 -0
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird/tb/modules/table.py +0 -0
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird/tb/modules/tag.py +0 -0
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird/tb/modules/telemetry.py +0 -0
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird/tb/modules/test.py +0 -0
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird/tb/modules/tinyunit/tinyunit.py +0 -0
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird/tb/modules/tinyunit/tinyunit_lib.py +0 -0
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird/tb/modules/token.py +0 -0
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird/tb/modules/watch.py +0 -0
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird/tb/modules/workspace_members.py +0 -0
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird/tb_cli.py +0 -0
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird/tb_cli_modules/auth.py +0 -0
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird/tb_cli_modules/branch.py +0 -0
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird/tb_cli_modules/cicd.py +0 -0
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird/tb_cli_modules/cli.py +0 -0
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird/tb_cli_modules/common.py +0 -0
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird/tb_cli_modules/config.py +0 -0
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird/tb_cli_modules/connection.py +0 -0
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird/tb_cli_modules/datasource.py +0 -0
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird/tb_cli_modules/exceptions.py +0 -0
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird/tb_cli_modules/fmt.py +0 -0
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird/tb_cli_modules/job.py +0 -0
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird/tb_cli_modules/pipe.py +0 -0
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird/tb_cli_modules/regions.py +0 -0
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird/tb_cli_modules/tag.py +0 -0
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird/tb_cli_modules/telemetry.py +0 -0
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird/tb_cli_modules/test.py +0 -0
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird/tb_cli_modules/tinyunit/tinyunit.py +0 -0
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird/tb_cli_modules/tinyunit/tinyunit_lib.py +0 -0
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird/tb_cli_modules/workspace.py +0 -0
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird/tb_cli_modules/workspace_members.py +0 -0
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird/tornado_template.py +0 -0
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird.egg-info/SOURCES.txt +0 -0
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird.egg-info/dependency_links.txt +0 -0
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird.egg-info/entry_points.txt +0 -0
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird.egg-info/requires.txt +0 -0
- {tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird.egg-info/top_level.txt +0 -0
|
@@ -714,8 +714,8 @@ class TinyB:
|
|
|
714
714
|
async def job_cancel(self, job_id: str):
|
|
715
715
|
return await self._req(f"/v0/jobs/{job_id}/cancel", method="POST", data=b"")
|
|
716
716
|
|
|
717
|
-
async def user_workspaces(self):
|
|
718
|
-
data = await self._req("/
|
|
717
|
+
async def user_workspaces(self, version: str = "v0"):
|
|
718
|
+
data = await self._req(f"/{version}/user/workspaces/?with_environments=false")
|
|
719
719
|
# TODO: this is repeated in local_common.py but I'm avoiding circular imports
|
|
720
720
|
local_port = int(os.getenv("TB_LOCAL_PORT", 80))
|
|
721
721
|
local_host = f"http://localhost:{local_port}"
|
|
@@ -725,16 +725,16 @@ class TinyB:
|
|
|
725
725
|
local_workspaces = [x for x in data["workspaces"] if not x["name"].startswith("Tinybird_Local_")]
|
|
726
726
|
return {**data, "workspaces": local_workspaces}
|
|
727
727
|
|
|
728
|
-
async def user_workspaces_and_branches(self):
|
|
729
|
-
return await self._req("/
|
|
728
|
+
async def user_workspaces_and_branches(self, version: str = "v0"):
|
|
729
|
+
return await self._req(f"/{version}/user/workspaces/?with_environments=true")
|
|
730
730
|
|
|
731
|
-
async def user_workspaces_with_organization(self):
|
|
731
|
+
async def user_workspaces_with_organization(self, version: str = "v0"):
|
|
732
732
|
return await self._req(
|
|
733
|
-
"/
|
|
733
|
+
f"/{version}/user/workspaces/?with_environments=false&with_organization=true&with_members_and_owner=false"
|
|
734
734
|
)
|
|
735
735
|
|
|
736
|
-
async def user_workspace_branches(self):
|
|
737
|
-
return await self._req("/
|
|
736
|
+
async def user_workspace_branches(self, version: str = "v0"):
|
|
737
|
+
return await self._req(f"/{version}/user/workspaces/?with_environments=true&only_environments=true")
|
|
738
738
|
|
|
739
739
|
async def branches(self):
|
|
740
740
|
return await self._req("/v0/environments")
|
|
@@ -747,8 +747,9 @@ class TinyB:
|
|
|
747
747
|
name: str,
|
|
748
748
|
template: Optional[str],
|
|
749
749
|
assign_to_organization_id: Optional[str] = None,
|
|
750
|
+
version: str = "v0",
|
|
750
751
|
):
|
|
751
|
-
url = f"/
|
|
752
|
+
url = f"/{version}/workspaces?name={name}"
|
|
752
753
|
if template:
|
|
753
754
|
url += f"&starter_kit={template}"
|
|
754
755
|
if assign_to_organization_id:
|
|
@@ -884,8 +885,8 @@ class TinyB:
|
|
|
884
885
|
params = {"with_token": "true" if with_token else "false"}
|
|
885
886
|
return await self._req(f"/v0/workspaces/{workspace_id}?{urlencode(params)}")
|
|
886
887
|
|
|
887
|
-
async def workspace_info(self) -> Dict[str, Any]:
|
|
888
|
-
return await self._req("/
|
|
888
|
+
async def workspace_info(self, version: str = "v0") -> Dict[str, Any]:
|
|
889
|
+
return await self._req(f"/{version}/workspace")
|
|
889
890
|
|
|
890
891
|
async def organization(self, organization_id: str):
|
|
891
892
|
return await self._req(f"/v0/organizations/{organization_id}")
|
|
@@ -906,6 +907,21 @@ class TinyB:
|
|
|
906
907
|
data=json.dumps({"workspace_ids": ",".join(workspace_ids)}),
|
|
907
908
|
)
|
|
908
909
|
|
|
910
|
+
async def infra_create(self, organization_id: str, name: str, host: str) -> Dict[str, Any]:
|
|
911
|
+
params = {
|
|
912
|
+
"organization_id": organization_id,
|
|
913
|
+
"name": name,
|
|
914
|
+
"host": host,
|
|
915
|
+
}
|
|
916
|
+
return await self._req(f"/v1/infra?{urlencode(params)}", method="POST")
|
|
917
|
+
|
|
918
|
+
async def infra_list(self, organization_id: str) -> List[Dict[str, Any]]:
|
|
919
|
+
data = await self._req(f"/v1/infra?organization_id={organization_id}")
|
|
920
|
+
return data.get("infras", [])
|
|
921
|
+
|
|
922
|
+
async def infra_delete(self, infra_id: str, organization_id: str) -> Dict[str, Any]:
|
|
923
|
+
return await self._req(f"/v1/infra/{infra_id}?organization_id={organization_id}", method="DELETE")
|
|
924
|
+
|
|
909
925
|
async def wait_for_job(
|
|
910
926
|
self,
|
|
911
927
|
job_id: str,
|
|
@@ -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.dev98'
|
|
8
|
+
__revision__ = 'f7b04b3'
|
|
@@ -121,7 +121,7 @@ async def cli(
|
|
|
121
121
|
# If they have passed a token or host as parameter and it's different that record in .tinyb, refresh the workspace id
|
|
122
122
|
if token or host:
|
|
123
123
|
try:
|
|
124
|
-
workspace = await client.workspace_info()
|
|
124
|
+
workspace = await client.workspace_info(version="v1")
|
|
125
125
|
config["id"] = workspace.get("id", "")
|
|
126
126
|
config["name"] = workspace.get("name", "")
|
|
127
127
|
# If we can not get this info, we continue with the id on the file
|
|
@@ -236,7 +236,7 @@ async def diff(
|
|
|
236
236
|
else:
|
|
237
237
|
config = CLIConfig.get_project_config()
|
|
238
238
|
|
|
239
|
-
response = await client.user_workspaces_and_branches()
|
|
239
|
+
response = await client.user_workspaces_and_branches(version="v1")
|
|
240
240
|
ws_client = None
|
|
241
241
|
for workspace in response["workspaces"]:
|
|
242
242
|
if config["id"] == workspace["id"]:
|
|
@@ -198,7 +198,7 @@ def generate_datafile(
|
|
|
198
198
|
|
|
199
199
|
async def get_current_workspace(config: CLIConfig) -> Optional[Dict[str, Any]]:
|
|
200
200
|
client = config.get_client()
|
|
201
|
-
workspaces: List[Dict[str, Any]] = (await client.user_workspaces_and_branches()).get("workspaces", [])
|
|
201
|
+
workspaces: List[Dict[str, Any]] = (await client.user_workspaces_and_branches(version="v1")).get("workspaces", [])
|
|
202
202
|
return _get_current_workspace_common(workspaces, config["id"])
|
|
203
203
|
|
|
204
204
|
|
|
@@ -213,7 +213,7 @@ def _get_current_workspace_common(
|
|
|
213
213
|
|
|
214
214
|
|
|
215
215
|
async def get_current_environment(client, config):
|
|
216
|
-
workspaces: List[Dict[str, Any]] = (await client.user_workspaces_and_branches()).get("workspaces", [])
|
|
216
|
+
workspaces: List[Dict[str, Any]] = (await client.user_workspaces_and_branches(version="v1")).get("workspaces", [])
|
|
217
217
|
return next((workspace for workspace in workspaces if workspace["id"] == config["id"]), None)
|
|
218
218
|
|
|
219
219
|
|
|
@@ -700,7 +700,9 @@ async def create_workspace_non_interactive(
|
|
|
700
700
|
user_client: TinyB = deepcopy(client)
|
|
701
701
|
user_client.token = user_token
|
|
702
702
|
|
|
703
|
-
created_workspace = await user_client.create_workspace(
|
|
703
|
+
created_workspace = await user_client.create_workspace(
|
|
704
|
+
workspace_name, starterkit, organization_id, version="v1"
|
|
705
|
+
)
|
|
704
706
|
if organization_id and organization_name:
|
|
705
707
|
click.echo(
|
|
706
708
|
FeedbackManager.success_workspace_created_with_organization(
|
|
@@ -1210,7 +1212,7 @@ def _get_setting_value(connection, setting, sensitive_settings):
|
|
|
1210
1212
|
|
|
1211
1213
|
async def switch_workspace(config: CLIConfig, workspace_name_or_id: str) -> None:
|
|
1212
1214
|
try:
|
|
1213
|
-
response = await config.get_client().user_workspaces()
|
|
1215
|
+
response = await config.get_client().user_workspaces(version="v1")
|
|
1214
1216
|
workspaces = response["workspaces"]
|
|
1215
1217
|
|
|
1216
1218
|
workspace = next(
|
|
@@ -1436,7 +1438,7 @@ async def try_update_config_with_remote(
|
|
|
1436
1438
|
return True
|
|
1437
1439
|
|
|
1438
1440
|
try:
|
|
1439
|
-
response = await config.get_client().workspace_info()
|
|
1441
|
+
response = await config.get_client().workspace_info(version="v1")
|
|
1440
1442
|
except AuthException:
|
|
1441
1443
|
if raise_on_errors:
|
|
1442
1444
|
raise CLIAuthException(FeedbackManager.error_invalid_token_for_host(host=config.get_host()))
|
|
@@ -1606,7 +1608,7 @@ async def wait_job_no_ui(
|
|
|
1606
1608
|
|
|
1607
1609
|
|
|
1608
1610
|
async def get_current_main_workspace(config: CLIConfig) -> Optional[Dict[str, Any]]:
|
|
1609
|
-
current_workspace = await config.get_client().user_workspaces_and_branches()
|
|
1611
|
+
current_workspace = await config.get_client().user_workspaces_and_branches(version="v1")
|
|
1610
1612
|
return _get_current_main_workspace_common(current_workspace, config.get("id", current_workspace["id"]))
|
|
1611
1613
|
|
|
1612
1614
|
|
|
@@ -1988,7 +1990,7 @@ async def get_organizations_by_user(config: CLIConfig, user_token: str) -> List[
|
|
|
1988
1990
|
|
|
1989
1991
|
try:
|
|
1990
1992
|
user_client = config.get_client(token=user_token)
|
|
1991
|
-
user_workspaces = await user_client.user_workspaces_with_organization()
|
|
1993
|
+
user_workspaces = await user_client.user_workspaces_with_organization(version="v1")
|
|
1992
1994
|
admin_org_id = user_workspaces.get("organization_id")
|
|
1993
1995
|
seen_org_ids = set()
|
|
1994
1996
|
|
|
@@ -2105,7 +2107,7 @@ async def create_organization_and_add_workspaces(
|
|
|
2105
2107
|
raise CLIWorkspaceException(FeedbackManager.error_organization_creation(error=str(e)))
|
|
2106
2108
|
|
|
2107
2109
|
# Add existing orphan workspaces to the organization - this is only needed for backwards compatibility
|
|
2108
|
-
user_workspaces = await client.user_workspaces_with_organization()
|
|
2110
|
+
user_workspaces = await client.user_workspaces_with_organization(version="v1")
|
|
2109
2111
|
workspaces_to_migrate = []
|
|
2110
2112
|
for workspace in user_workspaces["workspaces"]:
|
|
2111
2113
|
if workspace.get("organization") is None and workspace.get("role") == "admin":
|
|
@@ -279,7 +279,7 @@ class CLIConfig:
|
|
|
279
279
|
|
|
280
280
|
client: tbc.TinyB = self.get_client(token=self.get_user_token(), host=host)
|
|
281
281
|
|
|
282
|
-
info: Dict[str, Any] = await client.user_workspaces_and_branches()
|
|
282
|
+
info: Dict[str, Any] = await client.user_workspaces_and_branches(version="v1")
|
|
283
283
|
workspaces: List[Dict[str, Any]] = info["workspaces"]
|
|
284
284
|
|
|
285
285
|
result: Optional[str] = next(
|
|
@@ -1015,7 +1015,7 @@ async def process_file(
|
|
|
1015
1015
|
period: int = DEFAULT_CRON_PERIOD
|
|
1016
1016
|
|
|
1017
1017
|
if current_ws is not None:
|
|
1018
|
-
workspaces = (await tb_client.user_workspaces()).get("workspaces", [])
|
|
1018
|
+
workspaces = (await tb_client.user_workspaces(version="v1")).get("workspaces", [])
|
|
1019
1019
|
workspace_rate_limits: Dict[str, Dict[str, int]] = next(
|
|
1020
1020
|
(w.get("rate_limits", {}) for w in workspaces if w["id"] == current_ws["id"]), {}
|
|
1021
1021
|
)
|
{tinybird-0.0.1.dev97 → tinybird-0.0.1.dev98}/tinybird/tb/modules/datafile/build_datasource.py
RENAMED
|
@@ -346,9 +346,9 @@ async def share_and_unshare_datasource(
|
|
|
346
346
|
if current_ws:
|
|
347
347
|
# Force to get all the workspaces the user can access
|
|
348
348
|
workspace = current_ws
|
|
349
|
-
workspaces = (await client.user_workspaces()).get("workspaces", [])
|
|
349
|
+
workspaces = (await client.user_workspaces(version="v1")).get("workspaces", [])
|
|
350
350
|
else:
|
|
351
|
-
workspace = await client.user_workspace_branches()
|
|
351
|
+
workspace = await client.user_workspace_branches(version="v1")
|
|
352
352
|
workspaces = workspace.get("workspaces", [])
|
|
353
353
|
|
|
354
354
|
if workspace.get("is_branch", False):
|
|
@@ -166,10 +166,10 @@ async def new_pipe(
|
|
|
166
166
|
|
|
167
167
|
async def get_token_from_main_branch(branch_tb_client: TinyB) -> Optional[str]:
|
|
168
168
|
token_from_main_branch = None
|
|
169
|
-
current_workspace = await branch_tb_client.workspace_info()
|
|
169
|
+
current_workspace = await branch_tb_client.workspace_info(version="v1")
|
|
170
170
|
# current workspace is a branch
|
|
171
171
|
if current_workspace.get("main"):
|
|
172
|
-
response = await branch_tb_client.user_workspaces()
|
|
172
|
+
response = await branch_tb_client.user_workspaces(version="v1")
|
|
173
173
|
workspaces = response["workspaces"]
|
|
174
174
|
prod_workspace = next(
|
|
175
175
|
(workspace for workspace in workspaces if workspace["id"] == current_workspace["main"]), None
|
|
@@ -1172,7 +1172,7 @@ async def process_file(
|
|
|
1172
1172
|
period: int = DEFAULT_CRON_PERIOD
|
|
1173
1173
|
|
|
1174
1174
|
if current_ws is not None:
|
|
1175
|
-
workspaces = (await tb_client.user_workspaces()).get("workspaces", [])
|
|
1175
|
+
workspaces = (await tb_client.user_workspaces(version="v1")).get("workspaces", [])
|
|
1176
1176
|
workspace_rate_limits: Dict[str, Dict[str, int]] = next(
|
|
1177
1177
|
(w.get("rate_limits", {}) for w in workspaces if w["id"] == current_ws["id"]), {}
|
|
1178
1178
|
)
|