Ensure common aggregations run before other aggregations#651
Conversation
Not up to standards ⛔🔴 Issues
|
| Category | Results |
|---|---|
| Documentation | 2 minor |
🟢 Metrics 6 complexity
Metric Results Complexity 6
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
There was a problem hiding this comment.
Code Review
This pull request introduces deterministic execution priority sorting for calculation types within a stage. It defines priority ranks (CALCULATION_TYPE_PRIORITY) in common.py, updates the orchestrator to sort calculations by stage and priority, moves several prerequisite calculations to stage 0 in the configuration, and updates the JSON schema to require input_imports for all calculation types except EMBEDDING_GENERATION. Unit tests are added to verify the ordering logic. The reviewer suggested adding a sanity test to ensure all CalculationType enum members have a defined priority in CALCULATION_TYPE_PRIORITY to prevent future bugs.
In the present code, there's a danger that before common aggregations (ex: linked edges, provenance summary) can execute, other aggregations dependent on it (ex: places) might run first.
Right now, the order is correctly resolved due to naming of yaml files, but this is brittle and can break anytime the file names in config are changed. To prevent it, I'm enforcing a priority order explicitly.