Skip to content

Fix num features extracted - #525

Merged
ppinchuk merged 2 commits into
mainfrom
pp/fix_num_features_extracted
Aug 8, 2026
Merged

Fix num features extracted#525
ppinchuk merged 2 commits into
mainfrom
pp/fix_num_features_extracted

Conversation

@ppinchuk

@ppinchuk ppinchuk commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

Minor fix to actually report number

@ppinchuk ppinchuk self-assigned this Aug 7, 2026
@ppinchuk
ppinchuk requested a review from castelao as a code owner August 7, 2026 23:36
Copilot AI lite review requested due to automatic review settings August 7, 2026 23:36
@ppinchuk ppinchuk added bugfix Fixed a known bug p-medium Priority: medium topic-python-cli Issues/pull requests related to running the python processing labels Aug 7, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes how COMPASS reports the number of extracted ordinance features by ensuring the count is a native Python int and by including that value in the jurisdiction summary output produced by the threaded services layer.

Changes:

  • Cast num_ordinances_dataframe(...).sum() to a Python int to avoid leaking NumPy scalar types.
  • Add num_features_extracted to the jurisdiction JSON output (and assert it in the threaded service unit test).
  • Extend parsing utility unit tests to cover missing values and “exclude all features” behavior while ensuring the return type is int.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
compass/utilities/parsing.py Ensures ordinance row counts return a JSON-safe native int.
compass/services/threaded.py Adds num_features_extracted to jurisdiction-level output and removes it from per-document output.
tests/python/unit/utilities/test_utilities_parsing.py Adds coverage for return type and edge cases involving missing values/exclusions.
tests/python/unit/services/test_services_threaded.py Verifies num_features_extracted is emitted in the jurisdiction summary.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 63.85%. Comparing base (b14fe34) to head (1b6c4c6).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #525      +/-   ##
==========================================
+ Coverage   63.78%   63.85%   +0.07%     
==========================================
  Files          78       78              
  Lines        7445     7446       +1     
  Branches      755      755              
==========================================
+ Hits         4749     4755       +6     
+ Misses       2536     2531       -5     
  Partials      160      160              
Flag Coverage Δ
unittests 63.85% <100.00%> (+0.07%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ppinchuk
ppinchuk merged commit 049f03f into main Aug 8, 2026
23 checks passed
@ppinchuk
ppinchuk deleted the pp/fix_num_features_extracted branch August 8, 2026 00:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Fixed a known bug p-medium Priority: medium topic-python-cli Issues/pull requests related to running the python processing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants