Skip to content

Update India holidays: change 2026 Holi date in Maharashtra (MH)#3379

Merged
arkid15r merged 23 commits intovacanza:devfrom
Devika9705:india-mh-holi-fix-2026
Apr 11, 2026
Merged

Update India holidays: change 2026 Holi date in Maharashtra (MH)#3379
arkid15r merged 23 commits intovacanza:devfrom
Devika9705:india-mh-holi-fix-2026

Conversation

@Devika9705
Copy link
Copy Markdown
Contributor

Proposed change

This PR updates a calendar discrepancy for India (Maharashtra subdivision) regarding the Holi holiday in 2026.

In Maharashtra, Holi is officially observed on March 3, 2026, as per the state government holiday calendar and NSE/BSE schedules. However, the current implementation follows the general national calculation, which may differ.

This change:

  • Adds a Maharashtra-specific override for Holi in 2026
  • Ensures alignment with the official state government calendar
  • Follows the existing subdivision pattern used in other states (e.g., Tamil Nadu, Gujarat)
  • Updates the reference section with the Maharashtra holiday calendar source

This ensures more accurate regional holiday representation without affecting other states.

Type of change

  • Supported country/market holidays update (calendar discrepancy fix, localization)

Checklist

  • I've read and followed the contributing guidelines.
  • I've run make check locally; all checks and tests passed.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 23, 2026

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: 8895c7e0-0041-45a8-9d84-ec6cc020eff8

📥 Commits

Reviewing files that changed from the base of the PR and between 36c1d99 and 0932c5a.

📒 Files selected for processing (2)
  • holidays/countries/india.py
  • tests/countries/test_india.py

Summary by CodeRabbit

Release Notes

  • Bug Fixes

    • Corrected Holi holiday treatment in India. Holi is now handled as a Maharashtra public holiday with accurate dates, while remaining an optional holiday for other subdivisions.
  • Tests

    • Enhanced test coverage with explicit year ranges and subdivision-specific assertions for Holi holiday data.

Walkthrough

Adjusts India holiday logic so Holi is not added unconditionally: Maharashtra (subdiv "MH") skips Holi in optional holidays and receives a fixed Holi date for 2026; other subdivisions use the existing Holi calculation. The module docstring reference for MH 2026 was updated.

Changes

Cohort / File(s) Summary
India holiday logic
holidays/countries/india.py
Stop adding Holi unconditionally in _populate_optional_holidays; skip Holi when self.subdiv == "MH"; add MH-specific handling in _populate_subdiv_mh_public_holidays to set Holi to date(2026, 3, 3) for 2026 else call _add_holi; update MH 2026 reference in the module docstring.
India tests
tests/countries/test_india.py
Specify explicit year range for optional-holidays test dataset and add assertions verifying Holi absence for subdiv="MH" across the range, plus presence on 2026-03-03 and absence on 2026-03-04 for MH.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • arkid15r
  • PPsyrius
🚥 Pre-merge checks | ✅ 2 | ❌ 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 (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically summarizes the main change: updating the 2026 Holi date for Maharashtra subdivision in India's holiday calendar.
Description check ✅ Passed The description is well-related to the changeset, explaining the Maharashtra-specific Holi override for 2026 and referencing the pattern used for other subdivisions.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@holidays/countries/india.py`:
- Around line 403-404: The call uses a non-existent method _add_holi_mar_3 which
will raise AttributeError; replace it depending on intent: if Holi should be
calculated use the existing base-class method _add_holi(name) (call
_add_holi(tr("Holi"))), otherwise if you truly need a hardcoded March 3 holiday
(e.g. for 2026 only) call the helper _add_holiday_mar_3(tr("Holi")); update the
invocation of _add_holi_mar_3 to one of these two valid methods in the india.py
file.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 749425b5-9fef-45a8-807b-4a82c2f8c8b0

📥 Commits

Reviewing files that changed from the base of the PR and between 27f4956 and adfa010.

📒 Files selected for processing (1)
  • holidays/countries/india.py

Comment thread holidays/countries/india.py Outdated
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@holidays/countries/india.py`:
- Around line 403-404: The MH override currently calls
self._add_holiday_mar_3(tr("Holi")) unconditionally, which applies the March 3
Holi to every year; wrap this call so it only runs for 2026 (e.g. check
self.year == 2026) so the March 3 addition is scoped to that single-year
correction in the MH holiday class/method where _add_holiday_mar_3 is invoked.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 6f7847e1-0085-4a92-99bb-f82f4a97ceb1

📥 Commits

Reviewing files that changed from the base of the PR and between adfa010 and f1a3ea3.

📒 Files selected for processing (1)
  • holidays/countries/india.py

Comment thread holidays/countries/india.py Outdated
@KJhellico
Copy link
Copy Markdown
Collaborator

@Devika9705, if this PR replaces #3358, it would be best to close the previous one. But the question of OPTIONAL holidays remains unresolved.

@Devika9705
Copy link
Copy Markdown
Contributor Author

Devika9705 commented Mar 23, 2026

Yes, this PR replaces #3358.
Regarding optional holidays, I have currently not included them since they are not mandatory holidays.
Please let me know if you would like them to be included with a specific flag or handled separately.

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (5a4d6f6) to head (0932c5a).
⚠️ Report is 1 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff            @@
##               dev     #3379   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          313       313           
  Lines        18666     18672    +6     
  Branches      2383      2385    +2     
=========================================
+ Hits         18666     18672    +6     

☔ View full report in Codecov by Sentry.
📢 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.

@KJhellico
Copy link
Copy Markdown
Collaborator

As I understand, Holi is a public holiday (Gazetted) in Maharashtra. So I would add it as public (with the date changed to 2026) and add an exclusion for Maharashtra to the nationwide optional list (you can see examples of similar exceptions in United States).

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@holidays/countries/india.py`:
- Around line 404-408: Replace the ad-hoc 2026-specific assignment and the
fallback to _add_holi by calling the existing helper
_add_holiday_mar_3(tr("Holi")) so the holiday uses the standardized helper; this
removes the need for the explicit date(2026, 3, 3) usage and allows you to drop
the now-unused date import; update the block that currently references _add_holi
and the date literal to call _add_holiday_mar_3 with tr("Holi").
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: ecff7710-0d7b-4282-838e-06e7dc2e1182

📥 Commits

Reviewing files that changed from the base of the PR and between f34ecd4 and 36c1d99.

📒 Files selected for processing (1)
  • holidays/countries/india.py

Comment thread holidays/countries/india.py Outdated
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@holidays/countries/india.py`:
- Around line 45-47: The Maharashtra reference currently points to a live PDF
URL (<https://www.mcgm.gov.in/.../Public%20Holidays%202026.pdf>); archive that
URL (e.g., via web.archive.org) and replace or add the archived link alongside
the live link in the docstring for Maharashtra so the source remains
durable—locate the "Maharashtra:" entry in the module-level docstring (search
for the exact URL or the word "Maharashtra") and update the list to include the
archived web.archive.org URL (or append it in parentheses) while keeping the
original live URL for clarity.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: b9a21044-34da-4eae-8f54-680e194eeaeb

📥 Commits

Reviewing files that changed from the base of the PR and between 36c1d99 and 54884ed.

📒 Files selected for processing (1)
  • holidays/countries/india.py

Comment thread holidays/countries/india.py
Comment thread holidays/countries/india.py Outdated
Comment thread holidays/countries/india.py
Comment thread holidays/countries/india.py Outdated
Comment thread holidays/countries/india.py Outdated
Comment thread holidays/countries/india.py Outdated
Comment thread holidays/countries/india.py Outdated
Comment thread holidays/countries/india.py
Comment thread holidays/countries/india.py Outdated
@KJhellico KJhellico changed the title Update Maharashtra Holi date for 2026 to March 3 based on state government calendar Update India holidays: change 2026 Holi date in Maharashtra (MH) Mar 27, 2026
Comment thread holidays/countries/india.py Outdated
Comment thread holidays/countries/india.py
@KJhellico
Copy link
Copy Markdown
Collaborator

The changes must also be reflected in the tests.

@github-actions github-actions Bot added the test label Apr 9, 2026
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Apr 9, 2026

❌ The last analysis has failed.

See analysis details on SonarQube Cloud

@Devika9705 Devika9705 requested review from KJhellico and PPsyrius April 9, 2026 15:50
Comment thread holidays/countries/india.py Outdated
@Devika9705 Devika9705 requested a review from KJhellico April 10, 2026 02:45
@sonarqubecloud
Copy link
Copy Markdown

Copy link
Copy Markdown
Collaborator

@KJhellico KJhellico left a comment

Choose a reason for hiding this comment

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

LGTM.

Copy link
Copy Markdown
Collaborator

@PPsyrius PPsyrius left a comment

Choose a reason for hiding this comment

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

LGTM 🇮🇳

Copy link
Copy Markdown
Collaborator

@arkid15r arkid15r left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for adding this @Devika9705

@arkid15r arkid15r added this pull request to the merge queue Apr 11, 2026
Merged via the queue into vacanza:dev with commit 0c9ef72 Apr 11, 2026
32 checks passed
@coderabbitai coderabbitai Bot mentioned this pull request Apr 11, 2026
9 tasks
@KJhellico KJhellico mentioned this pull request Apr 20, 2026
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.

4 participants