gooddata-pandas 1.34.0__py3-none-any.whl → 1.35.0__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.

Potentially problematic release.


This version of gooddata-pandas might be problematic. Click here for more details.

@@ -26,6 +26,7 @@ from gooddata_pandas.utils import (
26
26
  _to_attribute,
27
27
  _to_item,
28
28
  _typed_attribute_value,
29
+ get_catalog_attributes_for_extract,
29
30
  )
30
31
 
31
32
 
@@ -446,7 +447,7 @@ def compute_and_extract(
446
447
  if not exec_def.has_attributes():
447
448
  return _extract_for_metrics_only(response, cols, col_to_metric_idx), dict()
448
449
  else:
449
- attributes = sdk.catalog_workspace_content.get_attributes_catalog(workspace_id, include=["labels", "datasets"])
450
+ attributes = get_catalog_attributes_for_extract(sdk, workspace_id, exec_def.attributes)
450
451
  return _extract_from_attributes_and_maybe_metrics(
451
452
  response,
452
453
  attributes,
gooddata_pandas/utils.py CHANGED
@@ -9,6 +9,7 @@ import pandas
9
9
  from gooddata_sdk import (
10
10
  Attribute,
11
11
  CatalogAttribute,
12
+ GoodDataSdk,
12
13
  Metric,
13
14
  ObjId,
14
15
  SimpleMetric,
@@ -16,6 +17,7 @@ from gooddata_sdk import (
16
17
  VisualizationMetric,
17
18
  )
18
19
  from gooddata_sdk.type_converter import AttributeConverterStore, DateConverter, DatetimeConverter, IntegerConverter
20
+ from gooddata_sdk.utils import filter_for_attributes_labels
19
21
  from pandas import Index, MultiIndex
20
22
 
21
23
  LabelItemDef = Union[Attribute, ObjId, str]
@@ -29,6 +31,25 @@ DateConverter.set_external_fnc(lambda self, value: pandas.to_datetime(value))
29
31
  DatetimeConverter.set_external_fnc(lambda self, value: pandas.to_datetime(value))
30
32
 
31
33
 
34
+ def get_catalog_attributes_for_extract(
35
+ sdk: GoodDataSdk, workspace_id: str, attributes: list[Attribute], character_limit: int = 1500
36
+ ) -> list[CatalogAttribute]:
37
+ """
38
+ Get catalog attributes for the given attributes.
39
+ It uses the filter_for_attributes_labels function to get the
40
+ RSQL queries for the attributes and then fetches the catalog attributes for the given workspace.
41
+ This approach prevents loading all catalog attributes providing significant speed-up.
42
+ """
43
+ rsql_queries = filter_for_attributes_labels(attributes, character_limit)
44
+ return [
45
+ attr
46
+ for query in rsql_queries
47
+ for attr in sdk.catalog_workspace_content.get_attributes_catalog(
48
+ workspace_id, include=["labels", "datasets"], rsql_filter=query
49
+ )
50
+ ]
51
+
52
+
32
53
  def _unique_local_id() -> str:
33
54
  """
34
55
  Generate unique local ID of a DataItem without dashes.
@@ -1,11 +1,11 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: gooddata-pandas
3
- Version: 1.34.0
3
+ Version: 1.35.0
4
4
  Summary: GoodData Cloud to pandas
5
5
  Author: GoodData
6
6
  Author-email: support@gooddata.com
7
7
  License: MIT
8
- Project-URL: Documentation, https://gooddata-pandas.readthedocs.io/en/v1.34.0
8
+ Project-URL: Documentation, https://gooddata-pandas.readthedocs.io/en/v1.35.0
9
9
  Project-URL: Source, https://github.com/gooddata/gooddata-python-sdk
10
10
  Keywords: gooddata,pandas,series,data,frame,data_frame,analytics,headless,business,intelligence,headless-bi,cloud,native,semantic,layer,sql,metrics
11
11
  Classifier: Development Status :: 5 - Production/Stable
@@ -23,7 +23,7 @@ Classifier: Typing :: Typed
23
23
  Requires-Python: >=3.9.0
24
24
  Description-Content-Type: text/markdown
25
25
  License-File: LICENSE.txt
26
- Requires-Dist: gooddata-sdk~=1.34.0
26
+ Requires-Dist: gooddata-sdk~=1.35.0
27
27
  Requires-Dist: pandas<3.0.0,>=2.0.0
28
28
  Dynamic: author
29
29
  Dynamic: author-email
@@ -1,14 +1,14 @@
1
1
  gooddata_pandas/__init__.py,sha256=Ta3qIIDq7kBRUsYSV3aC69AQBFvFvhtWDQucgP-l88w,297
2
2
  gooddata_pandas/_version.py,sha256=960vTs6l7xsN2BOXWCxOc4PSKdzzKhnNEPTMnmMTCQs,119
3
- gooddata_pandas/data_access.py,sha256=u64xnvPUCHmF41A6I02A1bhqmszuPNzoKuycIH6y3jc,19109
3
+ gooddata_pandas/data_access.py,sha256=pIy_AWKabMUIxIRdoAGJrDIeZ_zvGWUv9ntP3OBx7Oc,19125
4
4
  gooddata_pandas/dataframe.py,sha256=SeNIx-tlf7PjmGppkhNDPEl8RQN6BRKOC3UJ89uFnjo,13000
5
5
  gooddata_pandas/good_pandas.py,sha256=ePEm2Lmeiftz5td0BLC71q7my5Aj8aABn3xV0myRmqI,3444
6
6
  gooddata_pandas/py.typed,sha256=u_MS29sadlaIqGRPYFjWml5u0gQnoQfvbsf9pu3TZJU,94
7
7
  gooddata_pandas/result_convertor.py,sha256=r7uFrjeM6cxMy08YcS3LywF1iUPSyEyG3BAddh0DkIQ,25807
8
8
  gooddata_pandas/series.py,sha256=wTvJR_I0FUteyxo4RwHzP20eU7rei0dP8ZdqfrLbf5c,5759
9
- gooddata_pandas/utils.py,sha256=JQZOuGjDfpPZqBnz-KdN8EwjzXXTbQCONWmUEE3cY9M,7217
10
- gooddata_pandas-1.34.0.dist-info/LICENSE.txt,sha256=3RjzQk8y9HG1_LgqvbEqWZKJnTQGOO1cpzYzBc13Myk,149825
11
- gooddata_pandas-1.34.0.dist-info/METADATA,sha256=Ev77j5iDMB0PSDkVoyQxGdizlWfgE_6U3RI1ORrYD74,3111
12
- gooddata_pandas-1.34.0.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
13
- gooddata_pandas-1.34.0.dist-info/top_level.txt,sha256=B7K_WFxlxplJbEbv5Mf0YhX74dbOpTPgDX-W6I7CssI,16
14
- gooddata_pandas-1.34.0.dist-info/RECORD,,
9
+ gooddata_pandas/utils.py,sha256=JhWs0WYqg-9o3aWRP21ERFAxCKoT5oNKQ5mKlJh4uT4,8091
10
+ gooddata_pandas-1.35.0.dist-info/LICENSE.txt,sha256=3RjzQk8y9HG1_LgqvbEqWZKJnTQGOO1cpzYzBc13Myk,149825
11
+ gooddata_pandas-1.35.0.dist-info/METADATA,sha256=wZL4vdLBhDaoO9mKBWIMf9cIsPMVAXopiuRJYp0cJC4,3111
12
+ gooddata_pandas-1.35.0.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
13
+ gooddata_pandas-1.35.0.dist-info/top_level.txt,sha256=B7K_WFxlxplJbEbv5Mf0YhX74dbOpTPgDX-W6I7CssI,16
14
+ gooddata_pandas-1.35.0.dist-info/RECORD,,