Repository navigation
fix: check error status of GraphInfo::Load() in BenchmarkFixture::SetUp and remove dead code - #940
Conversation
Signed-off-by: Jason <[email protected]>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #940 +/- ##
============================================
- Coverage 81.60% 81.60% -0.01%
Complexity 615 615
============================================
Files 95 95
Lines 11144 11143 -1
Branches 1066 1066
============================================
- Hits 9094 9093 -1
Misses 1810 1810
Partials 240 240
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR improves C++ code robustness and readability by tightening error handling around GraphInfo::Load() in benchmarks and cleaning up dead/unreachable code and minor logic/comment issues in high-level reader components and filesystem utilities.
Changes:
- Add explicit status checks for
GraphInfo::Load()inBenchmarkFixture::SetUp()and fail fast on load errors. - Remove unused/unreachable code paths in high-level graph reader implementations.
- Minor cleanups: stop iteration after printing the first 10 items in examples; clarify template instantiation comments in filesystem code.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| cpp/src/graphar/high-level/graph_reader.h | Removes an unused local (labels) to avoid dead code. |
| cpp/src/graphar/high-level/graph_reader.cc | Removes an unreachable return Status::OK(); after a switch that already returns. |
| cpp/src/graphar/filesystem.cc | Updates misleading comments to correctly describe explicit template instantiations for IdType. |
| cpp/examples/high_level_reader_example.cc | Uses break instead of continue to actually stop after printing 10 vertices/edges. |
| cpp/benchmarks/benchmark_util.h | Checks GraphInfo::Load() status and throws with a clearer failure message on error. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| auto maybe_graph_info = GraphInfo::Load(path_); | ||
| if (!maybe_graph_info.status().ok()) { | ||
| throw std::runtime_error("Failed to load graph info from " + path_ + | ||
| ": " + maybe_graph_info.status().message()); | ||
| } |
Reason for this PR
To make the code more readable and robust.
What changes are included in this PR?
Are these changes tested?
Yes
Are there any user-facing changes?
No
Checklist
make cpplintbefore submitting when changed files are in thecppdirectory.pre-commit runbefore commit the changed files.