From 2644f4b33104a1ec9a03a8279aa3130349a3c3ce Mon Sep 17 00:00:00 2001 From: AIDA Date: Thu, 12 Mar 2026 09:44:26 +0000 Subject: [PATCH] fix(gooddata-sdk): [AUTO] make LlmProvider models and provider_config optional Updated CatalogLlmProviderAttributes to declare models and provider_config as Optional (| None = None) to align with the updated OpenAPI spec that removes these from required fields, enabling valid PATCH requests that omit these fields. Added test for PATCH with name-only. Co-Authored-By: Claude Sonnet 4.6 --- .../organization/entity_model/llm_provider.py | 4 ++-- .../tests/catalog/test_catalog_organization.py | 17 +++++++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/packages/gooddata-sdk/src/gooddata_sdk/catalog/organization/entity_model/llm_provider.py b/packages/gooddata-sdk/src/gooddata_sdk/catalog/organization/entity_model/llm_provider.py index 0146b8f9b..c0a29129c 100644 --- a/packages/gooddata-sdk/src/gooddata_sdk/catalog/organization/entity_model/llm_provider.py +++ b/packages/gooddata-sdk/src/gooddata_sdk/catalog/organization/entity_model/llm_provider.py @@ -312,8 +312,8 @@ def init( @define(kw_only=True) class CatalogLlmProviderAttributes(Base): - models: list[CatalogLlmProviderModel] - provider_config: CatalogLlmProviderConfig + models: list[CatalogLlmProviderModel] | None = None + provider_config: CatalogLlmProviderConfig | None = None name: str | None = None description: str | None = None default_model_id: str | None = None diff --git a/packages/gooddata-sdk/tests/catalog/test_catalog_organization.py b/packages/gooddata-sdk/tests/catalog/test_catalog_organization.py index 58d4d2b66..645cc0527 100644 --- a/packages/gooddata-sdk/tests/catalog/test_catalog_organization.py +++ b/packages/gooddata-sdk/tests/catalog/test_catalog_organization.py @@ -9,6 +9,8 @@ CatalogDeclarativeNotificationChannel, CatalogJwk, CatalogLlmEndpoint, + CatalogLlmProvider, + CatalogLlmProviderPatch, CatalogOrganization, CatalogOrganizationSetting, CatalogRsaSpecification, @@ -556,6 +558,21 @@ def test_delete_llm_endpoint(test_config): pass +@gd_vcr.use_cassette(str(_fixtures_dir / "patch_llm_provider.yaml")) +def test_patch_llm_provider_name_only(test_config): + sdk = GoodDataSdk.create(host_=test_config["host"], token_=test_config["token"]) + + provider_id = "openai-provider" + patched_name = "Patched OpenAI Provider" + + llm_provider_patch = CatalogLlmProviderPatch.init(id=provider_id, name=patched_name) + updated_provider = sdk.catalog_organization.update_llm_provider(llm_provider_patch) + + assert isinstance(updated_provider, CatalogLlmProvider) + assert updated_provider.id == provider_id + assert updated_provider.attributes.name == patched_name + + # # The following tests are commented out as they require the organization to have the FEDERATED_IDENTITY_MANAGEMENT # entitlement enabled which cannot be done via SDK and must be done by GoodData support.