Hi,
You can iterate the collection of object. Below is the code snippet
Hope that helps.
Thanks,
Rio
Hello,
Thank you very much for your answers.
If I type the following code into the ML in my Jupiter notebook.
pool = celonis.data_integration.get_data_pool(celonis_pool_id)
pool
data_model = pool.get_data_model('5fa07b36-19d0-4d67-8f88-933e2cf34a6b')
data_model
tables = data_model.get_tables()
tables
table = tables.find('15Min_ZR')
df = pd.DataFrame(table)
df
I get this output
But what I want is not the metadata of the table. I want to output the content of the table 15Min_ZR as a data frame
Hello,
Thank you very much for your answers.
If I type the following code into the ML in my Jupiter notebook.
pool = celonis.data_integration.get_data_pool(celonis_pool_id)
pool
data_model = pool.get_data_model('5fa07b36-19d0-4d67-8f88-933e2cf34a6b')
data_model
tables = data_model.get_tables()
tables
table = tables.find('15Min_ZR')
df = pd.DataFrame(table)
df
I get this output
But what I want is not the metadata of the table. I want to output the content of the table 15Min_ZR as a data frame
You need to use PQL() to query the table.
For example (in pycelonis 1.7 and dmtemp is your data model object):
from pycelonis.celonis_api.pql.pql import PQLColumn
from pycelonis.celonis_api.pql.pql import PQL, PQLFilter
query=PQL()
tablename=start_table_name
for c in dmtemp.tables.find(tablename).columns:
c_name=c'name']
qval='"%s"."%s"' %(tablename,c_name)
column=PQLColumn(query=qval, name = c_name)
query.add(column)
df_final=dmtemp.get_data_frame(query)
df_final will contain a data frame with all the records and columns.
Hi, as mentioned by Gost, you need to create a PQL in order to perform the query in the data model. adjusted your code and added relevant code to extract data from table, check below.

Hi, as mentioned by Gost, you need to create a PQL in order to perform the query in the data model. adjusted your code and added relevant code to extract data from table, check below.

Hi Rio,
when tried to convert the table from data model to data frame, getting error as shown below.
Also checked with data_model._get_data_frame(query). getting error as "Exception: Export failed.
".
Thanks Rio. Will update the version and run the code
Thanks Rio,
pycelonis is working with your code.
Hey ecereybody,
I have antoher Problem with jupyter.
It seems, that jupyter can´t find the directory from the "Oracle Instand Client".
Same code works in PyCharm when the directory from the instand client is on a local disk.

