gooddata-pandas 1.10.0__py3-none-any.whl → 1.11.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/result_convertor.py +15 -11
- {gooddata_pandas-1.10.0.dist-info → gooddata_pandas-1.11.1.dev1.dist-info}/METADATA +3 -3
- {gooddata_pandas-1.10.0.dist-info → gooddata_pandas-1.11.1.dev1.dist-info}/RECORD +6 -6
- {gooddata_pandas-1.10.0.dist-info → gooddata_pandas-1.11.1.dev1.dist-info}/LICENSE.txt +0 -0
- {gooddata_pandas-1.10.0.dist-info → gooddata_pandas-1.11.1.dev1.dist-info}/WHEEL +0 -0
- {gooddata_pandas-1.10.0.dist-info → gooddata_pandas-1.11.1.dev1.dist-info}/top_level.txt +0 -0
|
@@ -30,7 +30,7 @@ class _DataWithHeaders:
|
|
|
30
30
|
data: List[_DataArray]
|
|
31
31
|
data_headers: Tuple[_DataHeaders, Optional[_DataHeaders]]
|
|
32
32
|
grand_totals: Tuple[Optional[List[_DataArray]], Optional[List[_DataArray]]]
|
|
33
|
-
grand_total_headers: Tuple[Optional[_DataHeaders], Optional[_DataHeaders]]
|
|
33
|
+
grand_total_headers: Tuple[Optional[List[Dict[str, _DataHeaders]]], Optional[List[Dict[str, _DataHeaders]]]]
|
|
34
34
|
|
|
35
35
|
|
|
36
36
|
@define
|
|
@@ -50,7 +50,9 @@ class _AccumulatedData:
|
|
|
50
50
|
data: List[_DataArray] = field(init=False, factory=list)
|
|
51
51
|
data_headers: List[Optional[_DataHeaders]] = field(init=False, factory=lambda: [None, None])
|
|
52
52
|
grand_totals: List[Optional[List[_DataArray]]] = field(init=False, factory=lambda: [None, None])
|
|
53
|
-
grand_totals_headers: List[Optional[_DataHeaders]] = field(
|
|
53
|
+
grand_totals_headers: List[Optional[List[Dict[str, _DataHeaders]]]] = field(
|
|
54
|
+
init=False, factory=lambda: [None, None]
|
|
55
|
+
)
|
|
54
56
|
|
|
55
57
|
def accumulate_data(self, from_result: ExecutionResult) -> None:
|
|
56
58
|
"""
|
|
@@ -119,6 +121,14 @@ class _AccumulatedData:
|
|
|
119
121
|
for grand_total in grand_totals:
|
|
120
122
|
# 2-dim results have always 1-dim grand totals (3-dim results have 2-dim gt but DataFrame stores 2D only)
|
|
121
123
|
dims = grand_total["totalDimensions"]
|
|
124
|
+
|
|
125
|
+
# if dims are empty then data contain total of column and row grandtotals so extend existing data array
|
|
126
|
+
if len(dims) == 0:
|
|
127
|
+
grand_totals_item = cast(List[_DataArray], self.grand_totals[0])
|
|
128
|
+
for total_idx, total_data in enumerate(grand_total["data"]):
|
|
129
|
+
grand_totals_item[total_idx].extend(total_data)
|
|
130
|
+
continue
|
|
131
|
+
|
|
122
132
|
assert len(dims) == 1, "Only 2-dimensional results are supported"
|
|
123
133
|
dim_idx = dim_idx_dict[dims[0]]
|
|
124
134
|
# the dimension id specified on the grand total says from what dimension were
|
|
@@ -134,11 +144,7 @@ class _AccumulatedData:
|
|
|
134
144
|
# grand totals not initialized yet; initialize both data and headers by making
|
|
135
145
|
# a shallow copy from the results
|
|
136
146
|
self.grand_totals[opposite_dim] = grand_total["data"][:]
|
|
137
|
-
|
|
138
|
-
# measure header defs are under ["headerGroups"][>0]
|
|
139
|
-
self.grand_totals_headers[opposite_dim] = grand_total["dimensionHeaders"][0]["headerGroups"][0][
|
|
140
|
-
"headers"
|
|
141
|
-
][:]
|
|
147
|
+
self.grand_totals_headers[opposite_dim] = grand_total["dimensionHeaders"][0]["headerGroups"]
|
|
142
148
|
elif paging_dim != opposite_dim:
|
|
143
149
|
# grand totals are already initialized and the code is paging in the direction that reveals
|
|
144
150
|
# additional grand total values; append them accordingly; no need to consider total headers:
|
|
@@ -446,10 +452,8 @@ def _merge_grand_total_headers_into_headers(extract: _DataWithHeaders) -> Tuple[
|
|
|
446
452
|
if grand_total_headers is None:
|
|
447
453
|
continue
|
|
448
454
|
header = cast(List[List[Any]], headers[dim_idx])
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
for other_headers in header[1:]:
|
|
452
|
-
other_headers.extend(padding)
|
|
455
|
+
for level, grand_total_header in enumerate(grand_total_headers):
|
|
456
|
+
header[level].extend(grand_total_header["headers"])
|
|
453
457
|
|
|
454
458
|
return headers
|
|
455
459
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: gooddata-pandas
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.11.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.11.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
|
|
@@ -22,7 +22,7 @@ Classifier: Typing :: Typed
|
|
|
22
22
|
Requires-Python: >=3.8.0
|
|
23
23
|
Description-Content-Type: text/markdown
|
|
24
24
|
License-File: LICENSE.txt
|
|
25
|
-
Requires-Dist: gooddata-sdk ~=1.
|
|
25
|
+
Requires-Dist: gooddata-sdk ~=1.11.1.dev1
|
|
26
26
|
Requires-Dist: pandas <2.0.0,>=1.0.0
|
|
27
27
|
|
|
28
28
|
# GoodData Pandas
|
|
@@ -4,11 +4,11 @@ gooddata_pandas/data_access.py,sha256=8o7N2lC_tUU-3ht2RZm0osB4bYA-YQq8sCQauDaJSs
|
|
|
4
4
|
gooddata_pandas/dataframe.py,sha256=bpCpTBpne_qmgLQ44EJxJ8IUC-Kw0UzLaVNt89ugvO0,12655
|
|
5
5
|
gooddata_pandas/good_pandas.py,sha256=9E8sSGppJaxW-eMCdY2rR_7k5hdlAPQqv4djfkvllcg,3443
|
|
6
6
|
gooddata_pandas/py.typed,sha256=u_MS29sadlaIqGRPYFjWml5u0gQnoQfvbsf9pu3TZJU,94
|
|
7
|
-
gooddata_pandas/result_convertor.py,sha256=
|
|
7
|
+
gooddata_pandas/result_convertor.py,sha256=UES4Zt4633A_RGyq-UMms4l2rhABWcRjKViDd-kjo4w,23035
|
|
8
8
|
gooddata_pandas/series.py,sha256=UmfYvX0RhuRsItXPDm-kFo5CBT73qkro_WtYEITgg1g,5759
|
|
9
9
|
gooddata_pandas/utils.py,sha256=RtOnyjHkzsOo8kpAvw_puEkI7EkqdHmOwPD3kV26RS0,7144
|
|
10
|
-
gooddata_pandas-1.
|
|
11
|
-
gooddata_pandas-1.
|
|
12
|
-
gooddata_pandas-1.
|
|
13
|
-
gooddata_pandas-1.
|
|
14
|
-
gooddata_pandas-1.
|
|
10
|
+
gooddata_pandas-1.11.1.dev1.dist-info/LICENSE.txt,sha256=CTs8U6T7MmKBKFFiQYARwgCfWgUzdosq01DI298WFiY,77209
|
|
11
|
+
gooddata_pandas-1.11.1.dev1.dist-info/METADATA,sha256=MP3ujPRy8Y_fSyX-6rY8ZAFFWs1XZURRDEDDxfM8Wpo,2842
|
|
12
|
+
gooddata_pandas-1.11.1.dev1.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
|
13
|
+
gooddata_pandas-1.11.1.dev1.dist-info/top_level.txt,sha256=B7K_WFxlxplJbEbv5Mf0YhX74dbOpTPgDX-W6I7CssI,16
|
|
14
|
+
gooddata_pandas-1.11.1.dev1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|