Skip to main content
Question

Need help with extracting data from OLAP table using PyCelonis 2.4.0- AttributeError: 'Analysis' object has no attribute 'get_content'

  • August 23, 2023
  • 2 replies
  • 12 views

akshay.patil14
Level 1
Forum|alt.badge.img+1

I'm currently working on extracting data from an OLAP table using the PyCelonis library. However, I've encountered an AttributeError while attempting to retrieve the content of an analysis(olap table). Here's the code snippet I'm using:

 

```python

from pycelonis import get_celonis

 

celonis = get_celonis()

space = celonis.studio.get_space('4c************1b')

package = space.get_package('64**************de')

analysis = package.get_analysis('e7*************b')

content = analysis.get_content() # This line raises an AttributeError

 

The error message I'm receiving is:

AttributeError: 'Analysis' object has no attribute 'get_data'

 

I've checked the documentation, but it seems that the 'Analysis' object doesn't have a 'get_content' attribute. Could you please guide me on how to correctly retrieve the data or content associated with this analysis? What method or function or attribute should I use after the 'analysis' object to access the analysis data?

 

 

 

2 replies

memrac.c
Level 1
  • Level 1
  • August 23, 2023

I was having the same problem yesterday and what worked for me was:

 

celonis = get_celonis()

space = celonis.apps.get_spaces().find('9*******')

package = space.get_packages().find('9*******')

analysis = package.get_analyses().find('********')

content = package.get_analysis(analysis.id).get_content()

sheets = content.draft.document.components

sheet = sheets.find('*********')

components = sheet.components

 

I got this answer following a snippet of code in here: Pulling Data from an Analysis - PyCelonis

I think it changed in the version 2.4.1 and the way you was doing it is now deprecreated.


akshay.patil14
Level 1
Forum|alt.badge.img+1

I was having the same problem yesterday and what worked for me was:

 

celonis = get_celonis()

space = celonis.apps.get_spaces().find('9*******')

package = space.get_packages().find('9*******')

analysis = package.get_analyses().find('********')

content = package.get_analysis(analysis.id).get_content()

sheets = content.draft.document.components

sheet = sheets.find('*********')

components = sheet.components

 

I got this answer following a snippet of code in here: Pulling Data from an Analysis - PyCelonis

I think it changed in the version 2.4.1 and the way you was doing it is now deprecreated.

Hey Memrac,

 

Thank you very much, That works!