Python Analysis
Use Python analysis when you need a transformation or statistical calculation on a query result, such as a distribution of order values. Check that the input contains the rows the analysis needs: a capped SQL result is not the whole source table.
What runs and what you can review
Datarelix can include a Python step in the plan. It receives the results of earlier steps, without database connection credentials. The installed analysis libraries include pandas, numpy, scipy and statsmodels. Arbitrary package installation is unavailable.
Open the execution details to inspect the generated code, input references, outputs and captured messages. A calculation finishing successfully does not establish that its assumptions are appropriate. For a regression, for example, check the variables and missing-value treatment before interpreting the coefficient.
Ordinary interactive charts use a declarative chart specification. Asking for a chart does not by itself require a Python step. See questions and results.
Execution restrictions and limits
Generated Python runs in an isolated environment with outbound network access blocked and restricted file access. The environment has resource limits; these controls do not assess the statistical validity of a calculation. The database is queried separately under the connection’s permissions.
| Limit | Value |
|---|---|
| Execution timeout | 90 seconds |
| Memory | 512 MB |
| Total artifact size | 10 MB |
A timeout or memory failure may require fewer input rows or a calculation in SQL before the Python step. Keep the sampling or aggregation rule visible in your report.
Inspect a Python step
Open the execution trace on the answer and review:
- The generated Python source.
- The earlier result referenced as input.
- The returned table or artifact.
- Captured standard output and error messages.
Check row counts before interpreting a statistic. If SQL returned a limited sample, the Python step analyses that sample. For a population total or rate, aggregate the required source data in SQL rather than assuming a capped DataFrame contains everything.
For missing values, grouping and regression inputs, keep the rule visible in the question or code review. Analysts can inspect these choices directly; business users can provide the intended definition and ask for review of the statistical assumptions.
Reduce the work without changing the question
Select only needed columns, aggregate in SQL where appropriate and choose a period that matches the report. If sampling is necessary, record the selection method and its limitations. Reducing rows arbitrarily can change the meaning of the result even when it avoids a timeout.
When a calculation fails
Inspect the error and the step that produced it. Processing error means the generated code failed; Processing timed out and Out of memory mean it reached one of the limits above. Datarelix revises and retries a failed step a limited number of times. If it still cannot complete the task, revise the question or ask an analyst to review the calculation.
Troubleshooting explains each error message. If you contact support, include the error and the reference shown with it. Do not send database passwords.