You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -1 +1 @@-gzip compressed data, was "gooddata-pandas-1.9.0.tar", last modified: Thu Nov 16 13:25:00 2023, max compression+gzip compressed data, was "gooddata-pandas-1.9.1.dev1.tar", last modified: Thu Dec 14 13:21:12 2023, max compression
@@ -1,15 +1,15 @@
Metadata-Version: 2.1
Name: gooddata-pandas
-Version: 1.9.0+Version: 1.9.1.dev1
Summary: GoodData Cloud to pandas
Author: GoodData
Author-email: [email protected]
License: MIT
-Project-URL: Documentation, https://gooddata-pandas.readthedocs.io/en/v1.9.0+Project-URL: Documentation, https://gooddata-pandas.readthedocs.io/en/v1.9.1.dev1
Project-URL: Source, https://github.com/gooddata/gooddata-python-sdk
Keywords: gooddata,pandas,series,data,frame,data_frame,analytics,headless,business,intelligence,headless-bi,cloud,native,semantic,layer,sql,metrics
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Console
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
@@ -18,30 +18,30 @@
Classifier: Topic :: Database
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Software Development
Classifier: Typing :: Typed
Requires-Python: >=3.8.0
Description-Content-Type: text/markdown
License-File: LICENSE.txt
-Requires-Dist: gooddata-sdk~=1.9.0+Requires-Dist: gooddata-sdk~=1.9.1.dev1
Requires-Dist: pandas<2.0.0,>=1.0.0
# GoodData Pandas
This package contains a thin layer that utilizes gooddata-sdk and allows you to conveniently create pandas series and
data frames from the computations done against semantic model in your [GoodData.CN](https://www.gooddata.com/developers/cloud-native/) workspace.
See [DOCUMENTATION](https://gooddata-pandas.readthedocs.io/en/latest/) for more details.
## Requirements
- GoodData.CN installation; either running on your cloud
infrastructure or the free Community Edition running on your workstation
-- Python 3.7 or newer+- Python 3.8 or newer
## Installation
Run the following command to install the `gooddata-pandas` package on your system:
pip install gooddata-pandas
@@ -6,15 +6,15 @@
See [DOCUMENTATION](https://gooddata-pandas.readthedocs.io/en/latest/) for more details.
## Requirements
- GoodData.CN installation; either running on your cloud
infrastructure or the free Community Edition running on your workstation
-- Python 3.7 or newer+- Python 3.8 or newer
## Installation
Run the following command to install the `gooddata-pandas` package on your system:
pip install gooddata-pandas
@@ -26,15 +26,15 @@
grand_total_headers (Tuple[Optional[_DataHeaders], Optional[_DataHeaders]]):
Per-dimension grand total headers.
"""
data: List[_DataArray]
data_headers: Tuple[_DataHeaders, Optional[_DataHeaders]]
grand_totals: Tuple[Optional[List[_DataArray]], Optional[List[_DataArray]]]
- grand_total_headers: Tuple[Optional[_DataHeaders], Optional[_DataHeaders]]+ grand_total_headers: Tuple[Optional[List[Dict[str, _DataHeaders]]], Optional[List[Dict[str, _DataHeaders]]]]
@define
class _AccumulatedData:
"""
Utility class to offload code from the function that extracts all data and headers for a
particular paged result. The method drives the paging and calls out to this class to accumulate
@@ -46,15 +46,17 @@
grand_totals (List[Optional[List[_DataArray]]]): Holds the grand total data arrays.
grand_totals_headers (List[Optional[_DataHeaders]]): Holds the headers for grand total data arrays.
"""
data: List[_DataArray] = field(init=False, factory=list)
data_headers: List[Optional[_DataHeaders]] = field(init=False, factory=lambda: [None, None])
grand_totals: List[Optional[List[_DataArray]]] = field(init=False, factory=lambda: [None, None])
- grand_totals_headers: List[Optional[_DataHeaders]] = field(init=False, factory=lambda: [None, None])+ grand_totals_headers: List[Optional[List[Dict[str, _DataHeaders]]]] = field(+ init=False, factory=lambda: [None, None]+ )
def accumulate_data(self, from_result: ExecutionResult) -> None:
"""
Accumulate data from the ExecutionResult.
If the result is one-dimensional, the data is a single array, so this adds the elements of that array
into 'data'. If it's two-dimensional, the data is an array of arrays, so this adds as many arrays as
@@ -115,14 +117,22 @@
# get dimension indexes mapping from response like {"dim1": 0, "dim0": 1}
dim_idx_dict = {dim["localIdentifier"]: idx for idx, dim in enumerate(response.dimensions)}
for grand_total in grand_totals:
# 2-dim results have always 1-dim grand totals (3-dim results have 2-dim gt but DataFrame stores 2D only)
dims = grand_total["totalDimensions"]
++ # if dims are empty then data contain total of column and row grandtotals so extend existing data array+ if len(dims) == 0:+ grand_totals_item = cast(List[_DataArray], self.grand_totals[0])+ for total_idx, total_data in enumerate(grand_total["data"]):+ grand_totals_item[total_idx].extend(total_data)+ continue+
assert len(dims) == 1, "Only 2-dimensional results are supported"
dim_idx = dim_idx_dict[dims[0]]
# the dimension id specified on the grand total says from what dimension were
# the grand totals calculated (1 for column totals or 0 for row totals);
#
# the grand totals themselves should, however be placed in the opposite dimension:
#
@@ -130,19 +140,15 @@
# row totals are extra columns at the right 'edge' of the data
opposite_dim = 1 if dim_idx == 0 else 0
if self.grand_totals[opposite_dim] is None:
# grand totals not initialized yet; initialize both data and headers by making
# a shallow copy from the results
self.grand_totals[opposite_dim] = grand_total["data"][:]
- # TODO: row total measure headers are currently not supported (only aggregation info w/o measure label)- # measure header defs are under ["headerGroups"][>0]- self.grand_totals_headers[opposite_dim] = grand_total["dimensionHeaders"][0]["headerGroups"][0][- "headers"- ][:]+ self.grand_totals_headers[opposite_dim] = grand_total["dimensionHeaders"][0]["headerGroups"]
elif paging_dim != opposite_dim:
# grand totals are already initialized and the code is paging in the direction that reveals
# additional grand total values; append them accordingly; no need to consider total headers:
# that is because only the grand total data is subject to paging
grand_totals_item = cast(List[_DataArray], self.grand_totals[opposite_dim])
if opposite_dim == 0:
# have column totals and paging 'to the right'; totals for the new columns are revealed so
@@ -442,18 +448,16 @@
"""
headers: Tuple[_DataHeaders, Optional[_DataHeaders]] = extract.data_headers
for dim_idx, grand_total_headers in enumerate(extract.grand_total_headers):
if grand_total_headers is None:
continue
header = cast(List[List[Any]], headers[dim_idx])
- header[0].extend(grand_total_headers)- padding = [None] * len(grand_total_headers)- for other_headers in header[1:]:- other_headers.extend(padding)+ for level, grand_total_header in enumerate(grand_total_headers):+ header[level].extend(grand_total_header["headers"])
return headers
def convert_execution_response_to_dataframe(
execution_response: BareExecutionResponse,
result_cache_metadata: ResultCacheMetadata,
@@ -1,15 +1,15 @@
Metadata-Version: 2.1
Name: gooddata-pandas
-Version: 1.9.0+Version: 1.9.1.dev1
Summary: GoodData Cloud to pandas
Author: GoodData
Author-email: [email protected]
License: MIT
-Project-URL: Documentation, https://gooddata-pandas.readthedocs.io/en/v1.9.0+Project-URL: Documentation, https://gooddata-pandas.readthedocs.io/en/v1.9.1.dev1
Project-URL: Source, https://github.com/gooddata/gooddata-python-sdk
Keywords: gooddata,pandas,series,data,frame,data_frame,analytics,headless,business,intelligence,headless-bi,cloud,native,semantic,layer,sql,metrics
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Console
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
@@ -18,30 +18,30 @@
Classifier: Topic :: Database
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Software Development
Classifier: Typing :: Typed
Requires-Python: >=3.8.0
Description-Content-Type: text/markdown
License-File: LICENSE.txt
-Requires-Dist: gooddata-sdk~=1.9.0+Requires-Dist: gooddata-sdk~=1.9.1.dev1
Requires-Dist: pandas<2.0.0,>=1.0.0
# GoodData Pandas
This package contains a thin layer that utilizes gooddata-sdk and allows you to conveniently create pandas series and
data frames from the computations done against semantic model in your [GoodData.CN](https://www.gooddata.com/developers/cloud-native/) workspace.
See [DOCUMENTATION](https://gooddata-pandas.readthedocs.io/en/latest/) for more details.
## Requirements
- GoodData.CN installation; either running on your cloud
infrastructure or the free Community Edition running on your workstation
-- Python 3.7 or newer+- Python 3.8 or newer
## Installation
Run the following command to install the `gooddata-pandas` package on your system:
pip install gooddata-pandas