Python API: Error when running queries on 4.5


Hi all,

We just upgraded one of our environments to 4.5 and now, when retrieving table information from the datamodel we get an error. Basic API interaction works, running queries and obtaining data does not.

Traceback (most recent call last):

  File "<ipython-input-4-ef39afedecef>", line 16, in <module>
    print("Table: {} with {} records".format(, table.count_table()))

  File "C:\dev\Anaconda\lib\site-packages\celonis_tools\model\", line 2320, in count_table
    df = self.parent.query(query)

  File "C:\dev\Anaconda\lib\site-packages\celonis_tools\model\", line 1838, in query
    status, message = execution.wait_for_final_status()

  File "C:\dev\Anaconda\lib\site-packages\celonis_tools\model\", line 1513, in wait_for_final_status
    status, message = self.get_status()

  File "C:\dev\Anaconda\lib\site-packages\celonis_tools\model\", line 1529, in get_status
    ret = self.api.get(, "status")

  File "C:\dev\Anaconda\lib\site-packages\celonis_tools\model\", line 1493, in id

KeyError: 'result'

with CelonisSession(URL, localconfig.username, api_token=localconfig.token,api_secret=localconfig.secret, verify=use_tls) as session:
#And work with the connection/session

    analyses = pd.DataFrame()
    for a in Analysis.load_all():
        f = a.folder.parent    
        print("%i: %s in %s"%(,, f.path))
#        analyses.append()

    analysis = Analysis(244) #VoorbereidenNP Fundamentals op ACC
    datamodel=analysis.datamodel #get the corresponding data model
#    A data model can have multiple tables, loop through them like this, in this case to show the row counts
    for table in datamodel.tables:
        print("Table: {} with {} records".format(, table.count_table()))

Code runs fine until the last loop, where looping over the tables and getting still works, but count_table() doesn’t.
I also tested other queries or downloading the data from the table, both fail, causing me to believe there is an issues with the packages. I installed pyarrow as per the manual, but could it be I’m still missing something?



Hi Joos,

which version of the celonis_tools are you using? For CPM4.5, a new version (version 1.0.0) is required. It can be downloaded from “System Settings”->“celonis tools” from your CPM4.5 instance.

Let me know if this solves the problem!




Ok, I have asked the sys admin to send me the file, as I’m currently using 0.6.1.

Just checking: the file I can download via is not v1.0.0 and/or recently updated?



For 4.5, it will not be available on

However, we just pushed it to our pypi repo, such that you also can install the package using
pip install --extra-index-url -U celonis_tools

The documentation on everything will be available soon.


1 Like


Hi David,

Thanks for publishing this to the pypi Celonis repro.

I had a small (local) issue with self-signed certificates, but downloading the .whl file directly worked.
I can now indeed fetch data from the Celonis 4.5 instance so thanks a lot!