gooddata-pandas 1.34.1.dev1__py3-none-any.whl → 1.35.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.
Potentially problematic release.
This version of gooddata-pandas might be problematic. Click here for more details.
- gooddata_pandas/data_access.py +3 -7
- gooddata_pandas/utils.py +21 -0
- {gooddata_pandas-1.34.1.dev1.dist-info → gooddata_pandas-1.35.1.dev1.dist-info}/METADATA +3 -3
- {gooddata_pandas-1.34.1.dev1.dist-info → gooddata_pandas-1.35.1.dev1.dist-info}/RECORD +7 -7
- {gooddata_pandas-1.34.1.dev1.dist-info → gooddata_pandas-1.35.1.dev1.dist-info}/LICENSE.txt +0 -0
- {gooddata_pandas-1.34.1.dev1.dist-info → gooddata_pandas-1.35.1.dev1.dist-info}/WHEEL +0 -0
- {gooddata_pandas-1.34.1.dev1.dist-info → gooddata_pandas-1.35.1.dev1.dist-info}/top_level.txt +0 -0
gooddata_pandas/data_access.py
CHANGED
|
@@ -16,7 +16,7 @@ from gooddata_sdk import (
|
|
|
16
16
|
ObjId,
|
|
17
17
|
TableDimension,
|
|
18
18
|
)
|
|
19
|
-
from gooddata_sdk.utils import IdObjType
|
|
19
|
+
from gooddata_sdk.utils import IdObjType
|
|
20
20
|
|
|
21
21
|
from gooddata_pandas.utils import (
|
|
22
22
|
ColumnsDef,
|
|
@@ -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,12 +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
|
-
|
|
450
|
-
# if there is to many labels then all attributes are fetched and no rsql filter is used
|
|
451
|
-
# it prevention again 414 Request-URI Too Long
|
|
452
|
-
attributes = sdk.catalog_workspace_content.get_attributes_catalog(
|
|
453
|
-
workspace_id, include=["labels", "datasets"], rsql_filter=filter_query
|
|
454
|
-
)
|
|
450
|
+
attributes = get_catalog_attributes_for_extract(sdk, workspace_id, exec_def.attributes)
|
|
455
451
|
return _extract_from_attributes_and_maybe_metrics(
|
|
456
452
|
response,
|
|
457
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.
|
|
3
|
+
Version: 1.35.1.dev1
|
|
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.
|
|
8
|
+
Project-URL: Documentation, https://gooddata-pandas.readthedocs.io/en/v1.35.1.dev1
|
|
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.
|
|
26
|
+
Requires-Dist: gooddata-sdk~=1.35.1.dev1
|
|
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=
|
|
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=
|
|
10
|
-
gooddata_pandas-1.
|
|
11
|
-
gooddata_pandas-1.
|
|
12
|
-
gooddata_pandas-1.
|
|
13
|
-
gooddata_pandas-1.
|
|
14
|
-
gooddata_pandas-1.
|
|
9
|
+
gooddata_pandas/utils.py,sha256=JhWs0WYqg-9o3aWRP21ERFAxCKoT5oNKQ5mKlJh4uT4,8091
|
|
10
|
+
gooddata_pandas-1.35.1.dev1.dist-info/LICENSE.txt,sha256=3RjzQk8y9HG1_LgqvbEqWZKJnTQGOO1cpzYzBc13Myk,149825
|
|
11
|
+
gooddata_pandas-1.35.1.dev1.dist-info/METADATA,sha256=6lbBrwULCQPVjZu69vV0qGnky8-35oNeYVKKh9V328U,3126
|
|
12
|
+
gooddata_pandas-1.35.1.dev1.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
|
13
|
+
gooddata_pandas-1.35.1.dev1.dist-info/top_level.txt,sha256=B7K_WFxlxplJbEbv5Mf0YhX74dbOpTPgDX-W6I7CssI,16
|
|
14
|
+
gooddata_pandas-1.35.1.dev1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
{gooddata_pandas-1.34.1.dev1.dist-info → gooddata_pandas-1.35.1.dev1.dist-info}/top_level.txt
RENAMED
|
File without changes
|