Skip to content

Support legacy CSP enum compatibility - #350

Merged
timkpaine merged 4 commits into
mainfrom
fix/csp-enum-json
Sep 5, 2026
Merged

Support legacy CSP enum compatibility#350
timkpaine merged 4 commits into
mainfrom
fix/csp-enum-json

Conversation

@malhotrashivam

@malhotrashivam malhotrashivam commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator
  • Preserve handling of legacy PyCspEnum-backed and new IntEnum-backed CSP enums in Gateway 3 JSON conversion, query filtering, and Perspective schemas.
  • Keep standard Python enum behavior unchanged.
  • Add focused coverage for zero-valued enum basket keys and live CSP graph validation.

Follow-up to #322.

Related CSP enum change: Point72/csp#743

Validation:

  • Legacy CSP: 874 passed, 9 skipped, 1 xfailed
  • IntEnum CSP: 874 passed, 9 skipped, 1 xfailed
  • make lint-py

Signed-off-by: Shivam Malhotra <shivam.malhotra@cubistsystematic.com>
@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Test Results

890 tests  +10   880 ✅ +10   7m 35s ⏱️ +3s
  1 suites ± 0    10 💤 ± 0 
  1 files   ± 0     0 ❌ ± 0 

Results for commit a57fd3f. ± Comparison against base commit 434b353.

♻️ This comment has been updated with latest results.

@codecov

codecov Bot commented Sep 4, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 99.22481% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 86.94%. Comparing base (434b353) to head (a57fd3f).
⚠️ Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
csp_gateway/utils/web/filter.py 87.50% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #350      +/-   ##
==========================================
+ Coverage   86.83%   86.94%   +0.11%     
==========================================
  Files         158      159       +1     
  Lines       18714    18834     +120     
  Branches     1768     1774       +6     
==========================================
+ Hits        16250    16376     +126     
+ Misses       2464     2458       -6     

☔ 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Signed-off-by: Shivam Malhotra <shivam.malhotra@cubistsystematic.com>
@malhotrashivam
malhotrashivam marked this pull request as draft September 4, 2026 20:27
malhotrashivam and others added 2 commits September 4, 2026 16:56
Signed-off-by: Shivam Malhotra <shivam.malhotra@cubistsystematic.com>
A whole-basket send channel on an enum-keyed dict basket never worked.
Legacy CSP enums were not recognized as a basket key type, so the basket
was built with no shape, and the key expansion inserted into
_send_channels while that dict was being iterated. Recognize both enum
flavors and snapshot the items first.

psp_flatten dropped CSP enum values to the empty string; report the
member name the way the schema already promises. Unwrap Optional around
an annotated array field so its element type still resolves.

Keep the filter module importable without CSP, while still surfacing an
import error from a CSP install that is present but broken.

Signed-off-by: Tim Paine <3105306+timkpaine@users.noreply.github.com>
@timkpaine
timkpaine marked this pull request as ready for review September 5, 2026 20:19
@timkpaine
timkpaine merged commit 7141502 into main Sep 5, 2026
10 checks passed
@timkpaine
timkpaine deleted the fix/csp-enum-json branch September 5, 2026 20:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants