Skip to content

Commit 9e745e7

Browse files
Auto Implclaude
andcommitted
feat(gooddata-sdk): [AUTO] add CatalogDataSourceAiLakehouse data source type
Adds CatalogDataSourceAiLakehouse class following the existing typed subclass pattern (CatalogDataSourceGdStorage) for data sources that do not expose connection credentials. The backend strips url, token, schema, and parameters for AI Lakehouse data sources, so the wrapper omits those fields by defaulting schema to empty string and using _NoCredentials. Exports the new class through gooddata_sdk/__init__.py. Adds unit tests verifying construction and serialization behavior. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent b65ee3f commit 9e745e7

3 files changed

Lines changed: 43 additions & 0 deletions

File tree

packages/gooddata-sdk/src/gooddata_sdk/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
)
3737
from gooddata_sdk.catalog.data_source.entity_model.data_source import (
3838
CatalogDataSource,
39+
CatalogDataSourceAiLakehouse,
3940
CatalogDataSourceBigQuery,
4041
CatalogDataSourceDatabricks,
4142
CatalogDataSourceGdStorage,

packages/gooddata-sdk/src/gooddata_sdk/catalog/data_source/entity_model/data_source.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,3 +318,17 @@ class CatalogDataSourceGdStorage(CatalogDataSource):
318318
type: str = "GDSTORAGE"
319319
schema: str = ""
320320
credentials: Credentials = field(factory=_NoCredentials, repr=False)
321+
322+
323+
@define(kw_only=True, eq=False)
324+
class CatalogDataSourceAiLakehouse(CatalogDataSource):
325+
"""AI Lakehouse data source.
326+
327+
Note: The backend does not expose connection details (url, token, schema, parameters)
328+
for AI Lakehouse data sources — these fields are stripped on the server side.
329+
Only id, name, type, cache_strategy, and permissions are preserved.
330+
"""
331+
332+
type: str = "AILAKEHOUSE"
333+
schema: str = ""
334+
credentials: Credentials = field(factory=_NoCredentials, repr=False)

packages/gooddata-sdk/tests/catalog/test_catalog_data_source.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
from gooddata_sdk import (
1212
BasicCredentials,
1313
CatalogDataSource,
14+
CatalogDataSourceAiLakehouse,
1415
CatalogDataSourceBigQuery,
1516
CatalogDataSourceDatabricks,
1617
CatalogDataSourceMariaDb,
@@ -892,3 +893,30 @@ def test_jdbc_urls_creation(
892893
),
893894
)
894895
assert data_source.url == url
896+
897+
898+
def test_ai_lakehouse_data_source_construction():
899+
"""CatalogDataSourceAiLakehouse can be constructed with only id and name.
900+
901+
The backend strips url, token, schema, and parameters for AI Lakehouse data sources,
902+
so the wrapper class does not require those fields.
903+
"""
904+
ds = CatalogDataSourceAiLakehouse(id="ailakehouse-ds", name="AI Lakehouse")
905+
assert ds.type == "AILAKEHOUSE"
906+
assert ds.id == "ailakehouse-ds"
907+
assert ds.name == "AI Lakehouse"
908+
assert ds.schema == ""
909+
assert ds.url is None
910+
assert ds.parameters is None
911+
912+
913+
def test_ai_lakehouse_data_source_to_api():
914+
"""CatalogDataSourceAiLakehouse serializes correctly — no credential fields leaked."""
915+
ds = CatalogDataSourceAiLakehouse(id="ailakehouse-ds", name="AI Lakehouse")
916+
api_doc = ds.to_api()
917+
attrs = api_doc.data.attributes
918+
assert attrs.type == "AILAKEHOUSE"
919+
assert attrs.name == "AI Lakehouse"
920+
# url and schema are empty/None — not set on the API model
921+
assert not getattr(attrs, "url", None)
922+
assert not getattr(attrs, "token", None)

0 commit comments

Comments
 (0)