Skip to content

compute_node.py

ComputeNode (CelonisApiObject)

ComputeNode object to interact with Celonis Event Collection API.

data: Dict property writable

ComputeNode has no data. Always returns emtpy dict.

Exceptions:

Type Description
PyCelonisNotImplementedError

when trying to set data.

url: str property readonly

API

  • GET: /integration/api/v1/compute/{datamodel_id}

get_data_file(self, pql_query, file_path=None, **kwargs)

Exports the results of a PQL query as pyarrow.parquet.ParquetFile and returns the path to the exported file.

API

  • POST: /integration/api/v1/compute/{datamodel_id}/export/query
        {
            "dataCommand": {
                "commands": [
                    {"queries": pql_query.query}
                ]
            }
        }
    

Parameters:

Name Type Description Default
pql_query PQL

The table query to be executed.

required
file_path Union[str, pathlib.Path]

The output path for the export. Defaults to tmpdir/celonis_pql_export_<current_time>.parquet.

None

Returns:

Type Description
Path

Path to downloaded file containing the results of the query.

get_data_frame(self, pql_query, **kwargs)

Exports the results of a PQL query as pyarrow.parquet.ParquetFile and converts it to a pandas.DataFrame. Uses ComputeNode.get_data_file.

Parameters:

Name Type Description Default
pql_query PQL

The table query to be executed.

required

Returns:

Type Description
DataFrame

Dataframe containing the results of the query.

HybridPseudoComputeNode

Hybrid ComputeNode object to interact with Celonis Hybrid Event Collection API.

get_data_file(self, pql_query, file_path=None, **kwargs)

Exports the results of a PQL query as pyarrow.parquet.ParquetFile and returns the path to the exported file.

This method will create a temporary Studio Space, Package and Analysis to then export the result via Analysis.get_data_file. The temporary space will be deleted at before the result is returned. It is recommended to set up an Analysis in Studio yourself and use it to export the query result.

Parameters:

Name Type Description Default
pql_query PQL

The table query to be executed.

required
file_path Union[str, pathlib.Path]

The output path for the export. Defaults to tmpdir/celonis_pql_export_<current_time>.parquet.

None

Returns:

Type Description
Path

Path to downloaded file containing the results of the query.

get_data_frame(self, pql_query, **kwargs)

Exports the results of a PQL query as pyarrow.parquet.ParquetFile file and converts it to a pandas.DataFrame. Uses get_data_file.

Parameters:

Name Type Description Default
pql_query PQL

The table query to be executed.

required

Returns:

Type Description
DataFrame

Dataframe containing the results of the query.