Skip to main content

The following code block was used to connect machine learning workbench to Celonis data models. The code worked for a long period of time until recently it returns an error. Anybody has an idea?

 

 

pip install --extra-index-url=https://pypi.celonis.cloud/ pycelonis --upgrade

from pycelonis import get_celonis

from pycelonis.pql import PQL, PQLColumn, PQLFilter

 

---------------------------------------------------------------------------

---------------------------------------------------------------------------

ImportError Traceback (most recent call last)

<ipython-input-9-175b2f233f28> in <module>

1 from pycelonis import get_celonis

----> 2 from pycelonis.pql import PQL, PQLColumn, PQLFilter

 

~/.local/lib/python3.7/site-packages/pycelonis/pql.py in <module>

4 from collections.abc import Iterable

5

----> 6 from .utils.api_utils import CelonisCollection

7

8

 

ImportError: cannot import name 'CelonisCollection' from 'pycelonis.utils.api_utils' (/home/jovyan/.local/lib/python3.7/site-packages/pycelonis/utils/api_utils.py)

 

Hi @xiao.huang,

 

The structure of the PyCelonis package has changed a bit. If you want to import the CelonisCollection Class, use the following instead:

 

from from pycelonis.celonis_api.api_utils import CelonisCollection

 

However, importing the CelonisCollection class itself doesn't seem so useful to me, since it is mainly returned by other functions of the PyCelonis package. It wouldn't supprise me if the code still works when you delete this statement in your script.

 

Kind regards,

Jan-peter


Hi @xiao.huang,

 

The structure of the PyCelonis package has changed a bit. If you want to import the CelonisCollection Class, use the following instead:

 

from from pycelonis.celonis_api.api_utils import CelonisCollection

 

However, importing the CelonisCollection class itself doesn't seem so useful to me, since it is mainly returned by other functions of the PyCelonis package. It wouldn't supprise me if the code still works when you delete this statement in your script.

 

Kind regards,

Jan-peter

Thanks for your answer! I also tried to import a bunch of related packages but none of them worked for me. The issue was temporarily resolved by updating the app (system) where the code was running and the actual cause of the problem is still unknown.

 

image


Thanks for your answer! I also tried to import a bunch of related packages but none of them worked for me. The issue was temporarily resolved by updating the app (system) where the code was running and the actual cause of the problem is still unknown.

 

image

Hi @xiao.huang,

 

Good to hear that you are back on track! Could be that there was a bug in de PyCelonis package due to the restructuring, that was solved in a newer version. By updating the app, also the newest PyCelonis version is installed, which might have solved the issue.


Reply