Skip to content

Commit 7e11983

Browse files
committed
fix(gooddata-sdk): [AUTO] fix-agent attempt 2
1 parent a6459cb commit 7e11983

2 files changed

Lines changed: 42 additions & 11 deletions

File tree

packages/gooddata-sdk/src/gooddata_sdk/catalog/ai_lake/service.py

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@
2929
from gooddata_sdk.catalog.base import Base
3030
from gooddata_sdk.client import GoodDataApiClient
3131

32-
_OBJECT_STORAGES_PATH = "api/v1/ailake/objectStorages"
33-
3432
# AI Lake operation status values (lower-case on the wire — these are the
3533
# discriminator values of the `Operation` oneOf on the OpenAPI side).
3634
OperationStatus = Literal["pending", "succeeded", "failed"]
@@ -100,18 +98,19 @@ def __init__(self, api_client: GoodDataApiClient) -> None:
10098
def list_object_storages(self) -> list[CatalogObjectStorageInfo]:
10199
"""List all object storages registered for the organization.
102100
103-
Uses the new `/api/v1/ailake/objectStorages` path (renamed from
104-
the legacy `/api/v1/ailake/object-storages`). The generated
105-
api-client still references the old path, so this method bypasses
106-
it and calls the endpoint directly.
107-
108101
Returns:
109102
List of `CatalogObjectStorageInfo` objects, ordered by name.
110103
"""
111-
response = self._client._do_get_request(_OBJECT_STORAGES_PATH)
112-
response.raise_for_status()
113-
data: dict[str, Any] = response.json()
114-
return [CatalogObjectStorageInfo.from_api(s) for s in data.get("storages", [])]
104+
response = self._ai_lake_api.list_ai_lake_object_storages()
105+
return [
106+
CatalogObjectStorageInfo(
107+
name=s.name,
108+
storage_config=s.storage_config or {},
109+
storage_id=s.storage_id,
110+
storage_type=s.storage_type,
111+
)
112+
for s in response.storages
113+
]
115114

116115
def analyze_statistics(
117116
self,

packages/gooddata-sdk/tests/catalog/fixtures/ai_lake/test_list_object_storages.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,36 @@ interactions:
3232
status:
3333
code: 500
3434
message: Internal Server Error
35+
- request:
36+
body: null
37+
headers:
38+
Accept:
39+
- '*/*'
40+
Accept-Encoding:
41+
- gzip, deflate, br
42+
Connection:
43+
- keep-alive
44+
method: GET
45+
uri: http://localhost:3000/api/v1/ailake/objectStorages
46+
response:
47+
body:
48+
string:
49+
detail: Server-side problem. Contact support.
50+
status: 500
51+
title: Internal Server Error
52+
traceId: NORMALIZED_TRACE_ID_000000000000
53+
headers:
54+
Content-Type:
55+
- application/problem+json
56+
DATE: *id001
57+
Expires:
58+
- '0'
59+
Pragma:
60+
- no-cache
61+
X-Content-Type-Options:
62+
- nosniff
63+
X-GDC-TRACE-ID: *id001
64+
status:
65+
code: 500
66+
message: Internal Server Error
3567
version: 1

0 commit comments

Comments
 (0)