Using the python SDK with the Get and Put declarat...
# gooddata-cloud
d
Using the python SDK with the Get and Put declarative model. Errors below Context: I had to move clients from one space to another. All worked except one. The Ids in question do exist - and they are fields in the parent workspace so unsure of why it would fail. Second Try: I though I could just maybe take the analytics space and upload that as maybe something was off with the LDM. But then I get this issue when pulling out just the analytical space - how did a transfer the later to just declarativeAnalytics?
Copy code
Invalid type for variable 'declarative_analytics'. Required value type is DeclarativeAnalytics and passed type was DeclarativeAnalyticsLayer at ['declarative_analytics']
Copy code
Reason: Bad Request
HTTP response headers: HTTPHeaderDict({'Date': 'Fri, 11 Oct 2024 14:19:49 GMT', 'Content-Type': 'application/problem+json', 'Content-Length': '325', 'Connection': 'keep-alive', 'Vary': 'Origin, Access-Control-Request-Method, Access-Control-Request-Headers', 'X-GDC-TRACE-ID': '716b82b444c14be566212e667fd7857f', 'Cache-Control': 'no-cache, no-store, max-age=0, must-revalidate', 'Pragma': 'no-cache', 'Expires': '0', 'X-Content-Type-Options': 'nosniff', 'Strict-Transport-Security': 'max-age=63072000; includeSubDomains', 'X-XSS-Protection': '0', 'Referrer-Policy': 'no-referrer', 'set-cookie': 'SPRING_REDIRECT_URI=; Max-Age=0; Expires=Fri, 11 Oct 2024 14:19:49 GMT; Path=/; Secure; HTTPOnly; SameSite=None'})
HTTP response body: {"detail":"Some of given referenced 'attributes' entities do not exist. Not existing IDs: [Identifier(case_id)/Workspace(e3088b365b15456da2163b24e616c079), Identifier(call_cases.case_interaction_id)/Workspace(e3088b365b15456da2163b24e616c079)]","status":400,"title":"Bad Request","traceId":"716b82b444c14be566212e667fd7857f"}
m
Hi Doug, I am afraid that the ID's got removed when you were recreating/"moving" the child workspace. Can you try again, but this time using /api/v1/layout/ APIs? They are declarative, when you PUT, everything in the scope is completely replaced with what you PUT. I understand you are using Python SDK https://www.gooddata.com/docs/python-sdk/1.27/workspace/workspaces/put_declarative_workspaces/, but we also recommend using GoodData CLI: https://www.gooddata.com/docs/cloud/api-and-sdk/vs-code-extension/cli/ Anytime you can rollback to a previous state via VCS.
d
Hmm, I checked the LDM, the ID is there or what IDS are you referring to
How do i use the APIs with this object?
I'm very confused by your response - when you say "/api/v1/layout/" do you mean this https://www.gooddata.com/docs/cloud/api-and-sdk/api/api_reference_all/]
m
Yes, that's exactly it, my apologies for not including a link in my original message. You can give it a try directly with the API, even though I understand you are using the SDK, but if you run into the same issue, can you provide the steps to reproduce? As you mentioned you did not have issues transferring the other child workspaces, it would be good to understand what's different.
d
Trying the API, FYI its not a straight 1:1. Needs a fair bit of data massaging
Got the same errors
m
From our internal conversation, the missing fields were referenced in attribute_hierarchies.