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.
Â