gooddata-pandas 1.28.1.dev2__tar.gz → 1.28.1.dev3__tar.gz

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.

Files changed (21) hide show
  1. {gooddata_pandas-1.28.1.dev2/gooddata_pandas.egg-info → gooddata_pandas-1.28.1.dev3}/PKG-INFO +3 -3
  2. {gooddata_pandas-1.28.1.dev2 → gooddata_pandas-1.28.1.dev3}/gooddata_pandas/data_access.py +17 -9
  3. {gooddata_pandas-1.28.1.dev2 → gooddata_pandas-1.28.1.dev3/gooddata_pandas.egg-info}/PKG-INFO +3 -3
  4. gooddata_pandas-1.28.1.dev3/gooddata_pandas.egg-info/requires.txt +2 -0
  5. {gooddata_pandas-1.28.1.dev2 → gooddata_pandas-1.28.1.dev3}/setup.py +3 -3
  6. gooddata_pandas-1.28.1.dev2/gooddata_pandas.egg-info/requires.txt +0 -2
  7. {gooddata_pandas-1.28.1.dev2 → gooddata_pandas-1.28.1.dev3}/LICENSE.txt +0 -0
  8. {gooddata_pandas-1.28.1.dev2 → gooddata_pandas-1.28.1.dev3}/MANIFEST.in +0 -0
  9. {gooddata_pandas-1.28.1.dev2 → gooddata_pandas-1.28.1.dev3}/README.md +0 -0
  10. {gooddata_pandas-1.28.1.dev2 → gooddata_pandas-1.28.1.dev3}/gooddata_pandas/__init__.py +0 -0
  11. {gooddata_pandas-1.28.1.dev2 → gooddata_pandas-1.28.1.dev3}/gooddata_pandas/_version.py +0 -0
  12. {gooddata_pandas-1.28.1.dev2 → gooddata_pandas-1.28.1.dev3}/gooddata_pandas/dataframe.py +0 -0
  13. {gooddata_pandas-1.28.1.dev2 → gooddata_pandas-1.28.1.dev3}/gooddata_pandas/good_pandas.py +0 -0
  14. {gooddata_pandas-1.28.1.dev2 → gooddata_pandas-1.28.1.dev3}/gooddata_pandas/py.typed +0 -0
  15. {gooddata_pandas-1.28.1.dev2 → gooddata_pandas-1.28.1.dev3}/gooddata_pandas/result_convertor.py +0 -0
  16. {gooddata_pandas-1.28.1.dev2 → gooddata_pandas-1.28.1.dev3}/gooddata_pandas/series.py +0 -0
  17. {gooddata_pandas-1.28.1.dev2 → gooddata_pandas-1.28.1.dev3}/gooddata_pandas/utils.py +0 -0
  18. {gooddata_pandas-1.28.1.dev2 → gooddata_pandas-1.28.1.dev3}/gooddata_pandas.egg-info/SOURCES.txt +0 -0
  19. {gooddata_pandas-1.28.1.dev2 → gooddata_pandas-1.28.1.dev3}/gooddata_pandas.egg-info/dependency_links.txt +0 -0
  20. {gooddata_pandas-1.28.1.dev2 → gooddata_pandas-1.28.1.dev3}/gooddata_pandas.egg-info/top_level.txt +0 -0
  21. {gooddata_pandas-1.28.1.dev2 → gooddata_pandas-1.28.1.dev3}/setup.cfg +0 -0
@@ -1,11 +1,11 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: gooddata-pandas
3
- Version: 1.28.1.dev2
3
+ Version: 1.28.1.dev3
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.28.1.dev2
8
+ Project-URL: Documentation, https://gooddata-pandas.readthedocs.io/en/v1.28.1.dev3
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.9.0
23
23
  Description-Content-Type: text/markdown
24
24
  License-File: LICENSE.txt
25
- Requires-Dist: gooddata-sdk~=1.28.1.dev2
25
+ Requires-Dist: gooddata-sdk~=1.28.1.dev3
26
26
  Requires-Dist: pandas<3.0.0,>=2.0.0
27
27
 
28
28
  # GoodData Pandas
@@ -6,7 +6,7 @@ from typing import Any, Optional, Union
6
6
  from gooddata_sdk import (
7
7
  Attribute,
8
8
  AttributeFilter,
9
- CatalogWorkspaceContent,
9
+ CatalogAttribute,
10
10
  ExecutionDefinition,
11
11
  ExecutionResponse,
12
12
  Filter,
@@ -16,6 +16,7 @@ from gooddata_sdk import (
16
16
  ObjId,
17
17
  TableDimension,
18
18
  )
19
+ from gooddata_sdk.utils import IdObjType
19
20
 
20
21
  from gooddata_pandas.utils import (
21
22
  ColumnsDef,
@@ -319,19 +320,26 @@ def _extract_for_metrics_only(response: ExecutionResponse, cols: list, col_to_me
319
320
  return data
320
321
 
321
322
 
322
- def _typed_result(catalog: CatalogWorkspaceContent, attribute: Attribute, result_values: list[Any]) -> list[Any]:
323
+ def _find_attribute(attributes: list[CatalogAttribute], id_obj: IdObjType) -> Union[CatalogAttribute, None]:
324
+ for attribute in attributes:
325
+ if attribute.find_label(id_obj) is not None:
326
+ return attribute
327
+ return None
328
+
329
+
330
+ def _typed_result(attributes: list[CatalogAttribute], attribute: Attribute, result_values: list[Any]) -> list[Any]:
323
331
  """
324
332
  Internal function to convert result_values to proper data types.
325
333
 
326
334
  Args:
327
- catalog (CatalogWorkspaceContent): The catalog workspace content.
335
+ attributes (list[CatalogAttribute]): The catalog of attributes.
328
336
  attribute (Attribute): The attribute for which the typed result will be computed.
329
337
  result_values (list[Any]): A list of raw values.
330
338
 
331
339
  Returns:
332
340
  list[Any]: A list of converted values with proper data types.
333
341
  """
334
- catalog_attribute = catalog.find_label_attribute(attribute.label)
342
+ catalog_attribute = _find_attribute(attributes, attribute.label)
335
343
  if catalog_attribute is None:
336
344
  raise ValueError(f"Unable to find attribute {attribute.label} in catalog")
337
345
  return [_typed_attribute_value(catalog_attribute, value) for value in result_values]
@@ -339,7 +347,7 @@ def _typed_result(catalog: CatalogWorkspaceContent, attribute: Attribute, result
339
347
 
340
348
  def _extract_from_attributes_and_maybe_metrics(
341
349
  response: ExecutionResponse,
342
- catalog: CatalogWorkspaceContent,
350
+ attributes: list[CatalogAttribute],
343
351
  cols: list[str],
344
352
  col_to_attr_idx: dict[str, int],
345
353
  col_to_metric_idx: dict[str, int],
@@ -382,12 +390,12 @@ def _extract_from_attributes_and_maybe_metrics(
382
390
  for idx_name in index:
383
391
  rs = result.get_all_header_values(attribute_dim, safe_index_to_attr_idx[idx_name])
384
392
  attribute = index_to_attribute[idx_name]
385
- index[idx_name] += _typed_result(catalog, attribute, rs)
393
+ index[idx_name] += _typed_result(attributes, attribute, rs)
386
394
  for col in cols:
387
395
  if col in col_to_attr_idx:
388
396
  rs = result.get_all_header_values(attribute_dim, col_to_attr_idx[col])
389
397
  attribute = col_to_attribute[col]
390
- data[col] += _typed_result(catalog, attribute, rs)
398
+ data[col] += _typed_result(attributes, attribute, rs)
391
399
  elif col_to_metric_idx[col] < len(result.data):
392
400
  data[col] += result.data[col_to_metric_idx[col]]
393
401
  if result.is_complete(attribute_dim):
@@ -440,10 +448,10 @@ def compute_and_extract(
440
448
  if not exec_def.has_attributes():
441
449
  return _extract_for_metrics_only(response, cols, col_to_metric_idx), dict()
442
450
  else:
443
- catalog = sdk.catalog_workspace_content.get_full_catalog(workspace_id)
451
+ attributes = sdk.catalog_workspace_content.get_attributes_catalog(workspace_id, include=["labels", "datasets"])
444
452
  return _extract_from_attributes_and_maybe_metrics(
445
453
  response,
446
- catalog,
454
+ attributes,
447
455
  cols,
448
456
  col_to_attr_idx,
449
457
  col_to_metric_idx,
@@ -1,11 +1,11 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: gooddata-pandas
3
- Version: 1.28.1.dev2
3
+ Version: 1.28.1.dev3
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.28.1.dev2
8
+ Project-URL: Documentation, https://gooddata-pandas.readthedocs.io/en/v1.28.1.dev3
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.9.0
23
23
  Description-Content-Type: text/markdown
24
24
  License-File: LICENSE.txt
25
- Requires-Dist: gooddata-sdk~=1.28.1.dev2
25
+ Requires-Dist: gooddata-sdk~=1.28.1.dev3
26
26
  Requires-Dist: pandas<3.0.0,>=2.0.0
27
27
 
28
28
  # GoodData Pandas
@@ -0,0 +1,2 @@
1
+ gooddata-sdk~=1.28.1.dev3
2
+ pandas<3.0.0,>=2.0.0
@@ -7,7 +7,7 @@ this_directory = Path(__file__).parent
7
7
  long_description = (this_directory / "README.md").read_text(encoding="utf-8")
8
8
 
9
9
  REQUIRES = [
10
- "gooddata-sdk~=1.28.1.dev2",
10
+ "gooddata-sdk~=1.28.1.dev3",
11
11
  "pandas>=2.0.0,<3.0.0",
12
12
  ]
13
13
 
@@ -16,7 +16,7 @@ setup(
16
16
  description="GoodData Cloud to pandas",
17
17
  long_description=long_description,
18
18
  long_description_content_type="text/markdown",
19
- version="1.28.1.dev2",
19
+ version="1.28.1.dev3",
20
20
  author="GoodData",
21
21
  author_email="support@gooddata.com",
22
22
  license="MIT",
@@ -26,7 +26,7 @@ setup(
26
26
  packages=find_packages(exclude=["tests*"]),
27
27
  python_requires=">=3.9.0",
28
28
  project_urls={
29
- "Documentation": "https://gooddata-pandas.readthedocs.io/en/v1.28.1.dev2",
29
+ "Documentation": "https://gooddata-pandas.readthedocs.io/en/v1.28.1.dev3",
30
30
  "Source": "https://github.com/gooddata/gooddata-python-sdk",
31
31
  },
32
32
  classifiers=[
@@ -1,2 +0,0 @@
1
- gooddata-sdk~=1.28.1.dev2
2
- pandas<3.0.0,>=2.0.0