Skip to content

Commit 9d40327

Browse files
authored
Merge pull request #686 from hkad98/remove-deprecated
feat: remove deprecated occurrence of `insight`
2 parents c0626b8 + 714b376 commit 9d40327

12 files changed

Lines changed: 15 additions & 196 deletions

File tree

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ But there is one disadvantage. One needs GD.CN instance with the original setup
178178
`docker-compose.yaml` in root of the repository is here to help. It starts:
179179
- GD.CN AIO in selected version
180180
- postgres with gooddata-fdw extension
181-
- service which setups GD.CN AIO demo project including PDM, LDM, metrics and insights
181+
- service which setups GD.CN AIO demo project including PDM, LDM, metrics and visualizations
182182
183183
When a vcrpy supported test needs to be updated:
184184
- start GD.CN using above `docker-compose.yaml`

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Check out the GoodData Pandas [documentation](https://gooddata-pandas.readthedoc
3333
> GoodData Foreign Data Wrapper is currently deprecated.
3434
3535
The [gooddata-fdw](./gooddata-fdw) package provides a way
36-
to map GoodData Cloud semantic layer and/or insights stored in your GoodData Cloud
36+
to map GoodData Cloud semantic layer and/or visualizations stored in your GoodData Cloud
3737
into PostgreSQL as foreign tables that you can then query using SQL.
3838

3939
Check out the GoodData Foreign Data Wrapper [documentation](https://gooddata-fdw.readthedocs.io/en/latest/) to learn more and get started.

gooddata-dbt/gooddata_dbt/gooddata/api_wrapper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def __init__(self, sdk: GoodDataSdk, logger: logging.Logger, dry_run: bool = Fal
3737

3838
def get_visualizations(self, workspace_id: str) -> List[Visualization]:
3939
if self.dry_run:
40-
self.logger.info("Dry run - skipping insights listing")
40+
self.logger.info("Dry run - skipping visualizations listing")
4141
return []
4242
else:
4343
return self.sdk.visualizations.get_visualizations(workspace_id)

gooddata-pandas/docs/examples.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,9 @@ Data Frames
7171
)
7272
)
7373
74-
# create data frame based on the contents of the insight. if the insight contains labels and
74+
# create data frame based on the contents of the visualization. if the visualization contains labels and
7575
# measures, the data frame will contain index or hierarchical index.
76-
insight_df = frames.for_insight('insight_id')
76+
visualization_df = frames.for_visualization('visualization_id')
7777
7878
# create data frame based on the content of the items dict. if the dict contains both labels
7979
# and measures, the frame will contain index or hierarchical index.

gooddata-pandas/gooddata_pandas/dataframe.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
from __future__ import annotations
33

44
from typing import Optional, Tuple, Union
5-
from warnings import warn
65

76
import pandas
87
from gooddata_api_client import models
@@ -184,15 +183,6 @@ def for_visualization(self, visualization_id: str, auto_index: bool = True) -> p
184183

185184
return self.for_items(columns, filter_by=filter_by, auto_index=auto_index)
186185

187-
def for_insight(self, insight_id: str, auto_index: bool = True) -> pandas.DataFrame:
188-
warn(
189-
"This method is deprecated and it will be removed in v1.20.0 release. "
190-
"Please use 'for_visualization' method instead.",
191-
DeprecationWarning,
192-
stacklevel=2,
193-
)
194-
return self.for_visualization(insight_id, auto_index)
195-
196186
def result_cache_metadata_for_exec_result_id(self, result_id: str) -> ResultCacheMetadata:
197187
"""
198188
Retrieves result cache metadata for given :result_id:

gooddata-sdk/README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ At the moment the SDK provides services to inspect and interact with the Semanti
99
* Catalog User Service
1010
* Catalog Permission Service
1111
* Catalog Organization Service
12-
* Insights Service
12+
* Visualizations Service
1313
* Compute Service
1414
* Table Service
1515

@@ -28,7 +28,7 @@ Run the following command to install the `gooddata-sdk` package on your system:
2828

2929
## Example
3030

31-
Compute an insight:
31+
Compute an visualization:
3232
```python
3333
import gooddata_sdk
3434

@@ -39,11 +39,11 @@ token = "some_user_token"
3939
sdk = gooddata_sdk.GoodDataSdk.create(host, token)
4040

4141
workspace_id = "demo"
42-
insight_id = "customers_trend"
43-
# reads insight from workspace
44-
insight = sdk.visualizations.get_visualization(workspace_id, insight_id)
45-
# triggers computation for the insight. the result will be returned in a tabular form
46-
table = sdk.tables.for_visualization(workspace_id, insight)
42+
visualization_id = "customers_trend"
43+
# reads visualization from workspace
44+
visualization = sdk.visualizations.get_visualization(workspace_id, visualization_id)
45+
# triggers computation for the visualization. the result will be returned in a tabular form
46+
table = sdk.tables.for_visualization(workspace_id, visualization)
4747

4848
# and this is how you can read data row-by-row and do something with it
4949
for row in table.read_all():

gooddata-sdk/gooddata_sdk/__init__.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -230,11 +230,6 @@
230230
from gooddata_sdk.table import ExecutionTable, TableService
231231
from gooddata_sdk.utils import SideLoads
232232
from gooddata_sdk.visualization import (
233-
Insight,
234-
InsightAttribute,
235-
InsightBucket,
236-
InsightMetric,
237-
InsightService,
238233
Visualization,
239234
VisualizationAttribute,
240235
VisualizationBucket,

gooddata-sdk/gooddata_sdk/catalog/export/service.py

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import time
33
from pathlib import Path
44
from typing import Callable, Optional, Tuple, Union
5-
from warnings import warn
65

76
from gooddata_api_client.exceptions import NotFoundException
87
from gooddata_api_client.model.pdf_export_request import PdfExportRequest
@@ -284,15 +283,6 @@ def _get_visualization_exec_table(self, workspace_id: str, visualization_id: str
284283
f"or visualization visualization_id='{visualization_id}' does not exist."
285284
)
286285

287-
def _get_insight_exec_table(self, workspace_id: str, insight_id: str) -> Tuple[ExecutionTable, str]:
288-
warn(
289-
"This method is deprecated and it will be removed in v1.20.0 release. "
290-
"Please use '_get_visualization_exec_table' method instead.",
291-
DeprecationWarning,
292-
stacklevel=2,
293-
)
294-
return self._get_visualization_exec_table(workspace_id, insight_id)
295-
296286
def export_tabular_by_visualization_id(
297287
self,
298288
workspace_id: str,
@@ -341,33 +331,3 @@ def export_tabular_by_visualization_id(
341331
retry=retry,
342332
max_retry=max_retry,
343333
)
344-
345-
def export_tabular_by_insight_id(
346-
self,
347-
workspace_id: str,
348-
insight_id: str,
349-
file_format: str,
350-
file_name: Optional[str] = None,
351-
settings: Optional[ExportSettings] = None,
352-
store_path: Union[str, Path] = Path.cwd(),
353-
timeout: float = 60.0,
354-
retry: float = 0.2,
355-
max_retry: float = 5.0,
356-
) -> None:
357-
warn(
358-
"This method is deprecated and it will be removed in v1.20.0 release. "
359-
"Please use 'export_tabular_by_visualization_id' method instead.",
360-
DeprecationWarning,
361-
stacklevel=2,
362-
)
363-
self.export_tabular_by_visualization_id(
364-
workspace_id,
365-
insight_id,
366-
file_format,
367-
file_name,
368-
settings,
369-
store_path,
370-
timeout,
371-
retry,
372-
max_retry,
373-
)

gooddata-sdk/gooddata_sdk/sdk.py

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
from pathlib import Path
55
from typing import Optional
6-
from warnings import warn
76

87
from gooddata_sdk.catalog.data_source.service import CatalogDataSourceService
98
from gooddata_sdk.catalog.export.service import ExportService
@@ -17,7 +16,7 @@
1716
from gooddata_sdk.support import SupportService
1817
from gooddata_sdk.table import TableService
1918
from gooddata_sdk.utils import PROFILES_FILE_PATH, profile_content
20-
from gooddata_sdk.visualization import InsightService, VisualizationService
19+
from gooddata_sdk.visualization import VisualizationService
2120

2221

2322
class GoodDataSdk:
@@ -74,7 +73,6 @@ def __init__(self, client: GoodDataApiClient) -> None:
7473
self._catalog_organization = CatalogOrganizationService(self._client)
7574
self._catalog_user = CatalogUserService(self._client)
7675
self._compute = ComputeService(self._client)
77-
self._insights = InsightService(self._client)
7876
self._visualizations = VisualizationService(self._client)
7977
self._tables = TableService(self._client)
8078
self._support = SupportService(self._client)
@@ -101,16 +99,6 @@ def catalog_organization(self) -> CatalogOrganizationService:
10199
def compute(self) -> ComputeService:
102100
return self._compute
103101

104-
@property
105-
def insights(self) -> InsightService:
106-
warn(
107-
"This property is deprecated and it will be removed in v1.20.0 release. "
108-
"Please use 'visualizations' property instead.",
109-
DeprecationWarning,
110-
stacklevel=2,
111-
)
112-
return self._insights
113-
114102
@property
115103
def visualizations(self) -> VisualizationService:
116104
return self._visualizations

gooddata-sdk/gooddata_sdk/table.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import logging
55
from operator import attrgetter
66
from typing import Any, Callable, Dict, Generator, List, Optional, Union
7-
from warnings import warn
87

98
from attrs import define, field, frozen
109
from attrs.setters import frozen as frozen_attr
@@ -25,7 +24,6 @@
2524
from gooddata_sdk.visualization import (
2625
AttributeSortType,
2726
BucketType,
28-
Insight,
2927
LocatorItemType,
3028
SortDirection,
3129
SortType,
@@ -785,15 +783,6 @@ def for_visualization(self, workspace_id: str, visualization: Visualization) ->
785783
response = self._compute.for_exec_def(workspace_id=workspace_id, exec_def=exec_def)
786784
return _as_table(response)
787785

788-
def for_insight(self, workspace_id: str, insight: Insight) -> ExecutionTable:
789-
warn(
790-
"This method is deprecated and it will be removed in v1.20.0 release. "
791-
"Please use 'for_visualization' method instead.",
792-
DeprecationWarning,
793-
stacklevel=2,
794-
)
795-
return self.for_visualization(workspace_id=workspace_id, visualization=insight)
796-
797786
def for_items(
798787
self, workspace_id: str, items: list[Union[Attribute, Metric]], filters: Optional[list[Filter]] = None
799788
) -> ExecutionTable:

0 commit comments

Comments
 (0)