gooddata-sdk 1.76.1.dev4__py3-none-any.whl → 1.77.1.dev1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,7 +5,7 @@ import functools
5
5
  from typing import Any, Union
6
6
 
7
7
  from attrs import Factory, define, field
8
- from gooddata_api_client.model.json_api_organization_setting_in_attributes import JsonApiOrganizationSettingInAttributes
8
+ from gooddata_api_client.model.json_api_user_setting_in_attributes import JsonApiUserSettingInAttributes
9
9
  from gooddata_api_client.model.json_api_workspace_setting_in import JsonApiWorkspaceSettingIn
10
10
  from gooddata_api_client.model.json_api_workspace_setting_in_document import JsonApiWorkspaceSettingInDocument
11
11
  from gooddata_api_client.model.json_api_workspace_setting_out import JsonApiWorkspaceSettingOut
@@ -22,7 +22,7 @@ from gooddata_sdk.utils import safeget
22
22
  class CatalogWorkspaceSetting(Base):
23
23
  id: str = field(default=None)
24
24
  setting_type: str = field(
25
- validator=functools.partial(value_in_allowed, client_class=JsonApiOrganizationSettingInAttributes)
25
+ validator=functools.partial(value_in_allowed, client_class=JsonApiUserSettingInAttributes)
26
26
  )
27
27
  content: dict = field(
28
28
  repr=False,
@@ -33,8 +33,8 @@ class CatalogWorkspaceSetting(Base):
33
33
  def client_class() -> type[JsonApiWorkspaceSettingOut]:
34
34
  return JsonApiWorkspaceSettingOut
35
35
 
36
- def _attributes(self) -> JsonApiOrganizationSettingInAttributes:
37
- return JsonApiOrganizationSettingInAttributes(
36
+ def _attributes(self) -> JsonApiUserSettingInAttributes:
37
+ return JsonApiUserSettingInAttributes(
38
38
  content=self.content,
39
39
  type=self.setting_type,
40
40
  )
@@ -28,7 +28,7 @@ class ObjId:
28
28
 
29
29
  def as_afm_id_label(self) -> afm_models.AfmObjectIdentifierLabel:
30
30
  return afm_models.AfmObjectIdentifierLabel(
31
- identifier=afm_models.AfmObjectIdentifierLabelIdentifier(id=self._id)
31
+ identifier=afm_models.AfmObjectIdentifierLabelIdentifier(id=self._id, type="label")
32
32
  )
33
33
 
34
34
  def as_afm_id_dataset(self) -> afm_models.AfmObjectIdentifierDataset:
@@ -1,20 +1,12 @@
1
1
  # (C) 2022 GoodData Corporation
2
2
  from __future__ import annotations
3
3
 
4
- import json
5
4
  import logging
6
5
  from collections.abc import Iterator
7
6
  from typing import Any, Union
8
7
 
9
8
  from gooddata_api_client import ApiException
10
9
  from gooddata_api_client.model.afm_cancel_tokens import AfmCancelTokens
11
- from gooddata_api_client.model.chat_history_request import ChatHistoryRequest
12
- from gooddata_api_client.model.chat_history_result import ChatHistoryResult
13
- from gooddata_api_client.model.chat_request import ChatRequest
14
- from gooddata_api_client.model.chat_result import ChatResult
15
- from gooddata_api_client.model.saved_visualization import SavedVisualization
16
- from gooddata_api_client.model.search_request import SearchRequest
17
- from gooddata_api_client.model.search_result import SearchResult
18
10
 
19
11
  from gooddata_sdk.client import GoodDataApiClient
20
12
  from gooddata_sdk.compute.model.execution import (
@@ -27,6 +19,10 @@ from gooddata_sdk.compute.visualization_to_sdk_converter import VisualizationToS
27
19
 
28
20
  logger = logging.getLogger(__name__)
29
21
 
22
+ _LEGACY_AI_REMOVED = (
23
+ "The legacy AI chat and search endpoints were removed from the GoodData backend; use the AI Assistant API."
24
+ )
25
+
30
26
 
31
27
  class ComputeService:
32
28
  """
@@ -100,9 +96,7 @@ class ComputeService:
100
96
  )
101
97
  return ResultCacheMetadata(result_cache_metadata=result_cache_metadata)
102
98
 
103
- def build_exec_def_from_chat_result(
104
- self, chat_result: ChatResult, is_cancellable: bool = False
105
- ) -> ExecutionDefinition:
99
+ def build_exec_def_from_chat_result(self, chat_result: Any, is_cancellable: bool = False) -> ExecutionDefinition:
106
100
  """
107
101
  Build execution definition from chat result.
108
102
 
@@ -135,7 +129,7 @@ class ComputeService:
135
129
  is_cancellable=is_cancellable,
136
130
  )
137
131
 
138
- def ai_chat(self, workspace_id: str, question: str) -> ChatResult:
132
+ def ai_chat(self, workspace_id: str, question: str) -> Any:
139
133
  """
140
134
  Chat with AI in GoodData workspace.
141
135
 
@@ -144,21 +138,11 @@ class ComputeService:
144
138
  question (str): question for the AI
145
139
  Returns:
146
140
  ChatResult: Chat response
141
+
142
+ Raises:
143
+ NotImplementedError: The backend no longer serves this endpoint.
147
144
  """
148
- chat_request = ChatRequest(question=question)
149
- response = self._actions_api.ai_chat(workspace_id, chat_request, _check_return_type=False)
150
- return response
151
-
152
- def _parse_sse_events(self, raw: str) -> Iterator[Any]:
153
- """Helper to parse SSE events and yield JSON from data lines."""
154
- events = raw.split("\n\n")
155
- for event in events:
156
- for line in event.split("\n"):
157
- if line.startswith("data:"):
158
- try:
159
- yield json.loads(line[5:].strip())
160
- except json.JSONDecodeError:
161
- continue
145
+ raise NotImplementedError(_LEGACY_AI_REMOVED)
162
146
 
163
147
  def ai_chat_stream(self, workspace_id: str, question: str) -> Iterator[Any]:
164
148
  """
@@ -169,28 +153,18 @@ class ComputeService:
169
153
  question (str): question for the AI
170
154
  Returns:
171
155
  Iterator[Any]: Yields parsed JSON objects from each SSE event's data field
156
+
157
+ Raises:
158
+ NotImplementedError: The backend no longer serves this endpoint.
172
159
  """
173
- chat_request = ChatRequest(question=question)
174
- response = self._actions_api.ai_chat_stream(
175
- workspace_id, chat_request, _check_return_type=False, _preload_content=False
176
- )
177
- buffer = ""
178
- try:
179
- for chunk in response.stream(decode_content=True):
180
- if chunk:
181
- buffer += chunk.decode("utf-8")
182
- *events, buffer = buffer.split("\n\n")
183
- for event in events:
184
- yield from self._parse_sse_events(event)
185
- finally:
186
- response.release_conn()
160
+ raise NotImplementedError(_LEGACY_AI_REMOVED)
187
161
 
188
162
  def get_ai_chat_history(
189
163
  self,
190
164
  workspace_id: str,
191
165
  chat_history_interaction_id: str = "",
192
166
  thread_id_suffix: str = "",
193
- ) -> ChatHistoryResult:
167
+ ) -> Any:
194
168
  """
195
169
  Get chat history with AI in GoodData workspace.
196
170
 
@@ -200,12 +174,11 @@ class ComputeService:
200
174
  thread_id_suffix (str): suffix to identify a specific chat thread. If provided, chat_history_interaction_id is ignored. Defaults to "".
201
175
  Returns:
202
176
  ChatHistoryResult: Chat history response containing interactions and other metadata
177
+
178
+ Raises:
179
+ NotImplementedError: The backend no longer serves this endpoint.
203
180
  """
204
- chat_history_request = ChatHistoryRequest(
205
- chat_history_interaction_id=chat_history_interaction_id, reset=False, thread_id_suffix=thread_id_suffix
206
- )
207
- response = self._actions_api.ai_chat_history(workspace_id, chat_history_request, _check_return_type=False)
208
- return response
181
+ raise NotImplementedError(_LEGACY_AI_REMOVED)
209
182
 
210
183
  def reset_ai_chat_history(self, workspace_id: str) -> None:
211
184
  """
@@ -213,9 +186,11 @@ class ComputeService:
213
186
 
214
187
  Args:
215
188
  workspace_id (str): workspace identifier
189
+
190
+ Raises:
191
+ NotImplementedError: The backend no longer serves this endpoint.
216
192
  """
217
- chat_history_request = ChatHistoryRequest(reset=True)
218
- self._actions_api.ai_chat_history(workspace_id, chat_history_request, _check_return_type=False)
193
+ raise NotImplementedError(_LEGACY_AI_REMOVED)
219
194
 
220
195
  def set_ai_chat_history_feedback(
221
196
  self,
@@ -232,14 +207,11 @@ class ComputeService:
232
207
  user_feedback (str): feedback to provide ("POSITIVE", "NEGATIVE" or "NONE").
233
208
  chat_history_interaction_id (str): interaction id to provide feedback for.
234
209
  thread_id_suffix (str): suffix to identify a specific chat thread. Defaults to "".
210
+
211
+ Raises:
212
+ NotImplementedError: The backend no longer serves this endpoint.
235
213
  """
236
- chat_history_request = ChatHistoryRequest(
237
- user_feedback=user_feedback,
238
- chat_history_interaction_id=chat_history_interaction_id,
239
- thread_id_suffix=thread_id_suffix,
240
- reset=False,
241
- )
242
- self._actions_api.ai_chat_history(workspace_id, chat_history_request, _check_return_type=False)
214
+ raise NotImplementedError(_LEGACY_AI_REMOVED)
243
215
 
244
216
  def set_ai_chat_history_saved_visualization(
245
217
  self,
@@ -258,18 +230,11 @@ class ComputeService:
258
230
  saved_visualization_id (str): id of the saved visualization
259
231
  chat_history_interaction_id (str): interaction id to set saved visualization for.
260
232
  thread_id_suffix (str): suffix to identify a specific chat thread. Defaults to "".
233
+
234
+ Raises:
235
+ NotImplementedError: The backend no longer serves this endpoint.
261
236
  """
262
- saved_visualization = SavedVisualization(
263
- created_visualization_id=created_visualization_id,
264
- saved_visualization_id=saved_visualization_id,
265
- )
266
- chat_history_request = ChatHistoryRequest(
267
- saved_visualization=saved_visualization,
268
- chat_history_interaction_id=chat_history_interaction_id,
269
- thread_id_suffix=thread_id_suffix,
270
- reset=False,
271
- )
272
- self._actions_api.ai_chat_history(workspace_id, chat_history_request, _check_return_type=False)
237
+ raise NotImplementedError(_LEGACY_AI_REMOVED)
273
238
 
274
239
  def search_ai(
275
240
  self,
@@ -280,7 +245,7 @@ class ComputeService:
280
245
  object_types: list[str] | None = None,
281
246
  relevant_score_threshold: float | None = None,
282
247
  title_to_descriptor_ratio: float | None = None,
283
- ) -> SearchResult:
248
+ ) -> Any:
284
249
  """
285
250
  Search for metadata objects using similarity search.
286
251
 
@@ -299,21 +264,11 @@ class ComputeService:
299
264
 
300
265
  Note:
301
266
  Default values for optional parameters are documented in the AI Search endpoint of the GoodData API.
267
+
268
+ Raises:
269
+ NotImplementedError: The backend no longer serves this endpoint.
302
270
  """
303
- search_params: dict[str, Any] = {}
304
- if deep_search is not None:
305
- search_params["deep_search"] = deep_search
306
- if limit is not None:
307
- search_params["limit"] = limit
308
- if object_types is not None:
309
- search_params["object_types"] = object_types
310
- if relevant_score_threshold is not None:
311
- search_params["relevant_score_threshold"] = relevant_score_threshold
312
- if title_to_descriptor_ratio is not None:
313
- search_params["title_to_descriptor_ratio"] = title_to_descriptor_ratio
314
- search_request = SearchRequest(question=question, **search_params)
315
- response = self._actions_api.ai_search(workspace_id, search_request, _check_return_type=False)
316
- return response
271
+ raise NotImplementedError(_LEGACY_AI_REMOVED)
317
272
 
318
273
  def cancel_executions(self, executions: dict[str, dict[str, str]]) -> None:
319
274
  """
@@ -1,8 +1,8 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: gooddata-sdk
3
- Version: 1.76.1.dev4
3
+ Version: 1.77.1.dev1
4
4
  Summary: GoodData Cloud Python SDK
5
- Project-URL: Documentation, https://www.gooddata.ai/docs/python-sdk/1.76.1.dev4
5
+ Project-URL: Documentation, https://www.gooddata.ai/docs/python-sdk/1.77.1.dev1
6
6
  Project-URL: Source, https://github.com/gooddata/gooddata-python-sdk
7
7
  Author-email: GoodData <support@gooddata.com>
8
8
  License-Expression: MIT
@@ -23,7 +23,7 @@ Requires-Python: <4.0,>=3.10
23
23
  Requires-Dist: attrs<=26.1.0,>=21.4.0
24
24
  Requires-Dist: brotli==1.2.0
25
25
  Requires-Dist: cattrs<=26.1.0,>=22.1.0
26
- Requires-Dist: gooddata-api-client~=1.76.1.dev4
26
+ Requires-Dist: gooddata-api-client~=1.77.1.dev1
27
27
  Requires-Dist: gooddata-code-convertors>=11.57.0
28
28
  Requires-Dist: python-dateutil>=2.5.3
29
29
  Requires-Dist: python-dotenv<2.0.0,>=1.2.2
@@ -49,7 +49,7 @@ At the moment the SDK provides services to inspect and interact with the Semanti
49
49
  * Compute Service
50
50
  * Table Service
51
51
 
52
- See [DOCUMENTATION](https://www.gooddata.ai/docs/python-sdk/1.76.1.dev4) for more details.
52
+ See [DOCUMENTATION](https://www.gooddata.ai/docs/python-sdk/1.77.1.dev1) for more details.
53
53
 
54
54
  ## Requirements
55
55
 
@@ -123,7 +123,7 @@ gooddata_sdk/catalog/workspace/entity_model/workspace.py,sha256=t9M-Z-b5LDIkB16x
123
123
  gooddata_sdk/catalog/workspace/entity_model/content_objects/__init__.py,sha256=EtDhuTegucDrXWu2Wp_wy5KXBZq-S4Nv_EQf7YuBxMk,190
124
124
  gooddata_sdk/catalog/workspace/entity_model/content_objects/dataset.py,sha256=iWQKsF9zonPSyP2a1Ny-6y16QhJp9wFHfn5FkeIMh6s,8652
125
125
  gooddata_sdk/catalog/workspace/entity_model/content_objects/metric.py,sha256=antAbvR4A_S70jO86AM1QGzrBfkNT5z-SQUI1bENjIc,847
126
- gooddata_sdk/catalog/workspace/entity_model/content_objects/workspace_setting.py,sha256=VdyA4kdOova6ZkuQNrqYcS4Dn3y7Yl7i7GpDGHdXnLM,2648
126
+ gooddata_sdk/catalog/workspace/entity_model/content_objects/workspace_setting.py,sha256=mN3S0qnYSZgPDpO_hbtLyWithzhb9fwl1D-xrzs7RV4,2608
127
127
  gooddata_sdk/catalog/workspace/entity_model/graph_objects/__init__.py,sha256=EtDhuTegucDrXWu2Wp_wy5KXBZq-S4Nv_EQf7YuBxMk,190
128
128
  gooddata_sdk/catalog/workspace/entity_model/graph_objects/graph.py,sha256=UC1I3jqy9QKoFDcHa1TJ7bvhiaOXVhKeWd-s1jfH6WQ,1853
129
129
  gooddata_sdk/cli/__init__.py,sha256=o1wiahJIlTpKdWT1cA3jML1fRgBu9WCF0NqDIMYkvxA,190
@@ -134,16 +134,16 @@ gooddata_sdk/cli/gdc_core.py,sha256=4lQqfqmAZEgRtKoLNTGsdN5l1ivvXN4unTi-26LhS6I,
134
134
  gooddata_sdk/cli/utils.py,sha256=aj43YTmWZvEWfl8V5k2CUM6gr6Iur_qKZTvRVjoXJPk,1499
135
135
  gooddata_sdk/compute/__init__.py,sha256=EtDhuTegucDrXWu2Wp_wy5KXBZq-S4Nv_EQf7YuBxMk,190
136
136
  gooddata_sdk/compute/compute_to_sdk_converter.py,sha256=gcwyW-PtiBDP22MfIuDRs7m9psiWmc7iiqaBxNMnCy8,9949
137
- gooddata_sdk/compute/service.py,sha256=OSi0QrqUCb3711p5t51KjvkStE6U24X9AvFc_8y8OnY,15119
137
+ gooddata_sdk/compute/service.py,sha256=sbmnPGLz1hKUYb626ac5X3vZdV_ieri8OszCCr29k6I,12380
138
138
  gooddata_sdk/compute/visualization_to_sdk_converter.py,sha256=N_uVyW1_IV_IF4H_Oh92CprDBTny8QFxw3vaw9ZdkW8,5780
139
139
  gooddata_sdk/compute/model/__init__.py,sha256=EtDhuTegucDrXWu2Wp_wy5KXBZq-S4Nv_EQf7YuBxMk,190
140
140
  gooddata_sdk/compute/model/attribute.py,sha256=1b69hsyMgwPKG49VGUkB4pmWngsks2TffjdfrS16iPM,1903
141
- gooddata_sdk/compute/model/base.py,sha256=dlea5AZxscIEDX2UeCHGSPm6J_zKrrTxj_MrA_iJLI8,3139
141
+ gooddata_sdk/compute/model/base.py,sha256=ipcmIE28REefBxhnmsACaKcueW4c4njNdA1wXov0dxo,3153
142
142
  gooddata_sdk/compute/model/execution.py,sha256=7oJvKLwUd4NjUGOSN1HLsMZScja5bGsHv6vxJ2o56mU,21490
143
143
  gooddata_sdk/compute/model/filter.py,sha256=7SKzJboHwPHAkuEuw1tAioXlK8uZoBdK2o2rwaiBK1Q,32609
144
144
  gooddata_sdk/compute/model/metric.py,sha256=lk51dAMEFKKC0pVxiNU3Vl1ujXePR-_XHa0aOYD7Tn4,8430
145
- gooddata_sdk-1.76.1.dev4.dist-info/METADATA,sha256=kcXncrGRcd44yWEGimgFXVtNwDnlRqG2Q8SSBosvpRc,3266
146
- gooddata_sdk-1.76.1.dev4.dist-info/WHEEL,sha256=W3fkpkm7-wf9vBI5Z-7s0eWkeM-spu78I8Neb98DeEg,87
147
- gooddata_sdk-1.76.1.dev4.dist-info/entry_points.txt,sha256=qCWXZSFst-ioZA4uMqpuFfnxQVkvmz7wm_tI24_YXHo,55
148
- gooddata_sdk-1.76.1.dev4.dist-info/licenses/LICENSE.txt,sha256=7SIF-2y4RvjhPUydOEZpgs7MTyURU6JAeELQZmp0J9Q,78443
149
- gooddata_sdk-1.76.1.dev4.dist-info/RECORD,,
145
+ gooddata_sdk-1.77.1.dev1.dist-info/METADATA,sha256=wpNr3ncRcaH7FOUHrTZZqh2XYxckLxBm_U7dQPo5cx4,3266
146
+ gooddata_sdk-1.77.1.dev1.dist-info/WHEEL,sha256=W3fkpkm7-wf9vBI5Z-7s0eWkeM-spu78I8Neb98DeEg,87
147
+ gooddata_sdk-1.77.1.dev1.dist-info/entry_points.txt,sha256=qCWXZSFst-ioZA4uMqpuFfnxQVkvmz7wm_tI24_YXHo,55
148
+ gooddata_sdk-1.77.1.dev1.dist-info/licenses/LICENSE.txt,sha256=7SIF-2y4RvjhPUydOEZpgs7MTyURU6JAeELQZmp0J9Q,78443
149
+ gooddata_sdk-1.77.1.dev1.dist-info/RECORD,,