Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/gooddata-sdk/src/gooddata_sdk/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
)
from gooddata_sdk.catalog.data_source.entity_model.data_source import (
CatalogDataSource,
CatalogDataSourceAiLakehouse,
CatalogDataSourceBigQuery,
CatalogDataSourceDatabricks,
CatalogDataSourceGdStorage,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -318,3 +318,17 @@ class CatalogDataSourceGdStorage(CatalogDataSource):
type: str = "GDSTORAGE"
schema: str = ""
credentials: Credentials = field(factory=_NoCredentials, repr=False)


@define(kw_only=True, eq=False)
class CatalogDataSourceAiLakehouse(CatalogDataSource):
"""AI Lakehouse data source.

Note: The backend does not expose connection details (url, token, schema, parameters)
for AI Lakehouse data sources — these fields are stripped on the server side.
Only id, name, type, cache_strategy, and permissions are preserved.
"""

type: str = "AILAKEHOUSE"
schema: str = ""
credentials: Credentials = field(factory=_NoCredentials, repr=False)
28 changes: 28 additions & 0 deletions packages/gooddata-sdk/tests/catalog/test_catalog_data_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from gooddata_sdk import (
BasicCredentials,
CatalogDataSource,
CatalogDataSourceAiLakehouse,
CatalogDataSourceBigQuery,
CatalogDataSourceDatabricks,
CatalogDataSourceMariaDb,
Expand Down Expand Up @@ -892,3 +893,30 @@ def test_jdbc_urls_creation(
),
)
assert data_source.url == url


def test_ai_lakehouse_data_source_construction():
"""CatalogDataSourceAiLakehouse can be constructed with only id and name.

The backend strips url, token, schema, and parameters for AI Lakehouse data sources,
so the wrapper class does not require those fields.
"""
ds = CatalogDataSourceAiLakehouse(id="ailakehouse-ds", name="AI Lakehouse")
assert ds.type == "AILAKEHOUSE"
assert ds.id == "ailakehouse-ds"
assert ds.name == "AI Lakehouse"
assert ds.schema == ""
assert ds.url is None
assert ds.parameters is None


def test_ai_lakehouse_data_source_to_api():
"""CatalogDataSourceAiLakehouse serializes correctly — no credential fields leaked."""
ds = CatalogDataSourceAiLakehouse(id="ailakehouse-ds", name="AI Lakehouse")
api_doc = ds.to_api()
attrs = api_doc.data.attributes
assert attrs.type == "AILAKEHOUSE"
assert attrs.name == "AI Lakehouse"
# url and schema are empty/None — not set on the API model
assert not getattr(attrs, "url", None)
assert not getattr(attrs, "token", None)
Loading