Skip to content

Add Johannesburg Stock Exchange (JSE) holidays#3714

Open
pareshjoshij wants to merge 4 commits into
vacanza:devfrom
pareshjoshij:add_JSE
Open

Add Johannesburg Stock Exchange (JSE) holidays#3714
pareshjoshij wants to merge 4 commits into
vacanza:devfrom
pareshjoshij:add_JSE

Conversation

@pareshjoshij

Copy link
Copy Markdown
Contributor

Proposed change

This PR adds the holidays for the Johannesburg Stock Exchange (JSE) financial calendar.

Part of GSoC (#3424)

  • New country/market holidays support (thank you!)
  • Supported country/market holidays update (calendar discrepancy fix, localization)
  • Existing code quality improvement (best practice, cleanup, refactoring, optimization)
  • Documentation update
  • Test suite update
  • Development process update (CI/CD, project configuration, internal tooling)
  • Dependency update (version deprecation/pin/upgrade)
  • Bugfix (non-breaking change which fixes an issue)
  • Breaking change (a code change causing existing functionality to break)
  • New feature (new holidays functionality in general)

Checklist

Signed-off-by: Paresh Joshi <194076591+pareshjoshij@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 21, 2026 09:43

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions github-actions Bot added the test label Jul 21, 2026
@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: dca84c25-3a12-48a4-9ab3-0d60e28c57de

📥 Commits

Reviewing files that changed from the base of the PR and between 080bcb3 and 3fcb14b.

📒 Files selected for processing (1)
  • holidays/financial/johannesburg_stock_exchange.py

Summary by CodeRabbit

  • New Features

    • Added Johannesburg Stock Exchange (JSE/XJSE) holiday calendar support (from 2000 onward), including public holidays and half-day closures for Christmas Eve and New Year’s Eve at 12:00 p.m. SAST.
    • Registered JSE/XJSE in the financial markets registry for discoverability.
  • Tests

    • Added dedicated coverage for JSE/XJSE holiday behavior, including half-day observance and the 2025 holiday set.
  • Documentation

    • Updated the available financial markets table to include Johannesburg Stock Exchange (XJSE) and its supported holiday categories.

Walkthrough

Changes

Adds 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

Layer / File(s) Summary
JSE holiday behavior
holidays/financial/johannesburg_stock_exchange.py
Defines the JSE calendar, removes weekend public holidays, adds Christmas Eve and New Year’s Eve half-days, and provides JSE/XJSE aliases.
Financial registry and exports
holidays/registry.py, holidays/financial/__init__.py, README.md
Registers the exchange codes, exports the new entities, and documents the market.
Calendar behavior tests
tests/financial/test_johannesburg_stock_exchange.py
Tests identifiers, observed rules, full-day holidays, and 2025 half-day holidays.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

  • vacanza/holidays#3440: Adds another financial exchange calendar with HALF_DAY support through the shared registry and export integration points.

Suggested reviewers: arkid15r, ppsyrius

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the main change: adding Johannesburg Stock Exchange holiday support.
Description check ✅ Passed The description directly states that this PR adds Johannesburg Stock Exchange financial calendar holidays.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@cubic-dev-ai cubic-dev-ai Bot 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.

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

Comment thread tests/financial/test_johannesburg_stock_exchange.py
Comment thread tests/financial/test_johannesburg_stock_exchange.py
Comment thread holidays/financial/johannesburg_stock_exchange.py Outdated
@codecov

codecov Bot commented Jul 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (df6abc9) to head (3fcb14b).
⚠️ Report is 7 commits behind head on dev.

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.
📢 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.

Comment thread holidays/financial/johannesburg_stock_exchange.py Outdated
Comment thread holidays/financial/johannesburg_stock_exchange.py Outdated
Comment thread holidays/financial/johannesburg_stock_exchange.py
@sonarqubecloud

Copy link
Copy Markdown

@pareshjoshij
pareshjoshij requested a review from KJhellico July 23, 2026 13:31
def _populate_public_holidays(self):
super()._populate_public_holidays()

for dt in tuple(self):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

It's reasonable to use the same approach as for SIX - override _add_holiday.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants