Python API: possible but vague error when pushing table

#1

Hi all,

When we’re trying to push a processed table back to Celonis using
datamodel.push_table(pred_case,'PREDICTIONS_CASE', if_exists='replace')

We get the following error:
Traceback (most recent call last):

  File "<ipython-input-130-6548eb153be9>", line 4, in <module>
    datamodel.push_table(pred_case,'PREDICTIONS_CASE', if_exists='replace')#, trigger_reload = True)

  File "C:\dev\Anaconda\lib\site-packages\celonis_tools\model\folder.py", line 1956, in push_table
    t.connection.delete()

  File "C:\dev\Anaconda\lib\site-packages\celonis_tools\model\resource.py", line 259, in delete
    return self.api.delete(self.id)

  File "C:\dev\Anaconda\lib\site-packages\celonis_tools\api.py", line 146, in delete
    return self.session.futures.delete(url, params=kw)

  File "C:\dev\Anaconda\lib\site-packages\requests\sessions.py", line 615, in delete
    return self.request('DELETE', url, **kwargs)

  File "C:\dev\Anaconda\lib\site-packages\celonis_tools\api.py", line 247, in request
    f = super(MyFuturesSession, self).request(*args, **kwargs)

  File "C:\dev\Anaconda\lib\site-packages\requests_futures\sessions.py", line 105, in request
    return self.executor.submit(func, *args, **kwargs)

  File "C:\dev\Anaconda\lib\concurrent\futures\thread.py", line 151, in submit
    raise RuntimeError('cannot schedule new futures after shutdown')

RuntimeError: cannot schedule new futures after shutdown

This error only occurs when we’re ‘stepping’ through the code in the Python editor, i.e., running the code line per line of section per section. If we run the whole file at once the error does not occur, but only after we remove the currently existing table (the if_exists option does not seem to work).

Note: we’re here still using the CSV fallback mechanism.

0 Likes