Add Johannesburg Stock Exchange (JSE) holidays#3714
Conversation
Signed-off-by: Paresh Joshi <194076591+pareshjoshij@users.noreply.github.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
Summary by CodeRabbit
WalkthroughChangesAdds Johannesburg Stock Exchange holiday support, including weekend filtering, Christmas Eve and New Year’s Eve half-days, public exports, registry discovery, README documentation, and coverage for observed rules and 2025 holidays. Johannesburg Stock Exchange
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
1 issue found across 5 files
Confidence score: 3/5
- In
tests/financial/test_johannesburg_stock_exchange.py,assertHalfDayNonObservedHolidayName(..."12-24"...)appears to ignore weekend holiday-shift behavior, so years like 2022/2023 can fail even when the calendar logic is correct; merging as-is risks flaky or consistently failing CI around those dates — update the test to account for SAT/SUN move rules (or assert against observed dates) before merging.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="tests/financial/test_johannesburg_stock_exchange.py">
<violation number="1" location="tests/financial/test_johannesburg_stock_exchange.py:31">
P1: `self.assertHalfDayNonObservedHolidayName(name, (f"{year}-12-24" for year in self.full_range))` will fail for years where Dec 24 falls on Saturday/Sunday (e.g., 2022, 2023). The JSE's `_move_holiday(rule=SAT_SUN_TO_NONE)` removes weekend Christmas Eve dates during population — this runs regardless of the `observed` flag — so the non-observed instance also lacks those entries. Wrap this assertion with a weekend filter, or assert `assertHalfDayNonObservedHolidayName` only for weekday years and `assertNoHalfDayNonObservedHolidayName` for weekend years.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #3714 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 320 322 +2
Lines 19286 19344 +58
Branches 2476 2479 +3
=========================================
+ Hits 19286 19344 +58 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
| def _populate_public_holidays(self): | ||
| super()._populate_public_holidays() | ||
|
|
||
| for dt in tuple(self): |
There was a problem hiding this comment.
It's reasonable to use the same approach as for SIX - override _add_holiday.



Proposed change
This PR adds the holidays for the Johannesburg Stock Exchange (JSE) financial calendar.
Part of GSoC (#3424)
holidaysfunctionality in general)Checklist
make checklocally; all checks and tests passed.