From b3be3c07886fe0fac897a3f28719c2330507bf85 Mon Sep 17 00:00:00 2001 From: Nathan Thorpe Date: Wed, 30 Sep 2026 08:06:52 -0700 Subject: [PATCH] Update models --- .../v1/api/dashboards/delete_dashboard.py | 85 ++----------------- ...{query_namespace_data.py => query_data.py} | 20 +++-- cirro_api_client/v1/models/file_def.py | 3 +- .../v1/models/run_analysis_request.py | 20 +++++ .../v1/models/sheet_query_request.py | 23 +---- pyproject.toml | 2 +- 6 files changed, 43 insertions(+), 110 deletions(-) rename cirro_api_client/v1/api/sheets/{query_namespace_data.py => query_data.py} (84%) diff --git a/cirro_api_client/v1/api/dashboards/delete_dashboard.py b/cirro_api_client/v1/api/dashboards/delete_dashboard.py index 17d0b1c..4385e3f 100644 --- a/cirro_api_client/v1/api/dashboards/delete_dashboard.py +++ b/cirro_api_client/v1/api/dashboards/delete_dashboard.py @@ -6,7 +6,6 @@ from ... import errors from ...client import Client -from ...models.dashboard import Dashboard from ...types import Response @@ -25,16 +24,14 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: Client, response: httpx.Response) -> Dashboard | None: +def _parse_response(*, client: Client, response: httpx.Response) -> Any | None: if response.status_code == 204: - response_204 = Dashboard.from_dict(response.json()) - - return response_204 + return None errors.handle_error_response(response, client.raise_on_unexpected_status) -def _build_response(*, client: Client, response: httpx.Response) -> Response[Dashboard]: +def _build_response(*, client: Client, response: httpx.Response) -> Response[Any]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -48,7 +45,7 @@ def sync_detailed( dashboard_id: str, *, client: Client, -) -> Response[Dashboard]: +) -> Response[Any]: """Delete dashboard Deletes a dashboard @@ -63,7 +60,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Dashboard] + Response[Any] """ kwargs = _get_kwargs( @@ -79,45 +76,12 @@ def sync_detailed( return _build_response(client=client, response=response) -def sync( - project_id: str, - dashboard_id: str, - *, - client: Client, -) -> Dashboard | None: - """Delete dashboard - - Deletes a dashboard - - Args: - project_id (str): - dashboard_id (str): - client (Client): instance of the API client - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Dashboard - """ - - try: - return sync_detailed( - project_id=project_id, - dashboard_id=dashboard_id, - client=client, - ).parsed - except errors.NotFoundException: - return None - - async def asyncio_detailed( project_id: str, dashboard_id: str, *, client: Client, -) -> Response[Dashboard]: +) -> Response[Any]: """Delete dashboard Deletes a dashboard @@ -132,7 +96,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Dashboard] + Response[Any] """ kwargs = _get_kwargs( @@ -143,38 +107,3 @@ async def asyncio_detailed( response = await client.get_async_httpx_client().request(auth=client.get_auth(), **kwargs) return _build_response(client=client, response=response) - - -async def asyncio( - project_id: str, - dashboard_id: str, - *, - client: Client, -) -> Dashboard | None: - """Delete dashboard - - Deletes a dashboard - - Args: - project_id (str): - dashboard_id (str): - client (Client): instance of the API client - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Dashboard - """ - - try: - return ( - await asyncio_detailed( - project_id=project_id, - dashboard_id=dashboard_id, - client=client, - ) - ).parsed - except errors.NotFoundException: - return None diff --git a/cirro_api_client/v1/api/sheets/query_namespace_data.py b/cirro_api_client/v1/api/sheets/query_data.py similarity index 84% rename from cirro_api_client/v1/api/sheets/query_namespace_data.py rename to cirro_api_client/v1/api/sheets/query_data.py index f5fe0a4..f5deeb9 100644 --- a/cirro_api_client/v1/api/sheets/query_namespace_data.py +++ b/cirro_api_client/v1/api/sheets/query_data.py @@ -57,9 +57,10 @@ def sync_detailed( client: Client, body: SheetQueryRequest, ) -> Response[SheetQueryResponse]: - """Run raw SQL against the project's sheets. + """Run a raw SQL query against the project's sheets - Returns executed SQL results. + Runs a read-only SQL query and returns a page of its results. Unqualified table names resolve across + every namespace in the project. Args: project_id (str): @@ -93,9 +94,10 @@ def sync( client: Client, body: SheetQueryRequest, ) -> SheetQueryResponse | None: - """Run raw SQL against the project's sheets. + """Run a raw SQL query against the project's sheets - Returns executed SQL results. + Runs a read-only SQL query and returns a page of its results. Unqualified table names resolve across + every namespace in the project. Args: project_id (str): @@ -126,9 +128,10 @@ async def asyncio_detailed( client: Client, body: SheetQueryRequest, ) -> Response[SheetQueryResponse]: - """Run raw SQL against the project's sheets. + """Run a raw SQL query against the project's sheets - Returns executed SQL results. + Runs a read-only SQL query and returns a page of its results. Unqualified table names resolve across + every namespace in the project. Args: project_id (str): @@ -159,9 +162,10 @@ async def asyncio( client: Client, body: SheetQueryRequest, ) -> SheetQueryResponse | None: - """Run raw SQL against the project's sheets. + """Run a raw SQL query against the project's sheets - Returns executed SQL results. + Runs a read-only SQL query and returns a page of its results. Unqualified table names resolve across + every namespace in the project. Args: project_id (str): diff --git a/cirro_api_client/v1/models/file_def.py b/cirro_api_client/v1/models/file_def.py index 260fe5a..a425928 100644 --- a/cirro_api_client/v1/models/file_def.py +++ b/cirro_api_client/v1/models/file_def.py @@ -16,7 +16,8 @@ class FileDef: """ Attributes: file_type (FileType): - storage_uri (str): Full S3 URI to the source file. + storage_uri (str): Full S3 URI to the source file. For an ingest, it must be under the sheet's staging upload + path. """ file_type: FileType diff --git a/cirro_api_client/v1/models/run_analysis_request.py b/cirro_api_client/v1/models/run_analysis_request.py index 36366be..963b82c 100644 --- a/cirro_api_client/v1/models/run_analysis_request.py +++ b/cirro_api_client/v1/models/run_analysis_request.py @@ -43,6 +43,7 @@ class RunAnalysisRequest: environment_type (EnvironmentType | None | Unset): The type of execution environment to run the workflow in, if not specified, the default for the pipeline is used tags (list[Tag] | None | Unset): List of tags to apply to the dataset + disable_cache (bool | None | Unset): Disables the task run cache Default: False. """ name: str @@ -58,6 +59,7 @@ class RunAnalysisRequest: compute_environment_id: None | str | Unset = UNSET environment_type: EnvironmentType | None | Unset = UNSET tags: list[Tag] | None | Unset = UNSET + disable_cache: bool | None | Unset = False additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -137,6 +139,12 @@ def to_dict(self) -> dict[str, Any]: else: tags = self.tags + disable_cache: bool | None | Unset + if isinstance(self.disable_cache, Unset): + disable_cache = UNSET + else: + disable_cache = self.disable_cache + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update( @@ -164,6 +172,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["environmentType"] = environment_type if tags is not UNSET: field_dict["tags"] = tags + if disable_cache is not UNSET: + field_dict["disableCache"] = disable_cache return field_dict @@ -302,6 +312,15 @@ def _parse_tags(data: object) -> list[Tag] | None | Unset: tags = _parse_tags(d.pop("tags", UNSET)) + def _parse_disable_cache(data: object) -> bool | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(bool | None | Unset, data) + + disable_cache = _parse_disable_cache(d.pop("disableCache", UNSET)) + run_analysis_request = cls( name=name, process_id=process_id, @@ -316,6 +335,7 @@ def _parse_tags(data: object) -> list[Tag] | None | Unset: compute_environment_id=compute_environment_id, environment_type=environment_type, tags=tags, + disable_cache=disable_cache, ) run_analysis_request.additional_properties = d diff --git a/cirro_api_client/v1/models/sheet_query_request.py b/cirro_api_client/v1/models/sheet_query_request.py index 925d61a..d419d2f 100644 --- a/cirro_api_client/v1/models/sheet_query_request.py +++ b/cirro_api_client/v1/models/sheet_query_request.py @@ -15,16 +15,13 @@ class SheetQueryRequest: """ Attributes: - query (str): Raw SQL query to run. - namespace_name (None | str | Unset): Deprecated: no longer scopes name resolution — every namespace is on the - engine's search path. Example: default. + query (str): Raw SQL query to run. Unqualified table names resolve across every namespace in the project. limit (int | None | Unset): Maximum rows to return. Responses also have a size limit: with wide rows a large page can fail with a 502 — lower the limit if so. Default: 1000. page (int | None | Unset): Page to return Default: 1. """ query: str - namespace_name: None | str | Unset = UNSET limit: int | None | Unset = 1000 page: int | None | Unset = 1 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -32,12 +29,6 @@ class SheetQueryRequest: def to_dict(self) -> dict[str, Any]: query = self.query - namespace_name: None | str | Unset - if isinstance(self.namespace_name, Unset): - namespace_name = UNSET - else: - namespace_name = self.namespace_name - limit: int | None | Unset if isinstance(self.limit, Unset): limit = UNSET @@ -57,8 +48,6 @@ def to_dict(self) -> dict[str, Any]: "query": query, } ) - if namespace_name is not UNSET: - field_dict["namespaceName"] = namespace_name if limit is not UNSET: field_dict["limit"] = limit if page is not UNSET: @@ -71,15 +60,6 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) query = d.pop("query") - def _parse_namespace_name(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - namespace_name = _parse_namespace_name(d.pop("namespaceName", UNSET)) - def _parse_limit(data: object) -> int | None | Unset: if data is None: return data @@ -100,7 +80,6 @@ def _parse_page(data: object) -> int | None | Unset: sheet_query_request = cls( query=query, - namespace_name=namespace_name, limit=limit, page=page, ) diff --git a/pyproject.toml b/pyproject.toml index a0d2a24..fc3f198 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "cirro_api_client" -version = "1.7.1" +version = "1.7.2" description = "A client library for accessing Cirro" authors = ["Cirro "] license = "MIT"