+
Skip to content

Conversation

saheelsapovadia
Copy link
Contributor

Proposed change

Added Indian National Stock Exchange holidays. The holidays published by the NSE circulars differ from the Hindu calendar holidays present in the existing code.
Hence have taken a direct independent approach relying solely on the official NSE holiday circulars. (references have been attached).

Fixes #2824 (partially for only NSE)

Disclaimer - only year 2023, 2024 & 2025 are added for now. I am waiting for confirmation on the approach. Once approach is approved will add more years for NSE.

Type of change

  • New country/market holidays support (thank you!)
  • Supported country/market holidays update (calendar discrepancy fix, localization)
  • Existing code/documentation/test/process quality improvement (best practice, cleanup, refactoring, optimization)
  • 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

Copy link
Contributor

coderabbitai bot commented Aug 20, 2025

Summary by CodeRabbit

  • New Features

    • Added National Stock Exchange of India market calendar with holidays (2001–2050).
    • Supports localized holiday names in English (India, US) and Hindi, including estimated markers where applicable.
    • Integrated into the available financial markets list for easy selection.
    • Added historical snapshot data to ensure consistent results.
  • Documentation

    • Updated markets table to include the National Stock Exchange of India entry.

Walkthrough

Adds a new National Stock Exchange of India (XNSE/NSE) financial calendar with implementation, registry entry and exports, locale PO files (en_IN, en_US, hi), snapshots (2001–2050), tests, and a README table entry.

Changes

Cohort / File(s) Summary
NSE implementation & exports
holidays/financial/national_stock_exchange_of_india.py, holidays/financial/__init__.py, holidays/registry.py
New NationalStockExchangeOfIndia class with Hindu/Christian/Islamic holiday integrations, confirmed-date maps for select movable holidays, estimated_label, aliases XNSE/NSE, registry entry and package re-exports.
Localization catalogs
holidays/locale/en_IN/LC_MESSAGES/XNSE.po, holidays/locale/en_US/LC_MESSAGES/XNSE.po, holidays/locale/hi/LC_MESSAGES/XNSE.po
Added PO files for NSE holiday names; en_US normalizations, hi translations, en_IN placeholders; includes "%s (estimated)".
Snapshots
snapshots/financial/XNSE.json
New static snapshot mapping dates (2001–2050) to holiday labels (single and multi-label entries).
Tests
tests/financial/test_national_stock_exchange_of_india.py
New comprehensive test suite covering aliases, per-holiday assertions, observed/non-observed behavior, and localization checks.
Docs
README.md
Added National Stock Exchange of India row to Available Financial Markets table (en_IN, en_US, hi).

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Assessment against linked issues

Objective Addressed Explanation
Add NSE market holidays [#2824]
Add BSE market holidays [#2824] No BSE/Bombay Stock Exchange calendar, registry entry, locales, snapshots, or tests added.

Out-of-scope changes

Code Change Explanation
Added/moved brasil_bolsa_balcao registry entry (holidays/registry.py) Change relates to a Brazil market registry entry unrelated to the NSE/BSE objectives in #2824; not requested by the linked issue.

Suggested reviewers

  • KJhellico
  • PPsyrius

Walkthrough

Adds a new National Stock Exchange of India (XNSE/NSE) financial calendar: implementation, registry entry and exports, locale PO files (en_IN, en_US, hi), snapshots (2001–2050), tests, and a README table entry.

Changes

Cohort / File(s) Summary
NSE implementation & exports
holidays/financial/national_stock_exchange_of_india.py, holidays/financial/__init__.py, holidays/registry.py
New NationalStockExchangeOfIndia class (Hindu/Christian/Islamic holiday integrations), confirmed-date maps for some movable holidays, estimated_label handling, aliases XNSE/NSE, registry entry and package re-exports.
Localization catalogs
holidays/locale/en_IN/LC_MESSAGES/XNSE.po, holidays/locale/en_US/LC_MESSAGES/XNSE.po, holidays/locale/hi/LC_MESSAGES/XNSE.po
Added PO files for NSE holiday names including "%s (estimated)" c-format; en_US adapts some English names, hi provides Hindi translations, en_IN placeholders.
Snapshots
snapshots/financial/XNSE.json
New static snapshot mapping dates (2001–2050) to holiday labels (single and multi-label entries).
Tests
tests/financial/test_national_stock_exchange_of_india.py
New comprehensive test suite covering aliases, per-holiday assertions, observed/non-observed behavior, and localization checks (years 2001–2049 range).
Docs
README.md
Added National Stock Exchange of India row to Available Financial Markets table (languages: en_IN, en_US, hi).

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Assessment against linked issues

Objective Addressed Explanation
Add NSE market holidays [#2824]
Add BSE market holidays [#2824] No BSE/Bombay Stock Exchange calendar, registry entry, locales, snapshots, or tests added.

Suggested reviewers

  • KJhellico
  • PPsyrius
  • arkid15r
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

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

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@saheelsapovadia saheelsapovadia changed the title Add india national stock exchange Add india national stock exchange NSE holidays Aug 20, 2025
Copy link
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: 18

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (3)
holidays/locale/en_IN/LC_MESSAGES/XNSE.po (1)

110-113: Remove obsolete entry.

The commented-out c-format “%s (estimated)” block is unrelated; delete to reduce noise.

-#, c-format
-#~ msgid "%s (estimated)"
-#~ msgstr "%s (अनुमानित)"
holidays/registry.py (1)

267-273: Consider keeping FINANCIAL entries alphabetized by key.

Optional, but it makes diffs cleaner over time.

 FINANCIAL: RegistryDict = {
     "european_central_bank": ("EuropeanCentralBank", "XECB", "ECB", "TAR"),
     "ice_futures_europe": ("ICEFuturesEurope", "IFEU"),
-    "ny_stock_exchange": ("NewYorkStockExchange", "XNYS", "NYSE"),
     "brasil_bolsa_balcao": ("BrasilBolsaBalcao", "BVMF", "B3"),
+    "india_national_stock_exchange": ("IndiaNationalStockExchange", "XNSE", "NSE"),
+    "ny_stock_exchange": ("NewYorkStockExchange", "XNYS", "NYSE"),
-    "india_national_stock_exchange": ("IndiaNationalStockExchange", "XNSE", "NSE"),
 }
tests/financial/test_india_stock_exchange.py (1)

208-228: Optional: align hi localization with “Christmas Day” if renamed.

Only needed if you adopt the naming unification.

-            ("2023-12-25", "क्रिसमस"),
+            ("2023-12-25", "क्रिसमस दिवस"),
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between a5a83e8 and a6f575b.

📒 Files selected for processing (8)
  • README.md (1 hunks)
  • holidays/financial/india_national_stock_exchange.py (1 hunks)
  • holidays/locale/en_IN/LC_MESSAGES/XNSE.po (1 hunks)
  • holidays/locale/en_US/LC_MESSAGES/XNSE.po (1 hunks)
  • holidays/locale/hi/LC_MESSAGES/XNSE.po (1 hunks)
  • holidays/registry.py (1 hunks)
  • snapshots/financial/XNSE.json (1 hunks)
  • tests/financial/test_india_stock_exchange.py (1 hunks)
🧰 Additional context used
🧠 Learnings (23)
📓 Common learnings
Learnt from: PPsyrius
PR: vacanza/holidays#2354
File: holidays/countries/fiji.py:146-159
Timestamp: 2025-03-19T16:54:58.657Z
Learning: In the holidays library implementation, explicit holiday dates (like Diwali in Fiji) are only defined for historical years with official sources (2016-2025). Future dates beyond the explicitly defined range are automatically calculated by methods like `_add_diwali`, which provide approximations when official dates aren't yet available.
Learnt from: KJhellico
PR: vacanza/holidays#2614
File: holidays/countries/guyana.py:146-179
Timestamp: 2025-06-14T20:12:37.212Z
Learning: The `_CustomHinduHolidays` mechanism works through `_CustomCalendarType` metaclass which renames public attributes (like `DIWALI_INDIA_DATES`) with a postfix, allowing `_HinduLunisolar::_get_holiday` to find and use custom holiday dates. When `_add_diwali_india()` is called, it uses the custom dates if available rather than calculated dates.
Learnt from: KJhellico
PR: vacanza/holidays#2614
File: holidays/countries/guyana.py:146-179
Timestamp: 2025-06-14T20:12:37.212Z
Learning: The `_CustomHinduHolidays` mechanism works through `_CustomCalendarType` metaclass which renames public attributes (like `DIWALI_INDIA_DATES`) with a postfix, allowing `_HinduLunisolar::_get_holiday` to find and use custom holiday dates. When `_add_diwali_india()` is called, it uses the custom dates if available rather than calculated dates.
📚 Learning: 2025-03-08T11:28:48.652Z
Learnt from: KJhellico
PR: vacanza/holidays#2259
File: holidays/locale/en_IN/LC_MESSAGES/IN.po:285-299
Timestamp: 2025-03-08T11:28:48.652Z
Learning: In the holidays project, message IDs (msgids) in locale files use region-specific naming conventions (e.g., "Muharram", "Id-ul-Fitr" in en_IN locale for India), while translator comments use internationally recognized names from the project's default locale (en_US) such as "Ashura", "Eid al-Fitr". This difference is intentional for proper localization.

Applied to files:

  • holidays/locale/hi/LC_MESSAGES/XNSE.po
  • holidays/locale/en_US/LC_MESSAGES/XNSE.po
  • holidays/locale/en_IN/LC_MESSAGES/XNSE.po
📚 Learning: 2025-03-30T18:25:07.087Z
Learnt from: KJhellico
PR: vacanza/holidays#2388
File: holidays/locale/en_CI/LC_MESSAGES/CI.po:88-88
Timestamp: 2025-03-30T18:25:07.087Z
Learning: In the holidays library, localization files have a specific structure: message comments are in standard English (en_US) describing the holiday, while actual translations (msgstr) should use the locale-specific terminology (e.g., en_CI for Ivory Coast English). For example, "Night of Power" in standard English is translated as "Lailatou-Kadr" in Ivory Coast English.

Applied to files:

  • holidays/locale/hi/LC_MESSAGES/XNSE.po
  • holidays/locale/en_US/LC_MESSAGES/XNSE.po
  • holidays/locale/en_IN/LC_MESSAGES/XNSE.po
📚 Learning: 2025-06-28T10:39:19.185Z
Learnt from: KJhellico
PR: vacanza/holidays#2684
File: holidays/locale/it/LC_MESSAGES/SM.po:13-13
Timestamp: 2025-06-28T10:39:19.185Z
Learning: In the holidays project, .po file header comments use the format "# [Country] holidays." for default language files (without trailing hash) and "# [Country] holidays [locale] localization." for non-default language files (also without trailing hash).

Applied to files:

  • holidays/locale/hi/LC_MESSAGES/XNSE.po
  • holidays/locale/en_US/LC_MESSAGES/XNSE.po
  • holidays/locale/en_IN/LC_MESSAGES/XNSE.po
📚 Learning: 2025-05-06T15:25:44.333Z
Learnt from: KJhellico
PR: vacanza/holidays#2530
File: holidays/locale/ca/LC_MESSAGES/AD.po:31-40
Timestamp: 2025-05-06T15:25:44.333Z
Learning: In the Holidays project, msgid fields in localization files contain strings in the entity's default language (as defined by default_language attribute), not English source strings as in standard gettext implementations.

Applied to files:

  • holidays/locale/hi/LC_MESSAGES/XNSE.po
  • holidays/locale/en_US/LC_MESSAGES/XNSE.po
  • holidays/locale/en_IN/LC_MESSAGES/XNSE.po
📚 Learning: 2025-06-11T18:32:25.595Z
Learnt from: ankushhKapoor
PR: vacanza/holidays#2601
File: holidays/locale/en_MN/LC_MESSAGES/MN.po:13-14
Timestamp: 2025-06-11T18:32:25.595Z
Learning: For non-default locale `.po` files, the header comment format is:
`# <Country> holidays <locale> localization.` (no trailing hash).

Applied to files:

  • holidays/locale/hi/LC_MESSAGES/XNSE.po
  • holidays/locale/en_US/LC_MESSAGES/XNSE.po
  • holidays/locale/en_IN/LC_MESSAGES/XNSE.po
📚 Learning: 2025-06-25T20:55:00.642Z
Learnt from: KJhellico
PR: vacanza/holidays#2651
File: holidays/locale/nl/LC_MESSAGES/BQ.po:29-95
Timestamp: 2025-06-25T20:55:00.642Z
Learning: In the holidays library, Dutch locale files (.po) with `X-Source-Language: nl` should have empty msgstr entries when the target language is also Dutch. The library uses fallback=True with gettext, which returns the original msgid when msgstr is empty. This is the correct pattern for native language files and does not cause blank holiday names.

Applied to files:

  • holidays/locale/hi/LC_MESSAGES/XNSE.po
  • holidays/locale/en_US/LC_MESSAGES/XNSE.po
  • holidays/locale/en_IN/LC_MESSAGES/XNSE.po
📚 Learning: 2025-06-26T15:34:35.476Z
Learnt from: KJhellico
PR: vacanza/holidays#2676
File: holidays/locale/en_US/LC_MESSAGES/TN.po:17-28
Timestamp: 2025-06-26T15:34:35.476Z
Learning: In the holidays project, .po file header metadata updates (version numbers, revision dates, translator information) are legitimate changes when part of localization work and don't require `make l10n` regeneration. The `make l10n` command is primarily for formatting fixes and missing translator comments, not for intentional metadata updates.

Applied to files:

  • holidays/locale/hi/LC_MESSAGES/XNSE.po
  • holidays/locale/en_US/LC_MESSAGES/XNSE.po
  • holidays/locale/en_IN/LC_MESSAGES/XNSE.po
📚 Learning: 2025-03-05T17:51:00.633Z
Learnt from: KJhellico
PR: vacanza/holidays#2259
File: holidays/locale/en_IN/LC_MESSAGES/IN.po:30-299
Timestamp: 2025-03-05T17:51:00.633Z
Learning: In the Holidays project, .po files for a country's default locale use empty msgstr fields as a standard convention.

Applied to files:

  • holidays/locale/hi/LC_MESSAGES/XNSE.po
  • holidays/locale/en_US/LC_MESSAGES/XNSE.po
  • holidays/locale/en_IN/LC_MESSAGES/XNSE.po
📚 Learning: 2025-04-05T08:12:19.986Z
Learnt from: PPsyrius
PR: vacanza/holidays#2402
File: holidays/locale/en_TT/LC_MESSAGES/TT.po:46-48
Timestamp: 2025-04-05T08:12:19.986Z
Learning: In the holidays library, localization (PO) files follow this convention: comments (#.) always use American English (en_US) spelling, while the msgid content follows the locale-specific spelling standards of the target language.

Applied to files:

  • holidays/locale/hi/LC_MESSAGES/XNSE.po
  • holidays/locale/en_US/LC_MESSAGES/XNSE.po
  • holidays/locale/en_IN/LC_MESSAGES/XNSE.po
📚 Learning: 2025-04-03T05:59:57.480Z
Learnt from: PPsyrius
PR: vacanza/holidays#2407
File: snapshots/countries/TL_COMMON.json:7-7
Timestamp: 2025-04-03T05:59:57.480Z
Learning: In the holidays project, snapshot files (like snapshots/countries/TL_COMMON.json) are auto-generated when running `make snapshot` and should not be manually edited. Semicolons (;) in holiday entries are used as separators when multiple holidays occur on the same date.

Applied to files:

  • snapshots/financial/XNSE.json
📚 Learning: 2025-06-24T17:26:17.728Z
Learnt from: KJhellico
PR: vacanza/holidays#2654
File: snapshots/countries/CV_RS.json:471-478
Timestamp: 2025-06-24T17:26:17.728Z
Learning: Snapshot files in the holidays library (like those in snapshots/countries/) are generated automatically and should not be manually edited. Any issues with snapshot content should be addressed in the source code that generates them, not in the snapshot files themselves.

Applied to files:

  • snapshots/financial/XNSE.json
📚 Learning: 2025-03-19T16:54:58.657Z
Learnt from: PPsyrius
PR: vacanza/holidays#2354
File: holidays/countries/fiji.py:146-159
Timestamp: 2025-03-19T16:54:58.657Z
Learning: In the holidays library implementation, explicit holiday dates (like Diwali in Fiji) are only defined for historical years with official sources (2016-2025). Future dates beyond the explicitly defined range are automatically calculated by methods like `_add_diwali`, which provide approximations when official dates aren't yet available.

Applied to files:

  • snapshots/financial/XNSE.json
  • holidays/locale/en_IN/LC_MESSAGES/XNSE.po
📚 Learning: 2025-04-05T06:49:06.217Z
Learnt from: PPsyrius
PR: vacanza/holidays#2386
File: tests/countries/test_nepal.py:499-536
Timestamp: 2025-04-05T06:49:06.217Z
Learning: In the holidays project, test files follow a dual testing approach: individual methods test specific holidays across multiple years, while comprehensive year-specific tests (e.g., `test_2025`) verify all holidays for a specific year in a single assertion. Both approaches serve different testing purposes and complement each other.

Applied to files:

  • tests/financial/test_india_stock_exchange.py
📚 Learning: 2025-04-05T04:47:27.213Z
Learnt from: PPsyrius
PR: vacanza/holidays#2416
File: tests/countries/test_turkmenistan.py:52-64
Timestamp: 2025-04-05T04:47:27.213Z
Learning: For holiday tests in the vacanza/holidays project, structure tests by individual holidays rather than by years. Each test method should focus on a specific holiday and test it across multiple years (from start_year through 2050) using helper methods like `assertHolidayName`. For fixed holidays, use generators like `(f"{year}-01-01" for year in range(1991, 2051))`. For movable holidays, specify individual dates for specific years followed by a range check.

Applied to files:

  • tests/financial/test_india_stock_exchange.py
📚 Learning: 2025-05-06T21:07:11.577Z
Learnt from: KJhellico
PR: vacanza/holidays#2530
File: tests/countries/test_andorra.py:23-28
Timestamp: 2025-05-06T21:07:11.577Z
Learning: In the holidays project, test methods for country holidays follow a standard form where year ranges are explicitly recreated in each test method rather than being stored as class variables, to maintain consistency across all country tests.

Applied to files:

  • tests/financial/test_india_stock_exchange.py
📚 Learning: 2025-04-05T04:29:38.042Z
Learnt from: PPsyrius
PR: vacanza/holidays#2416
File: tests/countries/test_turkmenistan.py:85-86
Timestamp: 2025-04-05T04:29:38.042Z
Learning: For testing holiday implementations in the vacanza/holidays repository, recommend using `from tests.common import CommonCountryTests` as the base class instead of directly using `unittest.TestCase` to maintain consistency with project conventions and leverage common test utilities.

Applied to files:

  • tests/financial/test_india_stock_exchange.py
📚 Learning: 2025-07-09T21:16:35.145Z
Learnt from: KJhellico
PR: vacanza/holidays#2623
File: tests/countries/test_christmas_island.py:136-146
Timestamp: 2025-07-09T21:16:35.145Z
Learning: In Christmas Island's holiday implementation, the test_christmas_day method cannot use assertNoNonObservedHoliday because in some years observed Christmas Day overlaps with Boxing Day when both holidays are moved due to weekend conflicts, causing the standard non-observed holiday check to fail inappropriately.

Applied to files:

  • tests/financial/test_india_stock_exchange.py
📚 Learning: 2025-08-12T17:16:54.497Z
Learnt from: PPsyrius
PR: vacanza/holidays#2794
File: tests/calendars/test_julian.py:35-36
Timestamp: 2025-08-12T17:16:54.497Z
Learning: In the vacanza/holidays project calendar tests (Thai, Ethiopian, Julian, etc.), the established testing pattern for validation methods is to use simple for loops like `for year in known_data_dict:` followed by `self.assertEqual(expected, actual)` without using unittest's subTest feature. This pattern is consistently maintained across all calendar test files.

Applied to files:

  • tests/financial/test_india_stock_exchange.py
📚 Learning: 2025-06-14T20:12:37.212Z
Learnt from: KJhellico
PR: vacanza/holidays#2614
File: holidays/countries/guyana.py:146-179
Timestamp: 2025-06-14T20:12:37.212Z
Learning: The `_CustomHinduHolidays` mechanism works through `_CustomCalendarType` metaclass which renames public attributes (like `DIWALI_INDIA_DATES`) with a postfix, allowing `_HinduLunisolar::_get_holiday` to find and use custom holiday dates. When `_add_diwali_india()` is called, it uses the custom dates if available rather than calculated dates.

Applied to files:

  • holidays/financial/india_national_stock_exchange.py
📚 Learning: 2025-06-19T02:34:18.382Z
Learnt from: PPsyrius
PR: vacanza/holidays#2643
File: holidays/countries/mauritius.py:144-169
Timestamp: 2025-06-19T02:34:18.382Z
Learning: Custom holiday classes that extend _CustomHinduHolidays, _CustomIslamicHolidays, _CustomBuddhistHolidays, etc. in the holidays library do not use docstrings. They follow a pattern of using only inline comments above date dictionaries, as seen in Malaysia, Singapore, UAE, and other country implementations.

Applied to files:

  • holidays/locale/en_IN/LC_MESSAGES/XNSE.po
📚 Learning: 2025-05-10T04:02:13.815Z
Learnt from: PPsyrius
PR: vacanza/holidays#2537
File: holidays/countries/finland.py:249-253
Timestamp: 2025-05-10T04:02:13.815Z
Learning: Holiday name comments directly above tr() function calls in the holidays package should only contain the holiday name itself (e.g., "# Independence Day.") without any additional context, dates, or historical information.

Applied to files:

  • holidays/locale/en_IN/LC_MESSAGES/XNSE.po
📚 Learning: 2025-05-10T04:32:15.760Z
Learnt from: PPsyrius
PR: vacanza/holidays#2537
File: holidays/countries/finland.py:0-0
Timestamp: 2025-05-10T04:32:15.760Z
Learning: In the holidays package, detailed historical context and additional information should be added as comments at the method level or above conditional blocks, while comments directly above tr() function calls should only contain the holiday name itself (e.g., "# Independence Day.").

Applied to files:

  • holidays/locale/en_IN/LC_MESSAGES/XNSE.po
🔇 Additional comments (15)
snapshots/financial/XNSE.json (2)

3-3: Align “Holi” naming.

“Holi Festival” vs “Holi” should be unified to the project’s canonical default-language name in the generator.

Also applies to: 20-20, 33-33


1-46: Snapshot language alignment: re-generate with en_IN msgids

It looks like the XNSE snapshot was generated using en_US-style holiday names, but the calendar class’s default_language is set to “en_IN.” To keep message IDs consistent with the code (and the README’s default), please re-run the snapshot generator so that the JSON uses the exact strings passed to tr(…) in IndiaNationalStockExchange.

Key mismatches to address before re-snapshot:

  • 2023-03-08: code uses tr("Holi") → snapshot has "Holi Festival"
  • 2023-06-29: code uses tr("Bakri Id") → snapshot has "Eid al-Adha"
  • 2023-12-25: code uses tr("Christmas") → snapshot has "Christmas Day"
  • 2024-03-08: code uses tr("Mahashivratri") (no space) → snapshot has "Maha Shivaratri"
  • 2025-10-21: code uses tr("Diwali Laxmi Pujan") → snapshot has "Diwali - Lakshmi Puja"
  • 2025-11-05: code uses tr("Prakash Gurpurb Sri Guru Nanak Dev") → snapshot has "Guru Nanak Gurpurab"

Action:

  1. Ensure IndiaNationalStockExchange.default_language remains “en_IN.”
  2. Regenerate XNSE.json so its values exactly match the tr(…) IDs in the code.
⛔ Skipped due to learnings
Learnt from: KJhellico
PR: vacanza/holidays#2259
File: holidays/locale/en_IN/LC_MESSAGES/IN.po:285-299
Timestamp: 2025-03-08T11:28:48.652Z
Learning: In the holidays project, message IDs (msgids) in locale files use region-specific naming conventions (e.g., "Muharram", "Id-ul-Fitr" in en_IN locale for India), while translator comments use internationally recognized names from the project's default locale (en_US) such as "Ashura", "Eid al-Fitr". This difference is intentional for proper localization.
Learnt from: PPsyrius
PR: vacanza/holidays#2642
File: snapshots/countries/FR_MF.json:658-662
Timestamp: 2025-06-18T10:36:52.263Z
Learning: Snapshot files in the `snapshots/` directory are auto-generated by the `make snapshot` command and use `en_US` locale when the countries/markets entities support localization (l10n). The localization happens at the application level, not in the snapshot files themselves.
Learnt from: PPsyrius
PR: vacanza/holidays#2407
File: snapshots/countries/TL_COMMON.json:7-7
Timestamp: 2025-04-03T05:59:57.480Z
Learning: In the holidays project, snapshot files (like snapshots/countries/TL_COMMON.json) are auto-generated when running `make snapshot` and should not be manually edited. Semicolons (;) in holiday entries are used as separators when multiple holidays occur on the same date.
Learnt from: KJhellico
PR: vacanza/holidays#2654
File: snapshots/countries/CV_RS.json:471-478
Timestamp: 2025-06-24T17:26:17.728Z
Learning: Snapshot files in the holidays library (like those in snapshots/countries/) are generated automatically and should not be manually edited. Any issues with snapshot content should be addressed in the source code that generates them, not in the snapshot files themselves.
Learnt from: KJhellico
PR: vacanza/holidays#2388
File: holidays/locale/en_CI/LC_MESSAGES/CI.po:88-88
Timestamp: 2025-03-30T18:25:07.087Z
Learning: In the holidays library, localization files have a specific structure: message comments are in standard English (en_US) describing the holiday, while actual translations (msgstr) should use the locale-specific terminology (e.g., en_CI for Ivory Coast English). For example, "Night of Power" in standard English is translated as "Lailatou-Kadr" in Ivory Coast English.
Learnt from: PPsyrius
PR: vacanza/holidays#2354
File: holidays/countries/fiji.py:146-159
Timestamp: 2025-03-19T16:54:58.657Z
Learning: In the holidays library implementation, explicit holiday dates (like Diwali in Fiji) are only defined for historical years with official sources (2016-2025). Future dates beyond the explicitly defined range are automatically calculated by methods like `_add_diwali`, which provide approximations when official dates aren't yet available.
holidays/locale/hi/LC_MESSAGES/XNSE.po (2)

94-96: Use semicolon as multi-holiday delimiter.

If the generator adopts “Gandhi Jayanti; Dussehra” (semicolon), ensure the msgid here mirrors exactly; otherwise translations won’t resolve. Update only after the generator/source strings are settled.


35-37: Minor consistency check: “Holi”, “Christmas”, “Christmas Day”.

Confirm the generator’s default msgids you’re translating: if snapshot/generator uses “Holi Festival” or “Christmas Day”, the msgids here must match exactly. Don’t adjust until the source strings are confirmed.

Also applies to: 78-80, 107-109

holidays/locale/en_IN/LC_MESSAGES/XNSE.po (2)

30-34: Verify msgids match generator defaults.

Examples: “Holi”, “Id-Ul-Fitr (Ramadan Eid)”, “Mahatma Gandhi Jayanti/Dussehra”, “Diwali Laxmi Pujan”, “Prakash Gurpurb Sri Guru Nanak Dev”. Ensure these msgids exactly match the strings used in the NSE calendar; otherwise lookups won’t resolve and translations in en_US/hi won’t apply correctly.

Also applies to: 35-37, 81-87, 94-99, 101-106


32-109: Done: msgstr fields cleared in default-locale XNSE.po
Nice work—every msgstr entry in lines 32–109 of holidays/locale/en_IN/LC_MESSAGES/XNSE.po is now empty, matching our default-locale convention.

holidays/locale/en_US/LC_MESSAGES/XNSE.po (2)

75-77: Good normalization choices.

Nice mapping to en_US conventions:

  • Gurunanak Jayanti → “Guru Nanak’s Birthday”
  • Mahashivratri → “Maha Shivaratri”
  • Id-Ul-Fitr (Ramadan Eid) → “Eid al-Fitr”
  • Diwali Laxmi Pujan → “Diwali - Lakshmi Puja”
  • Prakash Gurpurb… → “Guru Nanak Gurpurab”

Also applies to: 81-87, 97-100, 104-106


32-34: Confirm msgids mirror generator defaults.

Double-check “Republic Day”, “Christmas”, “Christmas Day” exactly match code msgids; any drift causes untranslated output.

Also applies to: 78-80, 107-109

README.md (1)

1834-1834: Default language and supported languages are correct.

The IndiaNationalStockExchange class in holidays/financial/india_national_stock_exchange.py defines

  • line 47: default_language = "en_IN"
  • line 48: supported_languages = ("en_IN", "en_US", "hi")

These match the README snippet (<strong>en_IN</strong>, en_US, hi). No changes needed.

holidays/registry.py (2)

267-273: Registry entry for XNSE/NSE looks correct and consistent.

Loader path and aliases align with the new module and class names. Good placement and codes (XNSE, NSE) match expected lengths for get_financial_codes.


267-273: Registry wiring validated successfully

All registry entries, class names, aliases, locale files, and snapshot artifacts for India National Stock Exchange line up correctly:

  • holidays/registry.py contains the "india_national_stock_exchange": ("IndiaNationalStockExchange", "XNSE", "NSE") entry
  • holidays/financial/india_national_stock_exchange.py defines class IndiaNationalStockExchange, plus its NSE and XNSE aliases
  • Locale files XNSE.po exist under locale/en_IN/LC_MESSAGES/, locale/en_US/LC_MESSAGES/, and locale/hi/LC_MESSAGES/
  • Snapshot artifact snapshots/financial/XNSE.json is present

No drift detected—nothing further needed here.

holidays/financial/india_national_stock_exchange.py (2)

118-127: Aliases NSE/XNSE are fine.

Keeps ergonomic imports and preserves code readability.


100-116: Do not mark “Diwali Laxmi Pujan” (muhurat trading day) as a holiday.

Per NSE circulars, Laxmi Pujan day has a special one-hour muhurat session and is not a full trading holiday. Listing it as a holiday will incorrectly report the market as closed.

         elif self._year == 2025:
             # https://nsearchives.nseindia.com/content/circulars/CMTR65587.pdf
             self._add_holiday(tr("Mahashivratri"), FEB, 26)
             self._add_holiday(tr("Holi"), MAR, 14)
             self._add_holiday(tr("Id-Ul-Fitr (Ramadan Eid)"), MAR, 31)
             self._add_holiday(tr("Shri Mahavir Jayanti"), APR, 10)
             self._add_holiday(tr("Dr. Baba Saheb Ambedkar Jayanti"), APR, 14)
             self._add_holiday(tr("Good Friday"), APR, 18)
             self._add_holiday(tr("Maharashtra Day"), MAY, 1)
             self._add_holiday(tr("Independence Day"), AUG, 15)
             self._add_holiday(tr("Ganesh Chaturthi"), AUG, 27)
             self._add_holiday(tr("Mahatma Gandhi Jayanti/Dussehra"), OCT, 2)
-            self._add_holiday(tr("Diwali Laxmi Pujan"), OCT, 21)  # muhurat trading was conducted
             self._add_holiday(tr("Diwali Balipratipada"), OCT, 22)
             self._add_holiday(tr("Prakash Gurpurb Sri Guru Nanak Dev"), NOV, 5)
             self._add_holiday(tr("Christmas Day"), DEC, 25)

Follow-up: tests and snapshots that assert Laxmi Pujan as a holiday will need to be updated accordingly.

⛔ Skipped due to learnings
Learnt from: PPsyrius
PR: vacanza/holidays#2354
File: holidays/countries/fiji.py:146-159
Timestamp: 2025-03-19T16:54:58.657Z
Learning: In the holidays library implementation, explicit holiday dates (like Diwali in Fiji) are only defined for historical years with official sources (2016-2025). Future dates beyond the explicitly defined range are automatically calculated by methods like `_add_diwali`, which provide approximations when official dates aren't yet available.
Learnt from: KJhellico
PR: vacanza/holidays#2614
File: holidays/countries/guyana.py:146-179
Timestamp: 2025-06-14T20:12:37.212Z
Learning: The `_CustomHinduHolidays` mechanism works through `_CustomCalendarType` metaclass which renames public attributes (like `DIWALI_INDIA_DATES`) with a postfix, allowing `_HinduLunisolar::_get_holiday` to find and use custom holiday dates. When `_add_diwali_india()` is called, it uses the custom dates if available rather than calculated dates.
Learnt from: KJhellico
PR: vacanza/holidays#2614
File: holidays/countries/guyana.py:146-179
Timestamp: 2025-06-14T20:12:37.212Z
Learning: The `_CustomHinduHolidays` mechanism works through `_CustomCalendarType` metaclass which renames public attributes (like `DIWALI_INDIA_DATES`) with a postfix, allowing `_HinduLunisolar::_get_holiday` to find and use custom holiday dates. When `_add_diwali_india()` is called, it uses the custom dates if available rather than calculated dates.
tests/financial/test_india_stock_exchange.py (2)

108-146: Tests look exhaustive for the covered years.

Nice coverage of aliases, per-holiday assertions, and full-year sets. Good l10n checks as well.


148-165: Drop “Diwali Laxmi Pujan” from the 2025 full-year set.

Aligns with exchange calendars: Balipratipada is the holiday; Laxmi Pujan has muhurat trading.

             ("2025-08-27", "Ganesh Chaturthi"),
             ("2025-10-02", "Mahatma Gandhi Jayanti/Dussehra"),
-            ("2025-10-21", "Diwali Laxmi Pujan"),
             ("2025-10-22", "Diwali Balipratipada"),
             ("2025-11-05", "Prakash Gurpurb Sri Guru Nanak Dev"),
             ("2025-12-25", "Christmas Day"),
⛔ Skipped due to learnings
Learnt from: PPsyrius
PR: vacanza/holidays#2354
File: holidays/countries/fiji.py:146-159
Timestamp: 2025-03-19T16:54:58.657Z
Learning: In the holidays library implementation, explicit holiday dates (like Diwali in Fiji) are only defined for historical years with official sources (2016-2025). Future dates beyond the explicitly defined range are automatically calculated by methods like `_add_diwali`, which provide approximations when official dates aren't yet available.
Learnt from: KJhellico
PR: vacanza/holidays#2614
File: holidays/countries/guyana.py:146-179
Timestamp: 2025-06-14T20:12:37.212Z
Learning: The `_CustomHinduHolidays` mechanism works through `_CustomCalendarType` metaclass which renames public attributes (like `DIWALI_INDIA_DATES`) with a postfix, allowing `_HinduLunisolar::_get_holiday` to find and use custom holiday dates. When `_add_diwali_india()` is called, it uses the custom dates if available rather than calculated dates.
Learnt from: KJhellico
PR: vacanza/holidays#2614
File: holidays/countries/guyana.py:146-179
Timestamp: 2025-06-14T20:12:37.212Z
Learning: The `_CustomHinduHolidays` mechanism works through `_CustomCalendarType` metaclass which renames public attributes (like `DIWALI_INDIA_DATES`) with a postfix, allowing `_HinduLunisolar::_get_holiday` to find and use custom holiday dates. When `_add_diwali_india()` is called, it uses the custom dates if available rather than calculated dates.
Learnt from: PPsyrius
PR: vacanza/holidays#2386
File: tests/countries/test_nepal.py:499-536
Timestamp: 2025-04-05T06:49:06.217Z
Learning: In the holidays project, test files follow a dual testing approach: individual methods test specific holidays across multiple years, while comprehensive year-specific tests (e.g., `test_2025`) verify all holidays for a specific year in a single assertion. Both approaches serve different testing purposes and complement each other.
Learnt from: PPsyrius
PR: vacanza/holidays#2416
File: tests/countries/test_turkmenistan.py:52-64
Timestamp: 2025-04-05T04:47:27.213Z
Learning: For holiday tests in the vacanza/holidays project, structure tests by individual holidays rather than by years. Each test method should focus on a specific holiday and test it across multiple years (from start_year through 2050) using helper methods like `assertHolidayName`. For fixed holidays, use generators like `(f"{year}-01-01" for year in range(1991, 2051))`. For movable holidays, specify individual dates for specific years followed by a range check.

Copy link

codecov bot commented Aug 20, 2025

Codecov Report

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

Additional details and impacted files
@@            Coverage Diff            @@
##               dev     #2834   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          293       294    +1     
  Lines        17390     17445   +55     
  Branches      2259      2262    +3     
=========================================
+ Hits         17390     17445   +55     

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

Copy link
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: 11

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
holidays/registry.py (1)

267-273: Add missing NSE/XNSE aliases for lazy loading

We confirmed that default_language = "en_IN" is defined, but there are no assignments for XNSE or NSE in holidays/financial/national_stock_exchange_of_india.py. Without these, the registry’s aliases won’t resolve and lazy loading will fail.

Please add the following immediately after the class definition:

class NationalStockExchangeOfIndia(ObservedHolidayBase):
    """National Stock Exchange of India (NSE) holidays."""
    default_language = "en_IN"
    # …rest of implementation…

# Aliases for registry
XNSE = NationalStockExchangeOfIndia
NSE  = NationalStockExchangeOfIndia
holidays/locale/en_IN/LC_MESSAGES/XNSE.po (1)

29-98: Empty msgstr entries required for the default en_IN locale

Since NationalStockExchangeOfIndia.default_language is set to "en_IN", the XNSE translation catalog (holidays/locale/en_IN/LC_MESSAGES/XNSE.po) represents the source language and should use empty msgstr fields (the system will fall back to msgid). Leaving them non-empty risks typos and unnecessary duplication.

Please update all entries in XNSE.po (lines 29–98) from:

-msgid "Republic Day"
-msgstr "Republic Day"
+msgid "Republic Day"
+msgstr ""

…and similarly clear every other msgstr in that block.

♻️ Duplicate comments (5)
README.md (1)

1831-1835: Naming and table structure fixed — good.

Official name used and the extra cell is gone. Row now conforms to the 4-column header.

snapshots/financial/XNSE.json (2)

15-15: Resolved: Diwali-Balipratipada naming now consistent.

The hyphenation is uniform across years. No further action.

Also applies to: 43-43


41-41: Use semicolon to separate co-occurring holidays.

Snapshots standardize on “;” as the multi-holiday separator. The slash here breaks that convention.

Action: fix the generator to emit “Gandhi Jayanti; Dussehra”, then re-run make snapshot. Do not hand-edit the snapshot.

holidays/locale/hi/LC_MESSAGES/XNSE.po (1)

15-28: Header is correct for Hindi.

Language is set to “hi” and metadata looks fine.

holidays/locale/en_IN/LC_MESSAGES/XNSE.po (1)

15-28: Header looks good and no fuzzy flag — nice.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between a6f575b and d507420.

📒 Files selected for processing (8)
  • README.md (1 hunks)
  • holidays/financial/national_stock_exchange_of_india.py (1 hunks)
  • holidays/locale/en_IN/LC_MESSAGES/XNSE.po (1 hunks)
  • holidays/locale/en_US/LC_MESSAGES/XNSE.po (1 hunks)
  • holidays/locale/hi/LC_MESSAGES/XNSE.po (1 hunks)
  • holidays/registry.py (1 hunks)
  • snapshots/financial/XNSE.json (1 hunks)
  • tests/financial/test_india_stock_exchange.py (1 hunks)
🧰 Additional context used
🧠 Learnings (32)
📚 Learning: 2025-04-03T05:59:57.480Z
Learnt from: PPsyrius
PR: vacanza/holidays#2407
File: snapshots/countries/TL_COMMON.json:7-7
Timestamp: 2025-04-03T05:59:57.480Z
Learning: In the holidays project, snapshot files (like snapshots/countries/TL_COMMON.json) are auto-generated when running `make snapshot` and should not be manually edited. Semicolons (;) in holiday entries are used as separators when multiple holidays occur on the same date.

Applied to files:

  • snapshots/financial/XNSE.json
📚 Learning: 2025-06-24T17:26:17.728Z
Learnt from: KJhellico
PR: vacanza/holidays#2654
File: snapshots/countries/CV_RS.json:471-478
Timestamp: 2025-06-24T17:26:17.728Z
Learning: Snapshot files in the holidays library (like those in snapshots/countries/) are generated automatically and should not be manually edited. Any issues with snapshot content should be addressed in the source code that generates them, not in the snapshot files themselves.

Applied to files:

  • snapshots/financial/XNSE.json
📚 Learning: 2025-04-23T09:22:41.753Z
Learnt from: PPsyrius
PR: vacanza/holidays#2489
File: holidays/countries/sao_tome_and_principe.py:86-88
Timestamp: 2025-04-23T09:22:41.753Z
Learning: For holiday definitions in the holidays package, keep comments simple with just the holiday name (e.g., "# Independence Day.") rather than including dates or historical context, as the function names already encode the date information.

Applied to files:

  • snapshots/financial/XNSE.json
📚 Learning: 2025-03-19T16:54:58.657Z
Learnt from: PPsyrius
PR: vacanza/holidays#2354
File: holidays/countries/fiji.py:146-159
Timestamp: 2025-03-19T16:54:58.657Z
Learning: In the holidays library implementation, explicit holiday dates (like Diwali in Fiji) are only defined for historical years with official sources (2016-2025). Future dates beyond the explicitly defined range are automatically calculated by methods like `_add_diwali`, which provide approximations when official dates aren't yet available.

Applied to files:

  • snapshots/financial/XNSE.json
📚 Learning: 2025-03-08T11:28:48.652Z
Learnt from: KJhellico
PR: vacanza/holidays#2259
File: holidays/locale/en_IN/LC_MESSAGES/IN.po:285-299
Timestamp: 2025-03-08T11:28:48.652Z
Learning: In the holidays project, message IDs (msgids) in locale files use region-specific naming conventions (e.g., "Muharram", "Id-ul-Fitr" in en_IN locale for India), while translator comments use internationally recognized names from the project's default locale (en_US) such as "Ashura", "Eid al-Fitr". This difference is intentional for proper localization.

Applied to files:

  • holidays/locale/hi/LC_MESSAGES/XNSE.po
  • holidays/locale/en_US/LC_MESSAGES/XNSE.po
  • holidays/locale/en_IN/LC_MESSAGES/XNSE.po
📚 Learning: 2025-03-30T18:25:07.087Z
Learnt from: KJhellico
PR: vacanza/holidays#2388
File: holidays/locale/en_CI/LC_MESSAGES/CI.po:88-88
Timestamp: 2025-03-30T18:25:07.087Z
Learning: In the holidays library, localization files have a specific structure: message comments are in standard English (en_US) describing the holiday, while actual translations (msgstr) should use the locale-specific terminology (e.g., en_CI for Ivory Coast English). For example, "Night of Power" in standard English is translated as "Lailatou-Kadr" in Ivory Coast English.

Applied to files:

  • holidays/locale/hi/LC_MESSAGES/XNSE.po
  • holidays/locale/en_US/LC_MESSAGES/XNSE.po
  • holidays/locale/en_IN/LC_MESSAGES/XNSE.po
📚 Learning: 2025-06-28T10:39:19.185Z
Learnt from: KJhellico
PR: vacanza/holidays#2684
File: holidays/locale/it/LC_MESSAGES/SM.po:13-13
Timestamp: 2025-06-28T10:39:19.185Z
Learning: In the holidays project, .po file header comments use the format "# [Country] holidays." for default language files (without trailing hash) and "# [Country] holidays [locale] localization." for non-default language files (also without trailing hash).

Applied to files:

  • holidays/locale/hi/LC_MESSAGES/XNSE.po
  • holidays/locale/en_US/LC_MESSAGES/XNSE.po
  • holidays/locale/en_IN/LC_MESSAGES/XNSE.po
📚 Learning: 2025-06-25T20:55:00.642Z
Learnt from: KJhellico
PR: vacanza/holidays#2651
File: holidays/locale/nl/LC_MESSAGES/BQ.po:29-95
Timestamp: 2025-06-25T20:55:00.642Z
Learning: In the holidays library, Dutch locale files (.po) with `X-Source-Language: nl` should have empty msgstr entries when the target language is also Dutch. The library uses fallback=True with gettext, which returns the original msgid when msgstr is empty. This is the correct pattern for native language files and does not cause blank holiday names.

Applied to files:

  • holidays/locale/hi/LC_MESSAGES/XNSE.po
  • holidays/locale/en_US/LC_MESSAGES/XNSE.po
  • holidays/locale/en_IN/LC_MESSAGES/XNSE.po
📚 Learning: 2025-06-11T18:32:25.595Z
Learnt from: ankushhKapoor
PR: vacanza/holidays#2601
File: holidays/locale/en_MN/LC_MESSAGES/MN.po:13-14
Timestamp: 2025-06-11T18:32:25.595Z
Learning: For non-default locale `.po` files, the header comment format is:
`# <Country> holidays <locale> localization.` (no trailing hash).

Applied to files:

  • holidays/locale/hi/LC_MESSAGES/XNSE.po
  • holidays/locale/en_US/LC_MESSAGES/XNSE.po
  • holidays/locale/en_IN/LC_MESSAGES/XNSE.po
📚 Learning: 2025-05-06T15:25:44.333Z
Learnt from: KJhellico
PR: vacanza/holidays#2530
File: holidays/locale/ca/LC_MESSAGES/AD.po:31-40
Timestamp: 2025-05-06T15:25:44.333Z
Learning: In the Holidays project, msgid fields in localization files contain strings in the entity's default language (as defined by default_language attribute), not English source strings as in standard gettext implementations.

Applied to files:

  • holidays/locale/hi/LC_MESSAGES/XNSE.po
  • holidays/locale/en_US/LC_MESSAGES/XNSE.po
  • holidays/locale/en_IN/LC_MESSAGES/XNSE.po
📚 Learning: 2025-06-26T15:34:35.476Z
Learnt from: KJhellico
PR: vacanza/holidays#2676
File: holidays/locale/en_US/LC_MESSAGES/TN.po:17-28
Timestamp: 2025-06-26T15:34:35.476Z
Learning: In the holidays project, .po file header metadata updates (version numbers, revision dates, translator information) are legitimate changes when part of localization work and don't require `make l10n` regeneration. The `make l10n` command is primarily for formatting fixes and missing translator comments, not for intentional metadata updates.

Applied to files:

  • holidays/locale/hi/LC_MESSAGES/XNSE.po
  • holidays/locale/en_US/LC_MESSAGES/XNSE.po
  • holidays/locale/en_IN/LC_MESSAGES/XNSE.po
📚 Learning: 2025-04-05T08:12:19.986Z
Learnt from: PPsyrius
PR: vacanza/holidays#2402
File: holidays/locale/en_TT/LC_MESSAGES/TT.po:46-48
Timestamp: 2025-04-05T08:12:19.986Z
Learning: In the holidays library, localization (PO) files follow this convention: comments (#.) always use American English (en_US) spelling, while the msgid content follows the locale-specific spelling standards of the target language.

Applied to files:

  • holidays/locale/hi/LC_MESSAGES/XNSE.po
  • holidays/locale/en_US/LC_MESSAGES/XNSE.po
  • holidays/locale/en_IN/LC_MESSAGES/XNSE.po
📚 Learning: 2025-06-10T12:17:58.880Z
Learnt from: KJhellico
PR: vacanza/holidays#2608
File: holidays/locale/en_VC/LC_MESSAGES/VC.po:1-14
Timestamp: 2025-06-10T12:17:58.880Z
Learning: In the holidays project, .po files should use the full multi-line header format including the project description, authors, website, and license information, rather than a single-line comment format.

Applied to files:

  • holidays/locale/hi/LC_MESSAGES/XNSE.po
  • holidays/locale/en_US/LC_MESSAGES/XNSE.po
📚 Learning: 2025-06-29T09:37:35.283Z
Learnt from: KJhellico
PR: vacanza/holidays#2687
File: holidays/locale/en_US/LC_MESSAGES/CF.po:13-28
Timestamp: 2025-06-29T09:37:35.283Z
Learning: In the holidays project, .po files follow a standard formatting convention where there is always a blank line after the metadata header section (after the "X-Source-Language" line). This blank line separates the header from the actual translation content and should not be removed.

Applied to files:

  • holidays/locale/hi/LC_MESSAGES/XNSE.po
  • holidays/locale/en_US/LC_MESSAGES/XNSE.po
📚 Learning: 2025-06-10T05:08:07.939Z
Learnt from: PPsyrius
PR: vacanza/holidays#2608
File: holidays/locale/en_US/LC_MESSAGES/VC.po:76-76
Timestamp: 2025-06-10T05:08:07.939Z
Learning: For the holidays project, localization file formatting issues (like missing terminal periods in .po files) should be automatically fixed by running `make l10n` command (which is included in `make check`). Authors should be directed to use this automated tooling instead of manual formatting fixes.

Applied to files:

  • holidays/locale/hi/LC_MESSAGES/XNSE.po
  • holidays/locale/en_US/LC_MESSAGES/XNSE.po
📚 Learning: 2025-05-10T04:34:02.406Z
Learnt from: PPsyrius
PR: vacanza/holidays#2537
File: holidays/locale/sv_FI/LC_MESSAGES/AX.po:17-27
Timestamp: 2025-05-10T04:34:02.406Z
Learning: The `Plural-Forms` header isn't used in .po file generation for the holidays project and doesn't need to be manually added to localization files.

Applied to files:

  • holidays/locale/hi/LC_MESSAGES/XNSE.po
📚 Learning: 2025-03-30T13:33:31.598Z
Learnt from: PPsyrius
PR: vacanza/holidays#2388
File: holidays/locale/fr/LC_MESSAGES/CI.po:28-101
Timestamp: 2025-03-30T13:33:31.598Z
Learning: In the holidays library, for localization files of the default language (like French for Ivory Coast in fr/LC_MESSAGES/CI.po), the best practice is to leave the message strings (msgstr) empty to avoid possible typos, since the message IDs (msgid) are already in the target language.

Applied to files:

  • holidays/locale/hi/LC_MESSAGES/XNSE.po
  • holidays/locale/en_US/LC_MESSAGES/XNSE.po
📚 Learning: 2025-04-05T06:49:06.217Z
Learnt from: PPsyrius
PR: vacanza/holidays#2386
File: tests/countries/test_nepal.py:499-536
Timestamp: 2025-04-05T06:49:06.217Z
Learning: In the holidays project, test files follow a dual testing approach: individual methods test specific holidays across multiple years, while comprehensive year-specific tests (e.g., `test_2025`) verify all holidays for a specific year in a single assertion. Both approaches serve different testing purposes and complement each other.

Applied to files:

  • tests/financial/test_india_stock_exchange.py
📚 Learning: 2025-04-05T04:47:27.213Z
Learnt from: PPsyrius
PR: vacanza/holidays#2416
File: tests/countries/test_turkmenistan.py:52-64
Timestamp: 2025-04-05T04:47:27.213Z
Learning: For holiday tests in the vacanza/holidays project, structure tests by individual holidays rather than by years. Each test method should focus on a specific holiday and test it across multiple years (from start_year through 2050) using helper methods like `assertHolidayName`. For fixed holidays, use generators like `(f"{year}-01-01" for year in range(1991, 2051))`. For movable holidays, specify individual dates for specific years followed by a range check.

Applied to files:

  • tests/financial/test_india_stock_exchange.py
📚 Learning: 2025-05-06T21:07:11.577Z
Learnt from: KJhellico
PR: vacanza/holidays#2530
File: tests/countries/test_andorra.py:23-28
Timestamp: 2025-05-06T21:07:11.577Z
Learning: In the holidays project, test methods for country holidays follow a standard form where year ranges are explicitly recreated in each test method rather than being stored as class variables, to maintain consistency across all country tests.

Applied to files:

  • tests/financial/test_india_stock_exchange.py
📚 Learning: 2025-07-09T21:16:35.145Z
Learnt from: KJhellico
PR: vacanza/holidays#2623
File: tests/countries/test_christmas_island.py:136-146
Timestamp: 2025-07-09T21:16:35.145Z
Learning: In Christmas Island's holiday implementation, the test_christmas_day method cannot use assertNoNonObservedHoliday because in some years observed Christmas Day overlaps with Boxing Day when both holidays are moved due to weekend conflicts, causing the standard non-observed holiday check to fail inappropriately.

Applied to files:

  • tests/financial/test_india_stock_exchange.py
📚 Learning: 2025-07-24T15:21:31.632Z
Learnt from: PPsyrius
PR: vacanza/holidays#2750
File: tests/countries/test_germany.py:46-46
Timestamp: 2025-07-24T15:21:31.632Z
Learning: In the holidays project test files, the standard method name for testing the absence of holidays is `test_no_holidays`, not more descriptive names like `test_no_holidays_before_1990`. This is a consistent naming convention across country test files like France and Germany.

Applied to files:

  • tests/financial/test_india_stock_exchange.py
📚 Learning: 2025-07-02T18:21:59.302Z
Learnt from: KJhellico
PR: vacanza/holidays#2608
File: tests/countries/test_saint_vincent_and_the_grenadines.py:162-178
Timestamp: 2025-07-02T18:21:59.302Z
Learning: In the Saint Vincent and the Grenadines holiday tests, for holidays without observed rules that only require a single assertHolidayName call, pass the holiday name directly as a string literal rather than storing it in a variable first for cleaner, more concise code.

Applied to files:

  • tests/financial/test_india_stock_exchange.py
📚 Learning: 2025-04-23T14:55:35.504Z
Learnt from: PPsyrius
PR: vacanza/holidays#2489
File: holidays/countries/sao_tome_and_principe.py:22-26
Timestamp: 2025-04-23T14:55:35.504Z
Learning: References in holidays classes should only be included if they're used for test case cross-checks or provide historical context about when holidays were added/removed, not just for the sake of having more references.

Applied to files:

  • tests/financial/test_india_stock_exchange.py
📚 Learning: 2025-04-02T18:38:35.164Z
Learnt from: KJhellico
PR: vacanza/holidays#2398
File: tests/countries/test_guinea.py:237-239
Timestamp: 2025-04-02T18:38:35.164Z
Learning: In the vacanza/holidays project, the method assertLocalizedHolidays in country test files should be called with positional parameters rather than named parameters to maintain consistency with the rest of the codebase.

Applied to files:

  • tests/financial/test_india_stock_exchange.py
📚 Learning: 2025-08-21T04:56:03.711Z
Learnt from: PPsyrius
PR: vacanza/holidays#2843
File: holidays/countries/burundi.py:63-101
Timestamp: 2025-08-21T04:56:03.711Z
Learning: In the holidays library, countries with localization support consistently use tr() wrappers around holiday names when calling _add_* methods (e.g., self._add_new_years_day(tr("Holiday Name"))). This is the established pattern across United States, Thailand, and other l10n-enabled countries, contrary to any suggestion that translation is handled internally by _add_* methods.

Applied to files:

  • tests/financial/test_india_stock_exchange.py
  • holidays/locale/en_US/LC_MESSAGES/XNSE.po
  • holidays/locale/en_IN/LC_MESSAGES/XNSE.po
📚 Learning: 2025-04-05T04:29:38.042Z
Learnt from: PPsyrius
PR: vacanza/holidays#2416
File: tests/countries/test_turkmenistan.py:85-86
Timestamp: 2025-04-05T04:29:38.042Z
Learning: For testing holiday implementations in the vacanza/holidays repository, recommend using `from tests.common import CommonCountryTests` as the base class instead of directly using `unittest.TestCase` to maintain consistency with project conventions and leverage common test utilities.

Applied to files:

  • tests/financial/test_india_stock_exchange.py
📚 Learning: 2025-04-05T04:50:40.752Z
Learnt from: PPsyrius
PR: vacanza/holidays#2416
File: tests/countries/test_turkmenistan.py:31-49
Timestamp: 2025-04-05T04:50:40.752Z
Learning: For Turkmenistan holiday tests, use this class structure: `class TestTurkmenistan(CommonCountryTests, TestCase)` with imports `from unittest import TestCase`, `from holidays.countries import Turkmenistan, TM, TKM`, and `from tests.common import CommonCountryTests`. Ensure to call `super().setUp()` in the setUp method.

Applied to files:

  • tests/financial/test_india_stock_exchange.py
📚 Learning: 2025-08-12T17:16:54.497Z
Learnt from: PPsyrius
PR: vacanza/holidays#2794
File: tests/calendars/test_julian.py:35-36
Timestamp: 2025-08-12T17:16:54.497Z
Learning: In the vacanza/holidays project calendar tests (Thai, Ethiopian, Julian, etc.), the established testing pattern for validation methods is to use simple for loops like `for year in known_data_dict:` followed by `self.assertEqual(expected, actual)` without using unittest's subTest feature. This pattern is consistently maintained across all calendar test files.

Applied to files:

  • tests/financial/test_india_stock_exchange.py
📚 Learning: 2025-03-05T17:51:00.633Z
Learnt from: KJhellico
PR: vacanza/holidays#2259
File: holidays/locale/en_IN/LC_MESSAGES/IN.po:30-299
Timestamp: 2025-03-05T17:51:00.633Z
Learning: In the Holidays project, .po files for a country's default locale use empty msgstr fields as a standard convention.

Applied to files:

  • holidays/locale/en_US/LC_MESSAGES/XNSE.po
  • holidays/locale/en_IN/LC_MESSAGES/XNSE.po
📚 Learning: 2025-05-10T04:02:13.815Z
Learnt from: PPsyrius
PR: vacanza/holidays#2537
File: holidays/countries/finland.py:249-253
Timestamp: 2025-05-10T04:02:13.815Z
Learning: Holiday name comments directly above tr() function calls in the holidays package should only contain the holiday name itself (e.g., "# Independence Day.") without any additional context, dates, or historical information.

Applied to files:

  • holidays/locale/en_US/LC_MESSAGES/XNSE.po
  • holidays/locale/en_IN/LC_MESSAGES/XNSE.po
📚 Learning: 2025-06-19T02:34:18.382Z
Learnt from: PPsyrius
PR: vacanza/holidays#2643
File: holidays/countries/mauritius.py:144-169
Timestamp: 2025-06-19T02:34:18.382Z
Learning: Custom holiday classes that extend _CustomHinduHolidays, _CustomIslamicHolidays, _CustomBuddhistHolidays, etc. in the holidays library do not use docstrings. They follow a pattern of using only inline comments above date dictionaries, as seen in Malaysia, Singapore, UAE, and other country implementations.

Applied to files:

  • holidays/locale/en_US/LC_MESSAGES/XNSE.po
  • holidays/locale/en_IN/LC_MESSAGES/XNSE.po
🧬 Code graph analysis (2)
holidays/financial/national_stock_exchange_of_india.py (2)
holidays/observed_holiday_base.py (1)
  • ObservedHolidayBase (102-246)
holidays/holiday_base.py (1)
  • _add_holiday (797-809)
tests/financial/test_india_stock_exchange.py (2)
tests/common.py (7)
  • TestCase (28-338)
  • CommonFinancialTests (377-382)
  • assertAliases (121-130)
  • assertNoHolidays (292-294)
  • assertHolidayName (195-199)
  • assertHolidays (228-230)
  • assertLocalizedHolidays (327-338)
holidays/financial/national_stock_exchange_of_india.py (3)
  • NSE (122-125)
  • XNSE (128-131)
  • NationalStockExchangeOfIndia (32-119)
🔇 Additional comments (13)
holidays/registry.py (1)

272-273: Registry entry looks correct.

MIC and alias are appropriate; entity name matches expected module/class naming.

snapshots/financial/XNSE.json (1)

22-22: Align Eid naming with the chosen default locale.

2024/2025 use “Eid al-Fitr” while en_IN files use “Id-ul-Fitr (Ramadan Eid)”. Decide the default-language form (likely en_IN if that’s the default) and keep others in locales. Update generator, then re-snapshot.

Also applies to: 34-34

holidays/locale/en_US/LC_MESSAGES/XNSE.po (2)

15-27: Header metadata is correctly configured.

The PO file header has been properly updated with the correct Language setting and the fuzzy flag has been removed, addressing the previous review feedback.


29-98: Holiday translations are well-structured and appropriate.

The translation mappings follow proper PO file conventions with clear msgid/msgstr pairs. The en_US localizations provide appropriate American English equivalents where needed (e.g., "Gurunanak Jayanti" → "Guru Nanak's Birthday", "Mahashivratri" → "Maha Shivaratri").

holidays/financial/national_stock_exchange_of_india.py (4)

32-50: Class configuration follows established patterns.

The market identifier, language settings, and observed label configuration align with the project's financial market implementation standards.


64-120: Year-specific holiday implementation is sound.

The year_map approach with explicit date mappings aligns with the PR objective of using official NSE circulars rather than calculated dates. The tr() wrappers around holiday names properly support the localization functionality.


122-131: Alias classes are properly implemented.

The NSE and XNSE alias classes follow the standard pattern used throughout the holidays library for providing alternative access names.


95-95: Verify muhurat trading session handling.

The code in holidays/financial/national_stock_exchange_of_india.py currently treats Diwali Laxmi Pujan as a full holiday on both dates below, but NSE only holds a short “muhurat” trading session rather than a full market holiday. Please confirm against the official NSE holiday/short-session calendar whether these should remain in the holiday list or be modeled as special short trading days instead:

  • Line 95: (tr("Diwali Laxmi Pujan"), NOV, 1) # muhurat trading was conducted
  • Line 110: (tr("Diwali Laxmi Pujan"), OCT, 21) # muhurat trading was conducted
tests/financial/test_india_stock_exchange.py (5)

23-26: Test class setup follows project conventions.

The test class properly inherits from CommonFinancialTests and TestCase, and the setUpClass configuration is appropriate for the implementation scope.


28-32: Market aliases and boundary testing are correct.

The alias verification and no-holidays test for the pre-start year (1993) properly validate the implementation boundaries.


34-100: Individual holiday tests are comprehensive.

The test methods follow the project's established pattern of testing specific holidays across multiple years, providing good coverage for the implemented date ranges.


102-159: Year-specific comprehensive tests validate complete coverage.

These tests verify all holidays for each implemented year, ensuring no holidays are missed or incorrectly dated. The approach aligns with the project's dual testing strategy.


161-221: Localization tests properly verify translation functionality.

The l10n tests validate that holiday names are correctly translated for default, en_US, and hi locales, confirming the localization implementation works as expected.

@saheelsapovadia
Copy link
Contributor Author

saheelsapovadia commented Aug 21, 2025

@arkid15r , test_package.py::test_metadata() is failing due to version increment to 0.80
AssertionError: '0.79' != '0.80'

after i took pull from latest dev branch. Any idea on this?

reference - 8a35942

@PPsyrius PPsyrius changed the title Add india national stock exchange NSE holidays Add National Stock Exchange of India (NSE) holidays Aug 21, 2025
@KJhellico
Copy link
Collaborator

Any idea on this?

Run make package.

Copy link
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: 17

♻️ Duplicate comments (4)
holidays/locale/hi/LC_MESSAGES/XNSE.po (1)

54-56: Unify “Babasaheb” form in Hindi.

Use the common “बाबासाहेब” form (no space). Matches broader IN usage across the repo.

-msgstr "डॉ. बाबा साहेब अम्बेडकर जयंती"
+msgstr "डॉ. बाबासाहेब अम्बेडकर जयंती"
holidays/locale/en_IN/LC_MESSAGES/XNSE.po (1)

73-75: Align Eid naming to en_IN canonical “Id-ul-Fitr”.

Drop the parenthetical; keep consistent casing.

-msgid "Id-Ul-Fitr (Ramadan Eid)"
+msgid "Id-ul-Fitr"

Note: Update the source string in the calendar class first, then regenerate locales (make l10n).

holidays/financial/national_stock_exchange_of_india.py (1)

78-179: Data model choice is workable; consider future-proofing.

Class-level dictionaries for 2023–2025 are fine for initial scope. If you extend beyond 2025, consider:

  • Using convenience helpers for stable fixed dates (e.g., _add_holiday_jan_26) and letting weekends implicitly drop.
  • Or keeping the per-year dicts but naming them consistently and driving them off archived circulars only.

No action required now; just a heads-up for scalability.

tests/financial/test_india_stock_exchange.py (1)

26-26: Tighten fixture years to actual coverage (2023–2025).

Limit the class fixture to supported years to avoid exercising unsupported 2022.

-        super().setUpClass(NationalStockExchangeOfIndia, years=range(2022, 2026))
+        super().setUpClass(NationalStockExchangeOfIndia, years=range(2023, 2026))
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between d507420 and 13aba7d.

📒 Files selected for processing (6)
  • README.md (1 hunks)
  • holidays/financial/national_stock_exchange_of_india.py (1 hunks)
  • holidays/locale/en_IN/LC_MESSAGES/XNSE.po (1 hunks)
  • holidays/locale/en_US/LC_MESSAGES/XNSE.po (1 hunks)
  • holidays/locale/hi/LC_MESSAGES/XNSE.po (1 hunks)
  • tests/financial/test_india_stock_exchange.py (1 hunks)
🧰 Additional context used
🧠 Learnings (50)
📚 Learning: 2025-08-21T07:46:35.962Z
Learnt from: PPsyrius
PR: vacanza/holidays#2834
File: README.md:1831-1831
Timestamp: 2025-08-21T07:46:35.962Z
Learning: In the Available Financial Markets table in README.md, market entity names do not include acronyms in parentheses, unlike some other tables in the codebase. The pattern is to use the full entity name only.

Applied to files:

  • README.md
📚 Learning: 2025-04-05T06:49:06.217Z
Learnt from: PPsyrius
PR: vacanza/holidays#2386
File: tests/countries/test_nepal.py:499-536
Timestamp: 2025-04-05T06:49:06.217Z
Learning: In the holidays project, test files follow a dual testing approach: individual methods test specific holidays across multiple years, while comprehensive year-specific tests (e.g., `test_2025`) verify all holidays for a specific year in a single assertion. Both approaches serve different testing purposes and complement each other.

Applied to files:

  • tests/financial/test_india_stock_exchange.py
📚 Learning: 2025-04-05T04:47:27.213Z
Learnt from: PPsyrius
PR: vacanza/holidays#2416
File: tests/countries/test_turkmenistan.py:52-64
Timestamp: 2025-04-05T04:47:27.213Z
Learning: For holiday tests in the vacanza/holidays project, structure tests by individual holidays rather than by years. Each test method should focus on a specific holiday and test it across multiple years (from start_year through 2050) using helper methods like `assertHolidayName`. For fixed holidays, use generators like `(f"{year}-01-01" for year in range(1991, 2051))`. For movable holidays, specify individual dates for specific years followed by a range check.

Applied to files:

  • tests/financial/test_india_stock_exchange.py
📚 Learning: 2025-05-06T21:07:11.577Z
Learnt from: KJhellico
PR: vacanza/holidays#2530
File: tests/countries/test_andorra.py:23-28
Timestamp: 2025-05-06T21:07:11.577Z
Learning: In the holidays project, test methods for country holidays follow a standard form where year ranges are explicitly recreated in each test method rather than being stored as class variables, to maintain consistency across all country tests.

Applied to files:

  • tests/financial/test_india_stock_exchange.py
📚 Learning: 2025-07-09T21:16:35.145Z
Learnt from: KJhellico
PR: vacanza/holidays#2623
File: tests/countries/test_christmas_island.py:136-146
Timestamp: 2025-07-09T21:16:35.145Z
Learning: In Christmas Island's holiday implementation, the test_christmas_day method cannot use assertNoNonObservedHoliday because in some years observed Christmas Day overlaps with Boxing Day when both holidays are moved due to weekend conflicts, causing the standard non-observed holiday check to fail inappropriately.

Applied to files:

  • tests/financial/test_india_stock_exchange.py
📚 Learning: 2025-07-24T15:21:31.632Z
Learnt from: PPsyrius
PR: vacanza/holidays#2750
File: tests/countries/test_germany.py:46-46
Timestamp: 2025-07-24T15:21:31.632Z
Learning: In the holidays project test files, the standard method name for testing the absence of holidays is `test_no_holidays`, not more descriptive names like `test_no_holidays_before_1990`. This is a consistent naming convention across country test files like France and Germany.

Applied to files:

  • tests/financial/test_india_stock_exchange.py
📚 Learning: 2025-07-02T18:21:59.302Z
Learnt from: KJhellico
PR: vacanza/holidays#2608
File: tests/countries/test_saint_vincent_and_the_grenadines.py:162-178
Timestamp: 2025-07-02T18:21:59.302Z
Learning: In the Saint Vincent and the Grenadines holiday tests, for holidays without observed rules that only require a single assertHolidayName call, pass the holiday name directly as a string literal rather than storing it in a variable first for cleaner, more concise code.

Applied to files:

  • tests/financial/test_india_stock_exchange.py
📚 Learning: 2025-04-23T14:55:35.504Z
Learnt from: PPsyrius
PR: vacanza/holidays#2489
File: holidays/countries/sao_tome_and_principe.py:22-26
Timestamp: 2025-04-23T14:55:35.504Z
Learning: References in holidays classes should only be included if they're used for test case cross-checks or provide historical context about when holidays were added/removed, not just for the sake of having more references.

Applied to files:

  • tests/financial/test_india_stock_exchange.py
  • holidays/financial/national_stock_exchange_of_india.py
📚 Learning: 2025-04-02T18:38:35.164Z
Learnt from: KJhellico
PR: vacanza/holidays#2398
File: tests/countries/test_guinea.py:237-239
Timestamp: 2025-04-02T18:38:35.164Z
Learning: In the vacanza/holidays project, the method assertLocalizedHolidays in country test files should be called with positional parameters rather than named parameters to maintain consistency with the rest of the codebase.

Applied to files:

  • tests/financial/test_india_stock_exchange.py
📚 Learning: 2025-08-21T04:56:03.711Z
Learnt from: PPsyrius
PR: vacanza/holidays#2843
File: holidays/countries/burundi.py:63-101
Timestamp: 2025-08-21T04:56:03.711Z
Learning: In the holidays library, countries with localization support consistently use tr() wrappers around holiday names when calling _add_* methods (e.g., self._add_new_years_day(tr("Holiday Name"))). This is the established pattern across United States, Thailand, and other l10n-enabled countries, contrary to any suggestion that translation is handled internally by _add_* methods.

Applied to files:

  • tests/financial/test_india_stock_exchange.py
📚 Learning: 2025-04-05T04:29:38.042Z
Learnt from: PPsyrius
PR: vacanza/holidays#2416
File: tests/countries/test_turkmenistan.py:85-86
Timestamp: 2025-04-05T04:29:38.042Z
Learning: For testing holiday implementations in the vacanza/holidays repository, recommend using `from tests.common import CommonCountryTests` as the base class instead of directly using `unittest.TestCase` to maintain consistency with project conventions and leverage common test utilities.

Applied to files:

  • tests/financial/test_india_stock_exchange.py
📚 Learning: 2025-04-05T04:50:40.752Z
Learnt from: PPsyrius
PR: vacanza/holidays#2416
File: tests/countries/test_turkmenistan.py:31-49
Timestamp: 2025-04-05T04:50:40.752Z
Learning: For Turkmenistan holiday tests, use this class structure: `class TestTurkmenistan(CommonCountryTests, TestCase)` with imports `from unittest import TestCase`, `from holidays.countries import Turkmenistan, TM, TKM`, and `from tests.common import CommonCountryTests`. Ensure to call `super().setUp()` in the setUp method.

Applied to files:

  • tests/financial/test_india_stock_exchange.py
📚 Learning: 2025-08-12T17:16:54.497Z
Learnt from: PPsyrius
PR: vacanza/holidays#2794
File: tests/calendars/test_julian.py:35-36
Timestamp: 2025-08-12T17:16:54.497Z
Learning: In the vacanza/holidays project calendar tests (Thai, Ethiopian, Julian, etc.), the established testing pattern for validation methods is to use simple for loops like `for year in known_data_dict:` followed by `self.assertEqual(expected, actual)` without using unittest's subTest feature. This pattern is consistently maintained across all calendar test files.

Applied to files:

  • tests/financial/test_india_stock_exchange.py
📚 Learning: 2025-03-30T18:25:07.087Z
Learnt from: KJhellico
PR: vacanza/holidays#2388
File: holidays/locale/en_CI/LC_MESSAGES/CI.po:88-88
Timestamp: 2025-03-30T18:25:07.087Z
Learning: In the holidays library, localization files have a specific structure: message comments are in standard English (en_US) describing the holiday, while actual translations (msgstr) should use the locale-specific terminology (e.g., en_CI for Ivory Coast English). For example, "Night of Power" in standard English is translated as "Lailatou-Kadr" in Ivory Coast English.

Applied to files:

  • holidays/locale/en_US/LC_MESSAGES/XNSE.po
  • holidays/locale/en_IN/LC_MESSAGES/XNSE.po
  • holidays/locale/hi/LC_MESSAGES/XNSE.po
📚 Learning: 2025-03-08T11:28:48.652Z
Learnt from: KJhellico
PR: vacanza/holidays#2259
File: holidays/locale/en_IN/LC_MESSAGES/IN.po:285-299
Timestamp: 2025-03-08T11:28:48.652Z
Learning: In the holidays project, message IDs (msgids) in locale files use region-specific naming conventions (e.g., "Muharram", "Id-ul-Fitr" in en_IN locale for India), while translator comments use internationally recognized names from the project's default locale (en_US) such as "Ashura", "Eid al-Fitr". This difference is intentional for proper localization.

Applied to files:

  • holidays/locale/en_US/LC_MESSAGES/XNSE.po
  • holidays/locale/en_IN/LC_MESSAGES/XNSE.po
  • holidays/locale/hi/LC_MESSAGES/XNSE.po
📚 Learning: 2025-06-26T15:34:35.476Z
Learnt from: KJhellico
PR: vacanza/holidays#2676
File: holidays/locale/en_US/LC_MESSAGES/TN.po:17-28
Timestamp: 2025-06-26T15:34:35.476Z
Learning: In the holidays project, .po file header metadata updates (version numbers, revision dates, translator information) are legitimate changes when part of localization work and don't require `make l10n` regeneration. The `make l10n` command is primarily for formatting fixes and missing translator comments, not for intentional metadata updates.

Applied to files:

  • holidays/locale/en_US/LC_MESSAGES/XNSE.po
  • holidays/locale/en_IN/LC_MESSAGES/XNSE.po
  • holidays/locale/hi/LC_MESSAGES/XNSE.po
📚 Learning: 2025-06-25T20:55:00.642Z
Learnt from: KJhellico
PR: vacanza/holidays#2651
File: holidays/locale/nl/LC_MESSAGES/BQ.po:29-95
Timestamp: 2025-06-25T20:55:00.642Z
Learning: In the holidays library, Dutch locale files (.po) with `X-Source-Language: nl` should have empty msgstr entries when the target language is also Dutch. The library uses fallback=True with gettext, which returns the original msgid when msgstr is empty. This is the correct pattern for native language files and does not cause blank holiday names.

Applied to files:

  • holidays/locale/en_US/LC_MESSAGES/XNSE.po
  • holidays/locale/en_IN/LC_MESSAGES/XNSE.po
  • holidays/locale/hi/LC_MESSAGES/XNSE.po
📚 Learning: 2025-06-28T10:39:19.185Z
Learnt from: KJhellico
PR: vacanza/holidays#2684
File: holidays/locale/it/LC_MESSAGES/SM.po:13-13
Timestamp: 2025-06-28T10:39:19.185Z
Learning: In the holidays project, .po file header comments use the format "# [Country] holidays." for default language files (without trailing hash) and "# [Country] holidays [locale] localization." for non-default language files (also without trailing hash).

Applied to files:

  • holidays/locale/en_US/LC_MESSAGES/XNSE.po
  • holidays/locale/en_IN/LC_MESSAGES/XNSE.po
  • holidays/locale/hi/LC_MESSAGES/XNSE.po
📚 Learning: 2025-05-06T15:25:44.333Z
Learnt from: KJhellico
PR: vacanza/holidays#2530
File: holidays/locale/ca/LC_MESSAGES/AD.po:31-40
Timestamp: 2025-05-06T15:25:44.333Z
Learning: In the Holidays project, msgid fields in localization files contain strings in the entity's default language (as defined by default_language attribute), not English source strings as in standard gettext implementations.

Applied to files:

  • holidays/locale/en_US/LC_MESSAGES/XNSE.po
  • holidays/locale/en_IN/LC_MESSAGES/XNSE.po
  • holidays/locale/hi/LC_MESSAGES/XNSE.po
📚 Learning: 2025-06-11T18:32:25.595Z
Learnt from: ankushhKapoor
PR: vacanza/holidays#2601
File: holidays/locale/en_MN/LC_MESSAGES/MN.po:13-14
Timestamp: 2025-06-11T18:32:25.595Z
Learning: For non-default locale `.po` files, the header comment format is:
`# <Country> holidays <locale> localization.` (no trailing hash).

Applied to files:

  • holidays/locale/en_US/LC_MESSAGES/XNSE.po
  • holidays/locale/en_IN/LC_MESSAGES/XNSE.po
  • holidays/locale/hi/LC_MESSAGES/XNSE.po
📚 Learning: 2025-06-10T12:17:58.880Z
Learnt from: KJhellico
PR: vacanza/holidays#2608
File: holidays/locale/en_VC/LC_MESSAGES/VC.po:1-14
Timestamp: 2025-06-10T12:17:58.880Z
Learning: In the holidays project, .po files should use the full multi-line header format including the project description, authors, website, and license information, rather than a single-line comment format.

Applied to files:

  • holidays/locale/en_US/LC_MESSAGES/XNSE.po
  • holidays/locale/en_IN/LC_MESSAGES/XNSE.po
  • holidays/locale/hi/LC_MESSAGES/XNSE.po
📚 Learning: 2025-06-29T09:37:35.283Z
Learnt from: KJhellico
PR: vacanza/holidays#2687
File: holidays/locale/en_US/LC_MESSAGES/CF.po:13-28
Timestamp: 2025-06-29T09:37:35.283Z
Learning: In the holidays project, .po files follow a standard formatting convention where there is always a blank line after the metadata header section (after the "X-Source-Language" line). This blank line separates the header from the actual translation content and should not be removed.

Applied to files:

  • holidays/locale/en_US/LC_MESSAGES/XNSE.po
  • holidays/locale/en_IN/LC_MESSAGES/XNSE.po
  • holidays/locale/hi/LC_MESSAGES/XNSE.po
📚 Learning: 2025-04-05T08:12:19.986Z
Learnt from: PPsyrius
PR: vacanza/holidays#2402
File: holidays/locale/en_TT/LC_MESSAGES/TT.po:46-48
Timestamp: 2025-04-05T08:12:19.986Z
Learning: In the holidays library, localization (PO) files follow this convention: comments (#.) always use American English (en_US) spelling, while the msgid content follows the locale-specific spelling standards of the target language.

Applied to files:

  • holidays/locale/en_US/LC_MESSAGES/XNSE.po
  • holidays/locale/en_IN/LC_MESSAGES/XNSE.po
  • holidays/locale/hi/LC_MESSAGES/XNSE.po
📚 Learning: 2025-06-10T05:08:07.939Z
Learnt from: PPsyrius
PR: vacanza/holidays#2608
File: holidays/locale/en_US/LC_MESSAGES/VC.po:76-76
Timestamp: 2025-06-10T05:08:07.939Z
Learning: For the holidays project, localization file formatting issues (like missing terminal periods in .po files) should be automatically fixed by running `make l10n` command (which is included in `make check`). Authors should be directed to use this automated tooling instead of manual formatting fixes.

Applied to files:

  • holidays/locale/en_US/LC_MESSAGES/XNSE.po
  • holidays/locale/en_IN/LC_MESSAGES/XNSE.po
  • holidays/locale/hi/LC_MESSAGES/XNSE.po
📚 Learning: 2025-04-17T17:08:48.082Z
Learnt from: PPsyrius
PR: vacanza/holidays#2438
File: holidays/locale/ar_IQ/LC_MESSAGES/IQ.po:35-81
Timestamp: 2025-04-17T17:08:48.082Z
Learning: In holiday PO files, when the file represents the default language of an entity (e.g., ar_IQ for Iraq), no translations in `msgstr` are required as the `msgid` values are already in the target language.

Applied to files:

  • holidays/locale/en_US/LC_MESSAGES/XNSE.po
  • holidays/locale/en_IN/LC_MESSAGES/XNSE.po
📚 Learning: 2025-03-05T17:51:00.633Z
Learnt from: KJhellico
PR: vacanza/holidays#2259
File: holidays/locale/en_IN/LC_MESSAGES/IN.po:30-299
Timestamp: 2025-03-05T17:51:00.633Z
Learning: In the Holidays project, .po files for a country's default locale use empty msgstr fields as a standard convention.

Applied to files:

  • holidays/locale/en_US/LC_MESSAGES/XNSE.po
  • holidays/locale/en_IN/LC_MESSAGES/XNSE.po
  • holidays/locale/hi/LC_MESSAGES/XNSE.po
📚 Learning: 2025-05-10T04:02:13.815Z
Learnt from: PPsyrius
PR: vacanza/holidays#2537
File: holidays/countries/finland.py:249-253
Timestamp: 2025-05-10T04:02:13.815Z
Learning: Holiday name comments directly above tr() function calls in the holidays package should only contain the holiday name itself (e.g., "# Independence Day.") without any additional context, dates, or historical information.

Applied to files:

  • holidays/locale/en_US/LC_MESSAGES/XNSE.po
  • holidays/locale/en_IN/LC_MESSAGES/XNSE.po
📚 Learning: 2025-03-31T11:50:50.488Z
Learnt from: Wasif-Shahzad
PR: vacanza/holidays#2385
File: holidays/countries/pakistan.py:59-60
Timestamp: 2025-03-31T11:50:50.488Z
Learning: In the holidays library, function names and comments follow en_US spelling conventions (e.g., "Labor Day"), while the default strings may use different locale conventions (e.g., "Labour Day" for en_PK) and are translated appropriately using the gettext function.

Applied to files:

  • holidays/locale/en_US/LC_MESSAGES/XNSE.po
📚 Learning: 2025-06-14T20:12:37.212Z
Learnt from: KJhellico
PR: vacanza/holidays#2614
File: holidays/countries/guyana.py:146-179
Timestamp: 2025-06-14T20:12:37.212Z
Learning: The `_CustomHinduHolidays` mechanism works through `_CustomCalendarType` metaclass which renames public attributes (like `DIWALI_INDIA_DATES`) with a postfix, allowing `_HinduLunisolar::_get_holiday` to find and use custom holiday dates. When `_add_diwali_india()` is called, it uses the custom dates if available rather than calculated dates.

Applied to files:

  • holidays/financial/national_stock_exchange_of_india.py
📚 Learning: 2025-08-21T04:51:55.283Z
Learnt from: PPsyrius
PR: vacanza/holidays#2843
File: holidays/countries/burundi.py:24-28
Timestamp: 2025-08-21T04:51:55.283Z
Learning: In the holidays library, timeanddate.com can be included as a reference specifically for historical Islamic holiday observance date verification, even when official government sources are available, as long as the official sources are listed first in the references.

Applied to files:

  • holidays/financial/national_stock_exchange_of_india.py
📚 Learning: 2025-03-19T16:54:58.657Z
Learnt from: PPsyrius
PR: vacanza/holidays#2354
File: holidays/countries/fiji.py:146-159
Timestamp: 2025-03-19T16:54:58.657Z
Learning: In the holidays library implementation, explicit holiday dates (like Diwali in Fiji) are only defined for historical years with official sources (2016-2025). Future dates beyond the explicitly defined range are automatically calculated by methods like `_add_diwali`, which provide approximations when official dates aren't yet available.

Applied to files:

  • holidays/financial/national_stock_exchange_of_india.py
📚 Learning: 2025-07-10T03:36:16.461Z
Learnt from: PPsyrius
PR: vacanza/holidays#2706
File: holidays/countries/cayman_islands.py:80-97
Timestamp: 2025-07-10T03:36:16.461Z
Learning: In the holidays library, date dictionaries that map years to specific dates (like queens_birthday_dates, spring_bank_dates, thanksgiving_day_dates, etc.) are typically defined within the _populate_public_holidays method rather than as module-level constants. This is the established library-wide pattern seen across multiple country implementations including United Kingdom, United States, Sri Lanka, and others.

Applied to files:

  • holidays/financial/national_stock_exchange_of_india.py
📚 Learning: 2025-06-29T10:36:06.138Z
Learnt from: KJhellico
PR: vacanza/holidays#2671
File: holidays/countries/libya.py:51-108
Timestamp: 2025-06-29T10:36:06.138Z
Learning: There is no project-wide convention in the holidays library to organize holidays by calendar type (Islamic holidays first, then Gregorian holidays). Countries organize holidays in various ways - often chronologically, by importance, or by logical grouping - and Islamic holidays are frequently placed at the end of the _populate_public_holidays method rather than at the beginning.

Applied to files:

  • holidays/financial/national_stock_exchange_of_india.py
📚 Learning: 2025-06-06T14:40:31.932Z
Learnt from: KJhellico
PR: vacanza/holidays#2593
File: holidays/countries/senegal.py:66-110
Timestamp: 2025-06-06T14:40:31.932Z
Learning: In the holidays library, within the _populate_public_holidays method, holidays should be arranged by calendar type (Islamic holidays first, then Gregorian holidays) without additional type grouping comments. The organization by calendar type is sufficient and follows the project's established conventions.

Applied to files:

  • holidays/financial/national_stock_exchange_of_india.py
📚 Learning: 2025-04-03T16:58:27.175Z
Learnt from: Wasif-Shahzad
PR: vacanza/holidays#2409
File: holidays/countries/qatar.py:27-46
Timestamp: 2025-04-03T16:58:27.175Z
Learning: In the holidays library, method names like `_add_holiday_2nd_tue_of_feb()` and `_add_holiday_1st_sun_of_mar()` use calendar constants like FEB, TUE, MAR, and SUN internally through parent class implementations even when these constants don't appear directly in the file.

Applied to files:

  • holidays/financial/national_stock_exchange_of_india.py
📚 Learning: 2025-06-19T02:34:18.382Z
Learnt from: PPsyrius
PR: vacanza/holidays#2643
File: holidays/countries/mauritius.py:144-169
Timestamp: 2025-06-19T02:34:18.382Z
Learning: Custom holiday classes that extend _CustomHinduHolidays, _CustomIslamicHolidays, _CustomBuddhistHolidays, etc. in the holidays library do not use docstrings. They follow a pattern of using only inline comments above date dictionaries, as seen in Malaysia, Singapore, UAE, and other country implementations.

Applied to files:

  • holidays/financial/national_stock_exchange_of_india.py
📚 Learning: 2025-08-19T21:00:47.849Z
Learnt from: KJhellico
PR: vacanza/holidays#2831
File: holidays/countries/south_sudan.py:84-88
Timestamp: 2025-08-19T21:00:47.849Z
Learning: In the holidays library, Islamic holidays use dedicated methods for additional days (like `_add_eid_al_fitr_day_two`, `_add_eid_al_adha_day_two`) rather than parameters. The methods don't accept a `days` parameter - each day has its own specific method.

Applied to files:

  • holidays/financial/national_stock_exchange_of_india.py
📚 Learning: 2025-05-01T19:19:42.346Z
Learnt from: KJhellico
PR: vacanza/holidays#2386
File: tests/countries/test_nepal.py:551-554
Timestamp: 2025-05-01T19:19:42.346Z
Learning: In the holidays library, when multiple holidays fall on the same date, their names are always sorted alphabetically (in __setitem__ of HolidayBase), so the order of addition does not affect the resulting string.

Applied to files:

  • holidays/financial/national_stock_exchange_of_india.py
📚 Learning: 2025-03-30T13:33:31.598Z
Learnt from: PPsyrius
PR: vacanza/holidays#2388
File: holidays/locale/fr/LC_MESSAGES/CI.po:28-101
Timestamp: 2025-03-30T13:33:31.598Z
Learning: In the holidays library, for localization files of the default language (like French for Ivory Coast in fr/LC_MESSAGES/CI.po), the best practice is to leave the message strings (msgstr) empty to avoid possible typos, since the message IDs (msgid) are already in the target language.

Applied to files:

  • holidays/locale/en_IN/LC_MESSAGES/XNSE.po
  • holidays/locale/hi/LC_MESSAGES/XNSE.po
📚 Learning: 2025-08-19T21:22:13.125Z
Learnt from: KJhellico
PR: vacanza/holidays#2831
File: holidays/countries/south_sudan.py:84-88
Timestamp: 2025-08-19T21:22:13.125Z
Learning: In the holidays library, message comments directly above holiday addition methods must match the holiday name exactly without any additions, modifications, or explanatory text. For example, if the holiday name is "Eid al-Fitr Holiday", the comment should be "# Eid al-Fitr Holiday." with no extra context.

Applied to files:

  • holidays/locale/en_IN/LC_MESSAGES/XNSE.po
📚 Learning: 2025-06-14T11:00:25.835Z
Learnt from: KJhellico
PR: vacanza/holidays#2629
File: holidays/locale/en_US/LC_MESSAGES/NA.po:17-28
Timestamp: 2025-06-14T11:00:25.835Z
Learning: In the holidays library localization files, the X-Source-Language field should contain the value that matches the country's default language setting (e.g., if a country class has default_language = "en_NA", then X-Source-Language should be "en_NA").

Applied to files:

  • holidays/locale/en_IN/LC_MESSAGES/XNSE.po
📚 Learning: 2025-06-18T17:23:16.739Z
Learnt from: PPsyrius
PR: vacanza/holidays#2642
File: holidays/locale/fr/LC_MESSAGES/MF.po:17-28
Timestamp: 2025-06-18T17:23:16.739Z
Learning: In the holidays library, for French holidays localization files, the default_language is 'fr' (French), so X-Source-Language should be set to 'fr', not 'en'. The source language for holidays matches the country's primary language.

Applied to files:

  • holidays/locale/en_IN/LC_MESSAGES/XNSE.po
📚 Learning: 2025-06-10T05:07:29.372Z
Learnt from: PPsyrius
PR: vacanza/holidays#2608
File: holidays/locale/en_VC/LC_MESSAGES/VC.po:61-66
Timestamp: 2025-06-10T05:07:29.372Z
Learning: For missing translator comments in .po localization files in the holidays repository, direct authors to run `make l10n` or `make check` commands instead of suggesting manual fixes, as these commands automatically handle translator comment generation.

Applied to files:

  • holidays/locale/en_IN/LC_MESSAGES/XNSE.po
  • holidays/locale/hi/LC_MESSAGES/XNSE.po
📚 Learning: 2025-04-03T05:59:57.480Z
Learnt from: PPsyrius
PR: vacanza/holidays#2407
File: snapshots/countries/TL_COMMON.json:7-7
Timestamp: 2025-04-03T05:59:57.480Z
Learning: In the holidays project, snapshot files (like snapshots/countries/TL_COMMON.json) are auto-generated when running `make snapshot` and should not be manually edited. Semicolons (;) in holiday entries are used as separators when multiple holidays occur on the same date.

Applied to files:

  • holidays/locale/en_IN/LC_MESSAGES/XNSE.po
  • holidays/locale/hi/LC_MESSAGES/XNSE.po
📚 Learning: 2025-04-01T14:14:01.519Z
Learnt from: PPsyrius
PR: vacanza/holidays#2398
File: holidays/groups/islamic.py:301-301
Timestamp: 2025-04-01T14:14:01.519Z
Learning: Running `make pre-commit` in the holidays project can automatically fix common code style issues like whitespace in blank lines.

Applied to files:

  • holidays/locale/en_IN/LC_MESSAGES/XNSE.po
📚 Learning: 2025-03-31T19:37:57.691Z
Learnt from: KJhellico
PR: vacanza/holidays#2394
File: holidays/locale/pt_PT/LC_MESSAGES/CV.po:31-88
Timestamp: 2025-03-31T19:37:57.691Z
Learning: In the holidays library, when a locale file matches the country's default language (e.g., pt_PT for Cape Verde), the msgstr fields should be left empty. Only non-default language files should have filled msgstr fields with translations.

Applied to files:

  • holidays/locale/en_IN/LC_MESSAGES/XNSE.po
📚 Learning: 2025-04-13T19:11:32.337Z
Learnt from: KJhellico
PR: vacanza/holidays#2465
File: holidays/locale/nl/LC_MESSAGES/SR.po:31-32
Timestamp: 2025-04-13T19:11:32.337Z
Learning: In the holidays library, when a language is set as the default language for a country (like Dutch/nl for Suriname), the `msgid` strings in the PO file are already in that language, and the corresponding `msgstr` fields are intentionally left empty. This is by design, as the system will fall back to using the `msgid` value when no translation is provided.

Applied to files:

  • holidays/locale/en_IN/LC_MESSAGES/XNSE.po
📚 Learning: 2025-06-25T10:09:29.029Z
Learnt from: PPsyrius
PR: vacanza/holidays#2676
File: holidays/locale/ar/LC_MESSAGES/EG.po:0-0
Timestamp: 2025-06-25T10:09:29.029Z
Learning: In the holidays library, msgstr fields can be left empty for source/default_language files when using Lingva, the localization tool used by the project.

Applied to files:

  • holidays/locale/en_IN/LC_MESSAGES/XNSE.po
📚 Learning: 2025-03-31T19:37:57.691Z
Learnt from: KJhellico
PR: vacanza/holidays#2394
File: holidays/locale/pt_PT/LC_MESSAGES/CV.po:31-88
Timestamp: 2025-03-31T19:37:57.691Z
Learning: In the holidays library localization pattern, when a locale file matches a country's default language (e.g., pt_PT for Cape Verde), the msgstr fields should be left empty. Only non-default language locale files should have translations in the msgstr fields.

Applied to files:

  • holidays/locale/en_IN/LC_MESSAGES/XNSE.po
📚 Learning: 2025-05-10T04:34:02.406Z
Learnt from: PPsyrius
PR: vacanza/holidays#2537
File: holidays/locale/sv_FI/LC_MESSAGES/AX.po:17-27
Timestamp: 2025-05-10T04:34:02.406Z
Learning: The `Plural-Forms` header isn't used in .po file generation for the holidays project and doesn't need to be manually added to localization files.

Applied to files:

  • holidays/locale/hi/LC_MESSAGES/XNSE.po
🔇 Additional comments (8)
holidays/locale/en_IN/LC_MESSAGES/XNSE.po (2)

13-14: Header comment format is correct.

Matches non-localized default-language style for entity files.


29-33: Default-language msgstr entries are correctly empty.

This adheres to project convention for default languages.

Also applies to: 34-108

holidays/locale/en_US/LC_MESSAGES/XNSE.po (1)

29-108: en_US catalog otherwise looks fine.

Strings mirror msgids where appropriate; no fuzzy flags; header format OK after X-Source-Language fix.

holidays/financial/national_stock_exchange_of_india.py (3)

249-258: Aliases are correct and minimal.

NSE and XNSE subclasses are in place and clean.


67-74: Good: default_language, supported_languages, observed_label, start_year.

These align with project conventions and the entity history.


181-242: No observed rollovers for NSE required

The NSE calendar inherits from ObservedHolidayBase but does not supply any observed_rule, so the default (empty) rule prevents any Saturday/Sunday holidays from rolling over to weekdays. We’ve verified:

  • NationalStockExchangeOfIndia doesn’t pass an observed_rule or observed_since to the base class.
  • ObservedHolidayBase uses an empty rule by default, so _get_holiday will never move a holiday off its fixed date.
  • This matches all listed circulars—NSE does not add special weekday closures.

No changes are needed here.

tests/financial/test_india_stock_exchange.py (2)

28-30: Aliases test looks good.

Registry aliases NSE/XNSE resolved correctly.


188-248: l10n sets read clean.

Default, en_US, and hi cases align with the holiday names elsewhere in this file.

Copy link
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: 4

♻️ Duplicate comments (11)
README.md (1)

1831-1835: Tighten the Info cell to match table style.

Use the concise human label “NSE market holidays” (other rows prefer short, readable names; entity cell already carries the full name).

-<td>National Stock Exchange of India market holidays</td>
+<td>NSE market holidays</td>
holidays/locale/hi/LC_MESSAGES/XNSE.po (3)

73-76: Align Eid naming with canonical key.

Once the generator uses “Id‑ul‑Fitr”, update this entry accordingly.

-#. Id Ul Fitr (Ramadan Eid)
-msgid "Id-Ul-Fitr (Ramadan Eid)"
-msgstr "ईद-उल-फितर (रमजान ईद)"
+#. Id-ul-Fitr
+msgid "Id-ul-Fitr"
+msgstr "ईद-उल-फितर"

31-32: Fix mistranslation of “observed”.

“अनुमानित” = estimated. Use “पालित”.

 msgid "%s (observed)"
-msgstr "%s (अनुमानित)"
+msgstr "%s (पालित)"

54-56: Unify Ambedkar naming in Hindi.

Standard IN form joins “बाबासाहेब”.

-msgid "Dr. Baba Saheb Ambedkar Jayanti"
-msgstr "डॉ. बाबा साहेब अम्बेडकर जयंती"
+msgid "Dr. Babasaheb Ambedkar Jayanti"
+msgstr "डॉ. बाबासाहेब अम्बेडकर जयंती"
holidays/locale/en_US/LC_MESSAGES/XNSE.po (1)

73-76: Localize Eid name to US English.

Keep msgid from source; translate to “Eid al‑Fitr”. If you adopt the new msgid “Id‑ul‑Fitr”, keep this msgstr.

 msgid "Id-Ul-Fitr (Ramadan Eid)"
-msgstr "Id-Ul-Fitr (Ramadan Eid)"
+msgstr "Eid al-Fitr"
holidays/financial/national_stock_exchange_of_india.py (3)

199-202: Unify Ambedkar label to common IN form.

Use “Dr. Babasaheb Ambedkar Jayanti” everywhere.

-        # Dr. Baba Saheb Ambedkar Jayanti
-        self._get_holiday(
-            tr("Dr. Baba Saheb Ambedkar Jayanti"), DR_BABA_SAHEB_AMBEDKAR_JAYANTI, self._year
-        )
+        # Dr. Babasaheb Ambedkar Jayanti
+        self._get_holiday(
+            tr("Dr. Babasaheb Ambedkar Jayanti"), DR_BABA_SAHEB_AMBEDKAR_JAYANTI, self._year
+        )

216-217: Canonicalize Eid label and casing.

Switch to en_IN style “Id‑ul‑Fitr”; drop the parenthetical.

-        # Id Ul Fitr (Ramadan Eid)
-        self._get_holiday(tr("Id-Ul-Fitr (Ramadan Eid)"), ID_UL_FITR, self._year)
+        # Id-ul-Fitr
+        self._get_holiday(tr("Id-ul-Fitr"), ID_UL_FITR, self._year)

57-65: Point primary reference to the archived Holidays page.

Replace “exchange-communication-circulars” with the Holidays landing page (archived).

-    References:
-        * <https://web.archive.org/web/20250821175252/https://www.nseindia.com/resources/exchange-communication-circulars>
+    References:
+        * <https://web.archive.org/web/20250712194409/https://www.nseindia.com/resources/exchange-communication-holidays>
tests/financial/test_india_stock_exchange.py (3)

26-26: Tighten fixture years to actual coverage (2023–2025).

Implementation only has concrete dates for 2023–2025. Limit the fixture to reduce surface and accidental drift.

-        super().setUpClass(NationalStockExchangeOfIndia, years=range(2022, 2026))
+        super().setUpClass(NationalStockExchangeOfIndia, years=range(2023, 2026))

31-33: Also assert no holidays for 2022 (pre-start guard).

Adds an immediate pre-coverage check alongside 1993.

     def test_no_holidays(self):
         self.assertNoHolidays(NationalStockExchangeOfIndia(years=1993))
+        self.assertNoHolidays(NationalStockExchangeOfIndia(years=2022))

160-178: Fix 2025 year set: add missing Republic Day and remove duplicate combined entry.

  • Missing (“2025-01-26”, “Republic Day”) causes assertHolidays to under-specify expected set.
  • Duplicate (“2025-10-02”, “Dussehra; Mahatma Gandhi Jayanti”) is redundant and risks masking drift.
     def test_2025(self):
         self.assertHolidays(
             NationalStockExchangeOfIndia(years=2025),
+            ("2025-01-26", "Republic Day"),
             ("2025-02-26", "Maha Shivaratri"),
             ("2025-03-14", "Holi"),
             ("2025-03-31", "Id-Ul-Fitr (Ramadan Eid)"),
             ("2025-04-10", "Mahavir Jayanti"),
             ("2025-04-14", "Dr. Baba Saheb Ambedkar Jayanti"),
             ("2025-04-18", "Good Friday"),
             ("2025-05-01", "Maharashtra Day"),
             ("2025-08-15", "Independence Day"),
             ("2025-08-27", "Ganesh Chaturthi"),
             ("2025-10-02", "Dussehra; Mahatma Gandhi Jayanti"),
-            ("2025-10-02", "Dussehra; Mahatma Gandhi Jayanti"),
             ("2025-10-21", "Diwali Laxmi Pujan"),
             ("2025-10-22", "Diwali Balipratipada"),
             ("2025-11-05", "Guru Nanak Jayanti"),
             ("2025-12-25", "Christmas Day"),
         )
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 13aba7d and e150447.

📒 Files selected for processing (6)
  • README.md (1 hunks)
  • holidays/financial/national_stock_exchange_of_india.py (1 hunks)
  • holidays/locale/en_US/LC_MESSAGES/XNSE.po (1 hunks)
  • holidays/locale/hi/LC_MESSAGES/XNSE.po (1 hunks)
  • snapshots/financial/XNSE.json (1 hunks)
  • tests/financial/test_india_stock_exchange.py (1 hunks)
🧰 Additional context used
🧠 Learnings (58)
📚 Learning: 2025-04-03T05:59:57.480Z
Learnt from: PPsyrius
PR: vacanza/holidays#2407
File: snapshots/countries/TL_COMMON.json:7-7
Timestamp: 2025-04-03T05:59:57.480Z
Learning: In the holidays project, snapshot files (like snapshots/countries/TL_COMMON.json) are auto-generated when running `make snapshot` and should not be manually edited. Semicolons (;) in holiday entries are used as separators when multiple holidays occur on the same date.

Applied to files:

  • snapshots/financial/XNSE.json
  • holidays/locale/hi/LC_MESSAGES/XNSE.po
📚 Learning: 2025-06-24T17:26:17.728Z
Learnt from: KJhellico
PR: vacanza/holidays#2654
File: snapshots/countries/CV_RS.json:471-478
Timestamp: 2025-06-24T17:26:17.728Z
Learning: Snapshot files in the holidays library (like those in snapshots/countries/) are generated automatically and should not be manually edited. Any issues with snapshot content should be addressed in the source code that generates them, not in the snapshot files themselves.

Applied to files:

  • snapshots/financial/XNSE.json
📚 Learning: 2025-03-19T16:54:58.657Z
Learnt from: PPsyrius
PR: vacanza/holidays#2354
File: holidays/countries/fiji.py:146-159
Timestamp: 2025-03-19T16:54:58.657Z
Learning: In the holidays library implementation, explicit holiday dates (like Diwali in Fiji) are only defined for historical years with official sources (2016-2025). Future dates beyond the explicitly defined range are automatically calculated by methods like `_add_diwali`, which provide approximations when official dates aren't yet available.

Applied to files:

  • snapshots/financial/XNSE.json
  • holidays/financial/national_stock_exchange_of_india.py
📚 Learning: 2025-08-21T07:46:35.962Z
Learnt from: PPsyrius
PR: vacanza/holidays#2834
File: README.md:1831-1831
Timestamp: 2025-08-21T07:46:35.962Z
Learning: In the Available Financial Markets table in README.md, market entity names do not include acronyms in parentheses, unlike some other tables in the codebase. The pattern is to use the full entity name only.

Applied to files:

  • README.md
📚 Learning: 2025-03-08T11:28:48.652Z
Learnt from: KJhellico
PR: vacanza/holidays#2259
File: holidays/locale/en_IN/LC_MESSAGES/IN.po:285-299
Timestamp: 2025-03-08T11:28:48.652Z
Learning: In the holidays project, message IDs (msgids) in locale files use region-specific naming conventions (e.g., "Muharram", "Id-ul-Fitr" in en_IN locale for India), while translator comments use internationally recognized names from the project's default locale (en_US) such as "Ashura", "Eid al-Fitr". This difference is intentional for proper localization.

Applied to files:

  • holidays/locale/hi/LC_MESSAGES/XNSE.po
  • holidays/locale/en_US/LC_MESSAGES/XNSE.po
  • holidays/financial/national_stock_exchange_of_india.py
📚 Learning: 2025-06-28T10:39:19.185Z
Learnt from: KJhellico
PR: vacanza/holidays#2684
File: holidays/locale/it/LC_MESSAGES/SM.po:13-13
Timestamp: 2025-06-28T10:39:19.185Z
Learning: In the holidays project, .po file header comments use the format "# [Country] holidays." for default language files (without trailing hash) and "# [Country] holidays [locale] localization." for non-default language files (also without trailing hash).

Applied to files:

  • holidays/locale/hi/LC_MESSAGES/XNSE.po
  • holidays/locale/en_US/LC_MESSAGES/XNSE.po
📚 Learning: 2025-03-30T18:25:07.087Z
Learnt from: KJhellico
PR: vacanza/holidays#2388
File: holidays/locale/en_CI/LC_MESSAGES/CI.po:88-88
Timestamp: 2025-03-30T18:25:07.087Z
Learning: In the holidays library, localization files have a specific structure: message comments are in standard English (en_US) describing the holiday, while actual translations (msgstr) should use the locale-specific terminology (e.g., en_CI for Ivory Coast English). For example, "Night of Power" in standard English is translated as "Lailatou-Kadr" in Ivory Coast English.

Applied to files:

  • holidays/locale/hi/LC_MESSAGES/XNSE.po
  • holidays/locale/en_US/LC_MESSAGES/XNSE.po
📚 Learning: 2025-06-11T18:32:25.595Z
Learnt from: ankushhKapoor
PR: vacanza/holidays#2601
File: holidays/locale/en_MN/LC_MESSAGES/MN.po:13-14
Timestamp: 2025-06-11T18:32:25.595Z
Learning: For non-default locale `.po` files, the header comment format is:
`# <Country> holidays <locale> localization.` (no trailing hash).

Applied to files:

  • holidays/locale/hi/LC_MESSAGES/XNSE.po
  • holidays/locale/en_US/LC_MESSAGES/XNSE.po
📚 Learning: 2025-05-06T15:25:44.333Z
Learnt from: KJhellico
PR: vacanza/holidays#2530
File: holidays/locale/ca/LC_MESSAGES/AD.po:31-40
Timestamp: 2025-05-06T15:25:44.333Z
Learning: In the Holidays project, msgid fields in localization files contain strings in the entity's default language (as defined by default_language attribute), not English source strings as in standard gettext implementations.

Applied to files:

  • holidays/locale/hi/LC_MESSAGES/XNSE.po
  • holidays/locale/en_US/LC_MESSAGES/XNSE.po
📚 Learning: 2025-06-25T20:55:00.642Z
Learnt from: KJhellico
PR: vacanza/holidays#2651
File: holidays/locale/nl/LC_MESSAGES/BQ.po:29-95
Timestamp: 2025-06-25T20:55:00.642Z
Learning: In the holidays library, Dutch locale files (.po) with `X-Source-Language: nl` should have empty msgstr entries when the target language is also Dutch. The library uses fallback=True with gettext, which returns the original msgid when msgstr is empty. This is the correct pattern for native language files and does not cause blank holiday names.

Applied to files:

  • holidays/locale/hi/LC_MESSAGES/XNSE.po
  • holidays/locale/en_US/LC_MESSAGES/XNSE.po
📚 Learning: 2025-06-26T15:34:35.476Z
Learnt from: KJhellico
PR: vacanza/holidays#2676
File: holidays/locale/en_US/LC_MESSAGES/TN.po:17-28
Timestamp: 2025-06-26T15:34:35.476Z
Learning: In the holidays project, .po file header metadata updates (version numbers, revision dates, translator information) are legitimate changes when part of localization work and don't require `make l10n` regeneration. The `make l10n` command is primarily for formatting fixes and missing translator comments, not for intentional metadata updates.

Applied to files:

  • holidays/locale/hi/LC_MESSAGES/XNSE.po
  • holidays/locale/en_US/LC_MESSAGES/XNSE.po
📚 Learning: 2025-03-05T17:51:00.633Z
Learnt from: KJhellico
PR: vacanza/holidays#2259
File: holidays/locale/en_IN/LC_MESSAGES/IN.po:30-299
Timestamp: 2025-03-05T17:51:00.633Z
Learning: In the Holidays project, .po files for a country's default locale use empty msgstr fields as a standard convention.

Applied to files:

  • holidays/locale/hi/LC_MESSAGES/XNSE.po
  • holidays/locale/en_US/LC_MESSAGES/XNSE.po
📚 Learning: 2025-06-29T09:37:35.283Z
Learnt from: KJhellico
PR: vacanza/holidays#2687
File: holidays/locale/en_US/LC_MESSAGES/CF.po:13-28
Timestamp: 2025-06-29T09:37:35.283Z
Learning: In the holidays project, .po files follow a standard formatting convention where there is always a blank line after the metadata header section (after the "X-Source-Language" line). This blank line separates the header from the actual translation content and should not be removed.

Applied to files:

  • holidays/locale/hi/LC_MESSAGES/XNSE.po
  • holidays/locale/en_US/LC_MESSAGES/XNSE.po
📚 Learning: 2025-04-05T08:12:19.986Z
Learnt from: PPsyrius
PR: vacanza/holidays#2402
File: holidays/locale/en_TT/LC_MESSAGES/TT.po:46-48
Timestamp: 2025-04-05T08:12:19.986Z
Learning: In the holidays library, localization (PO) files follow this convention: comments (#.) always use American English (en_US) spelling, while the msgid content follows the locale-specific spelling standards of the target language.

Applied to files:

  • holidays/locale/hi/LC_MESSAGES/XNSE.po
  • holidays/locale/en_US/LC_MESSAGES/XNSE.po
📚 Learning: 2025-06-10T05:08:07.939Z
Learnt from: PPsyrius
PR: vacanza/holidays#2608
File: holidays/locale/en_US/LC_MESSAGES/VC.po:76-76
Timestamp: 2025-06-10T05:08:07.939Z
Learning: For the holidays project, localization file formatting issues (like missing terminal periods in .po files) should be automatically fixed by running `make l10n` command (which is included in `make check`). Authors should be directed to use this automated tooling instead of manual formatting fixes.

Applied to files:

  • holidays/locale/hi/LC_MESSAGES/XNSE.po
  • holidays/locale/en_US/LC_MESSAGES/XNSE.po
📚 Learning: 2025-06-10T12:17:58.880Z
Learnt from: KJhellico
PR: vacanza/holidays#2608
File: holidays/locale/en_VC/LC_MESSAGES/VC.po:1-14
Timestamp: 2025-06-10T12:17:58.880Z
Learning: In the holidays project, .po files should use the full multi-line header format including the project description, authors, website, and license information, rather than a single-line comment format.

Applied to files:

  • holidays/locale/hi/LC_MESSAGES/XNSE.po
  • holidays/locale/en_US/LC_MESSAGES/XNSE.po
📚 Learning: 2025-05-10T04:34:02.406Z
Learnt from: PPsyrius
PR: vacanza/holidays#2537
File: holidays/locale/sv_FI/LC_MESSAGES/AX.po:17-27
Timestamp: 2025-05-10T04:34:02.406Z
Learning: The `Plural-Forms` header isn't used in .po file generation for the holidays project and doesn't need to be manually added to localization files.

Applied to files:

  • holidays/locale/hi/LC_MESSAGES/XNSE.po
📚 Learning: 2025-06-10T05:07:29.372Z
Learnt from: PPsyrius
PR: vacanza/holidays#2608
File: holidays/locale/en_VC/LC_MESSAGES/VC.po:61-66
Timestamp: 2025-06-10T05:07:29.372Z
Learning: For missing translator comments in .po localization files in the holidays repository, direct authors to run `make l10n` or `make check` commands instead of suggesting manual fixes, as these commands automatically handle translator comment generation.

Applied to files:

  • holidays/locale/hi/LC_MESSAGES/XNSE.po
📚 Learning: 2025-03-30T13:33:31.598Z
Learnt from: PPsyrius
PR: vacanza/holidays#2388
File: holidays/locale/fr/LC_MESSAGES/CI.po:28-101
Timestamp: 2025-03-30T13:33:31.598Z
Learning: In the holidays library, for localization files of the default language (like French for Ivory Coast in fr/LC_MESSAGES/CI.po), the best practice is to leave the message strings (msgstr) empty to avoid possible typos, since the message IDs (msgid) are already in the target language.

Applied to files:

  • holidays/locale/hi/LC_MESSAGES/XNSE.po
📚 Learning: 2025-06-18T17:23:16.739Z
Learnt from: PPsyrius
PR: vacanza/holidays#2642
File: holidays/locale/fr/LC_MESSAGES/MF.po:17-28
Timestamp: 2025-06-18T17:23:16.739Z
Learning: In the holidays library, for French holidays localization files, the default_language is 'fr' (French), so X-Source-Language should be set to 'fr', not 'en'. The source language for holidays matches the country's primary language.

Applied to files:

  • holidays/locale/hi/LC_MESSAGES/XNSE.po
  • holidays/locale/en_US/LC_MESSAGES/XNSE.po
📚 Learning: 2025-06-14T11:00:25.835Z
Learnt from: KJhellico
PR: vacanza/holidays#2629
File: holidays/locale/en_US/LC_MESSAGES/NA.po:17-28
Timestamp: 2025-06-14T11:00:25.835Z
Learning: In the holidays library localization files, the X-Source-Language field should contain the value that matches the country's default language setting (e.g., if a country class has default_language = "en_NA", then X-Source-Language should be "en_NA").

Applied to files:

  • holidays/locale/hi/LC_MESSAGES/XNSE.po
  • holidays/locale/en_US/LC_MESSAGES/XNSE.po
📚 Learning: 2025-06-14T10:58:16.431Z
Learnt from: PPsyrius
PR: vacanza/holidays#2629
File: holidays/locale/en_US/LC_MESSAGES/NA.po:17-28
Timestamp: 2025-06-14T10:58:16.431Z
Learning: In the holidays library localization system, different variants of the same language (like en_NA and en_US) can serve as source and target languages, with X-Source-Language correctly indicating the regional variant that serves as the original text.

Applied to files:

  • holidays/locale/hi/LC_MESSAGES/XNSE.po
  • holidays/locale/en_US/LC_MESSAGES/XNSE.po
📚 Learning: 2025-03-26T08:50:03.504Z
Learnt from: PPsyrius
PR: vacanza/holidays#2362
File: holidays/ical.py:176-180
Timestamp: 2025-03-26T08:50:03.504Z
Learning: The "EN" in the PRODID line of the iCalendar export (f"PRODID:-//Vacanza//Open World Holidays Framework v{self.holidays_version}//EN") should be kept as a fixed identifier by design, as agreed upon by the team, even though the actual holiday language may be different.

Applied to files:

  • holidays/locale/hi/LC_MESSAGES/XNSE.po
📚 Learning: 2025-04-05T06:49:06.217Z
Learnt from: PPsyrius
PR: vacanza/holidays#2386
File: tests/countries/test_nepal.py:499-536
Timestamp: 2025-04-05T06:49:06.217Z
Learning: In the holidays project, test files follow a dual testing approach: individual methods test specific holidays across multiple years, while comprehensive year-specific tests (e.g., `test_2025`) verify all holidays for a specific year in a single assertion. Both approaches serve different testing purposes and complement each other.

Applied to files:

  • tests/financial/test_india_stock_exchange.py
📚 Learning: 2025-04-05T04:47:27.213Z
Learnt from: PPsyrius
PR: vacanza/holidays#2416
File: tests/countries/test_turkmenistan.py:52-64
Timestamp: 2025-04-05T04:47:27.213Z
Learning: For holiday tests in the vacanza/holidays project, structure tests by individual holidays rather than by years. Each test method should focus on a specific holiday and test it across multiple years (from start_year through 2050) using helper methods like `assertHolidayName`. For fixed holidays, use generators like `(f"{year}-01-01" for year in range(1991, 2051))`. For movable holidays, specify individual dates for specific years followed by a range check.

Applied to files:

  • tests/financial/test_india_stock_exchange.py
📚 Learning: 2025-05-06T21:07:11.577Z
Learnt from: KJhellico
PR: vacanza/holidays#2530
File: tests/countries/test_andorra.py:23-28
Timestamp: 2025-05-06T21:07:11.577Z
Learning: In the holidays project, test methods for country holidays follow a standard form where year ranges are explicitly recreated in each test method rather than being stored as class variables, to maintain consistency across all country tests.

Applied to files:

  • tests/financial/test_india_stock_exchange.py
📚 Learning: 2025-07-09T21:16:35.145Z
Learnt from: KJhellico
PR: vacanza/holidays#2623
File: tests/countries/test_christmas_island.py:136-146
Timestamp: 2025-07-09T21:16:35.145Z
Learning: In Christmas Island's holiday implementation, the test_christmas_day method cannot use assertNoNonObservedHoliday because in some years observed Christmas Day overlaps with Boxing Day when both holidays are moved due to weekend conflicts, causing the standard non-observed holiday check to fail inappropriately.

Applied to files:

  • tests/financial/test_india_stock_exchange.py
📚 Learning: 2025-07-24T15:21:31.632Z
Learnt from: PPsyrius
PR: vacanza/holidays#2750
File: tests/countries/test_germany.py:46-46
Timestamp: 2025-07-24T15:21:31.632Z
Learning: In the holidays project test files, the standard method name for testing the absence of holidays is `test_no_holidays`, not more descriptive names like `test_no_holidays_before_1990`. This is a consistent naming convention across country test files like France and Germany.

Applied to files:

  • tests/financial/test_india_stock_exchange.py
📚 Learning: 2025-07-02T18:21:59.302Z
Learnt from: KJhellico
PR: vacanza/holidays#2608
File: tests/countries/test_saint_vincent_and_the_grenadines.py:162-178
Timestamp: 2025-07-02T18:21:59.302Z
Learning: In the Saint Vincent and the Grenadines holiday tests, for holidays without observed rules that only require a single assertHolidayName call, pass the holiday name directly as a string literal rather than storing it in a variable first for cleaner, more concise code.

Applied to files:

  • tests/financial/test_india_stock_exchange.py
📚 Learning: 2025-04-23T14:55:35.504Z
Learnt from: PPsyrius
PR: vacanza/holidays#2489
File: holidays/countries/sao_tome_and_principe.py:22-26
Timestamp: 2025-04-23T14:55:35.504Z
Learning: References in holidays classes should only be included if they're used for test case cross-checks or provide historical context about when holidays were added/removed, not just for the sake of having more references.

Applied to files:

  • tests/financial/test_india_stock_exchange.py
  • holidays/financial/national_stock_exchange_of_india.py
📚 Learning: 2025-04-02T18:38:35.164Z
Learnt from: KJhellico
PR: vacanza/holidays#2398
File: tests/countries/test_guinea.py:237-239
Timestamp: 2025-04-02T18:38:35.164Z
Learning: In the vacanza/holidays project, the method assertLocalizedHolidays in country test files should be called with positional parameters rather than named parameters to maintain consistency with the rest of the codebase.

Applied to files:

  • tests/financial/test_india_stock_exchange.py
📚 Learning: 2025-08-11T10:14:28.517Z
Learnt from: PPsyrius
PR: vacanza/holidays#2794
File: holidays/groups/christian.py:328-343
Timestamp: 2025-08-11T10:14:28.517Z
Learning: For Ethiopian holidays in the `holidays/groups/christian.py` file, docstring wording should maintain source-accurate phrasing (e.g., "in coincidence of" for Ethiopian New Year/Enkutatash), even when it might read awkwardly in English, to ensure consistency with official Ethiopian documentation.

Applied to files:

  • tests/financial/test_india_stock_exchange.py
📚 Learning: 2025-05-09T18:36:09.607Z
Learnt from: PPsyrius
PR: vacanza/holidays#2537
File: tests/countries/test_finland.py:23-26
Timestamp: 2025-05-09T18:36:09.607Z
Learning: The holidays project prioritizes complete historical coverage in tests, verifying holidays from their first year of observance (e.g., 1853 for Finland) through future projections, rather than using shorter sliding windows.

Applied to files:

  • tests/financial/test_india_stock_exchange.py
📚 Learning: 2025-06-14T11:04:31.180Z
Learnt from: PPsyrius
PR: vacanza/holidays#2609
File: holidays/countries/nauru.py:57-60
Timestamp: 2025-06-14T11:04:31.180Z
Learning: In the holidays library, the base `HolidayBase._populate()` method already includes a guard clause that prevents holiday population methods like `_populate_public_holidays()` from being called when the year is before `start_year` or after `end_year`. Therefore, individual country implementations do not need to add their own guard clauses for years before independence or other start dates.

Applied to files:

  • tests/financial/test_india_stock_exchange.py
📚 Learning: 2025-06-15T11:52:39.572Z
Learnt from: PPsyrius
PR: vacanza/holidays#2601
File: tests/countries/test_mongolia.py:128-156
Timestamp: 2025-06-15T11:52:39.572Z
Learning: In the vacanza/holidays project tests, when testing holidays that span multiple consecutive days across many years (like Mongolia's National Festival spanning July 11-13), prefer explicit for loops over complex nested generator expressions with unpacking. The explicit loops are more readable, easier to maintain, and better communicate the testing intent even though the Big O complexity is equivalent.

Applied to files:

  • tests/financial/test_india_stock_exchange.py
📚 Learning: 2025-04-05T04:29:38.042Z
Learnt from: PPsyrius
PR: vacanza/holidays#2416
File: tests/countries/test_turkmenistan.py:85-86
Timestamp: 2025-04-05T04:29:38.042Z
Learning: For testing holiday implementations in the vacanza/holidays repository, recommend using `from tests.common import CommonCountryTests` as the base class instead of directly using `unittest.TestCase` to maintain consistency with project conventions and leverage common test utilities.

Applied to files:

  • tests/financial/test_india_stock_exchange.py
📚 Learning: 2025-04-05T04:50:40.752Z
Learnt from: PPsyrius
PR: vacanza/holidays#2416
File: tests/countries/test_turkmenistan.py:31-49
Timestamp: 2025-04-05T04:50:40.752Z
Learning: For Turkmenistan holiday tests, use this class structure: `class TestTurkmenistan(CommonCountryTests, TestCase)` with imports `from unittest import TestCase`, `from holidays.countries import Turkmenistan, TM, TKM`, and `from tests.common import CommonCountryTests`. Ensure to call `super().setUp()` in the setUp method.

Applied to files:

  • tests/financial/test_india_stock_exchange.py
📚 Learning: 2025-08-12T17:16:54.497Z
Learnt from: PPsyrius
PR: vacanza/holidays#2794
File: tests/calendars/test_julian.py:35-36
Timestamp: 2025-08-12T17:16:54.497Z
Learning: In the vacanza/holidays project calendar tests (Thai, Ethiopian, Julian, etc.), the established testing pattern for validation methods is to use simple for loops like `for year in known_data_dict:` followed by `self.assertEqual(expected, actual)` without using unittest's subTest feature. This pattern is consistently maintained across all calendar test files.

Applied to files:

  • tests/financial/test_india_stock_exchange.py
📚 Learning: 2025-04-17T17:08:48.082Z
Learnt from: PPsyrius
PR: vacanza/holidays#2438
File: holidays/locale/ar_IQ/LC_MESSAGES/IQ.po:35-81
Timestamp: 2025-04-17T17:08:48.082Z
Learning: In holiday PO files, when the file represents the default language of an entity (e.g., ar_IQ for Iraq), no translations in `msgstr` are required as the `msgid` values are already in the target language.

Applied to files:

  • holidays/locale/en_US/LC_MESSAGES/XNSE.po
📚 Learning: 2025-05-10T04:02:13.815Z
Learnt from: PPsyrius
PR: vacanza/holidays#2537
File: holidays/countries/finland.py:249-253
Timestamp: 2025-05-10T04:02:13.815Z
Learning: Holiday name comments directly above tr() function calls in the holidays package should only contain the holiday name itself (e.g., "# Independence Day.") without any additional context, dates, or historical information.

Applied to files:

  • holidays/locale/en_US/LC_MESSAGES/XNSE.po
  • holidays/financial/national_stock_exchange_of_india.py
📚 Learning: 2025-03-31T11:50:50.488Z
Learnt from: Wasif-Shahzad
PR: vacanza/holidays#2385
File: holidays/countries/pakistan.py:59-60
Timestamp: 2025-03-31T11:50:50.488Z
Learning: In the holidays library, function names and comments follow en_US spelling conventions (e.g., "Labor Day"), while the default strings may use different locale conventions (e.g., "Labour Day" for en_PK) and are translated appropriately using the gettext function.

Applied to files:

  • holidays/locale/en_US/LC_MESSAGES/XNSE.po
📚 Learning: 2025-08-21T04:51:55.283Z
Learnt from: PPsyrius
PR: vacanza/holidays#2843
File: holidays/countries/burundi.py:24-28
Timestamp: 2025-08-21T04:51:55.283Z
Learning: In the holidays library, timeanddate.com can be included as a reference specifically for historical Islamic holiday observance date verification, even when official government sources are available, as long as the official sources are listed first in the references.

Applied to files:

  • holidays/financial/national_stock_exchange_of_india.py
📚 Learning: 2025-07-10T03:36:16.461Z
Learnt from: PPsyrius
PR: vacanza/holidays#2706
File: holidays/countries/cayman_islands.py:80-97
Timestamp: 2025-07-10T03:36:16.461Z
Learning: In the holidays library, date dictionaries that map years to specific dates (like queens_birthday_dates, spring_bank_dates, thanksgiving_day_dates, etc.) are typically defined within the _populate_public_holidays method rather than as module-level constants. This is the established library-wide pattern seen across multiple country implementations including United Kingdom, United States, Sri Lanka, and others.

Applied to files:

  • holidays/financial/national_stock_exchange_of_india.py
📚 Learning: 2025-06-14T20:12:37.212Z
Learnt from: KJhellico
PR: vacanza/holidays#2614
File: holidays/countries/guyana.py:146-179
Timestamp: 2025-06-14T20:12:37.212Z
Learning: The `_CustomHinduHolidays` mechanism works through `_CustomCalendarType` metaclass which renames public attributes (like `DIWALI_INDIA_DATES`) with a postfix, allowing `_HinduLunisolar::_get_holiday` to find and use custom holiday dates. When `_add_diwali_india()` is called, it uses the custom dates if available rather than calculated dates.

Applied to files:

  • holidays/financial/national_stock_exchange_of_india.py
📚 Learning: 2025-06-29T10:36:06.138Z
Learnt from: KJhellico
PR: vacanza/holidays#2671
File: holidays/countries/libya.py:51-108
Timestamp: 2025-06-29T10:36:06.138Z
Learning: There is no project-wide convention in the holidays library to organize holidays by calendar type (Islamic holidays first, then Gregorian holidays). Countries organize holidays in various ways - often chronologically, by importance, or by logical grouping - and Islamic holidays are frequently placed at the end of the _populate_public_holidays method rather than at the beginning.

Applied to files:

  • holidays/financial/national_stock_exchange_of_india.py
📚 Learning: 2025-06-06T14:40:31.932Z
Learnt from: KJhellico
PR: vacanza/holidays#2593
File: holidays/countries/senegal.py:66-110
Timestamp: 2025-06-06T14:40:31.932Z
Learning: In the holidays library, within the _populate_public_holidays method, holidays should be arranged by calendar type (Islamic holidays first, then Gregorian holidays) without additional type grouping comments. The organization by calendar type is sufficient and follows the project's established conventions.

Applied to files:

  • holidays/financial/national_stock_exchange_of_india.py
📚 Learning: 2025-04-03T16:58:27.175Z
Learnt from: Wasif-Shahzad
PR: vacanza/holidays#2409
File: holidays/countries/qatar.py:27-46
Timestamp: 2025-04-03T16:58:27.175Z
Learning: In the holidays library, method names like `_add_holiday_2nd_tue_of_feb()` and `_add_holiday_1st_sun_of_mar()` use calendar constants like FEB, TUE, MAR, and SUN internally through parent class implementations even when these constants don't appear directly in the file.

Applied to files:

  • holidays/financial/national_stock_exchange_of_india.py
📚 Learning: 2025-06-19T02:34:18.382Z
Learnt from: PPsyrius
PR: vacanza/holidays#2643
File: holidays/countries/mauritius.py:144-169
Timestamp: 2025-06-19T02:34:18.382Z
Learning: Custom holiday classes that extend _CustomHinduHolidays, _CustomIslamicHolidays, _CustomBuddhistHolidays, etc. in the holidays library do not use docstrings. They follow a pattern of using only inline comments above date dictionaries, as seen in Malaysia, Singapore, UAE, and other country implementations.

Applied to files:

  • holidays/financial/national_stock_exchange_of_india.py
📚 Learning: 2025-08-19T21:00:47.849Z
Learnt from: KJhellico
PR: vacanza/holidays#2831
File: holidays/countries/south_sudan.py:84-88
Timestamp: 2025-08-19T21:00:47.849Z
Learning: In the holidays library, Islamic holidays use dedicated methods for additional days (like `_add_eid_al_fitr_day_two`, `_add_eid_al_adha_day_two`) rather than parameters. The methods don't accept a `days` parameter - each day has its own specific method.

Applied to files:

  • holidays/financial/national_stock_exchange_of_india.py
📚 Learning: 2025-05-01T19:19:42.346Z
Learnt from: KJhellico
PR: vacanza/holidays#2386
File: tests/countries/test_nepal.py:551-554
Timestamp: 2025-05-01T19:19:42.346Z
Learning: In the holidays library, when multiple holidays fall on the same date, their names are always sorted alphabetically (in __setitem__ of HolidayBase), so the order of addition does not affect the resulting string.

Applied to files:

  • holidays/financial/national_stock_exchange_of_india.py
📚 Learning: 2025-07-10T03:36:16.461Z
Learnt from: PPsyrius
PR: vacanza/holidays#2706
File: holidays/countries/cayman_islands.py:80-97
Timestamp: 2025-07-10T03:36:16.461Z
Learning: In the holidays library, date dictionaries that map years to specific dates (like queens_birthday_dates, special holiday dates, etc.) are typically defined within the _populate_public_holidays method rather than as module-level constants. This is the established library-wide pattern and should be maintained for consistency.

Applied to files:

  • holidays/financial/national_stock_exchange_of_india.py
📚 Learning: 2025-06-19T02:34:14.456Z
Learnt from: PPsyrius
PR: vacanza/holidays#2643
File: holidays/countries/mauritius.py:171-184
Timestamp: 2025-06-19T02:34:14.456Z
Learning: In the holidays library, `_CustomIslamicHolidays` subclasses follow a consistent pattern of NOT having docstrings. They go directly to defining date dictionaries, as evidenced by Malaysia, Singapore, UAE, and dozens of other country implementations.

Applied to files:

  • holidays/financial/national_stock_exchange_of_india.py
📚 Learning: 2025-05-13T13:23:11.375Z
Learnt from: KJhellico
PR: vacanza/holidays#2483
File: holidays/countries/turks_and_caicos_islands.py:117-118
Timestamp: 2025-05-13T13:23:11.375Z
Learning: The holidays library uses `_add_christmas_day_two` method to add Boxing Day holiday, not `_add_boxing_day`.

Applied to files:

  • holidays/financial/national_stock_exchange_of_india.py
📚 Learning: 2025-08-19T21:22:13.125Z
Learnt from: KJhellico
PR: vacanza/holidays#2831
File: holidays/countries/south_sudan.py:84-88
Timestamp: 2025-08-19T21:22:13.125Z
Learning: In the holidays library, message comments directly above holiday addition methods must match the holiday name exactly without any additions, modifications, or explanatory text. For example, if the holiday name is "Eid al-Fitr Holiday", the comment should be "# Eid al-Fitr Holiday." with no extra context.

Applied to files:

  • holidays/financial/national_stock_exchange_of_india.py
📚 Learning: 2025-08-21T04:56:03.711Z
Learnt from: PPsyrius
PR: vacanza/holidays#2843
File: holidays/countries/burundi.py:63-101
Timestamp: 2025-08-21T04:56:03.711Z
Learning: In the holidays library, countries with localization support consistently use tr() wrappers around holiday names when calling _add_* methods (e.g., self._add_new_years_day(tr("Holiday Name"))). This is the established pattern across United States, Thailand, and other l10n-enabled countries, contrary to any suggestion that translation is handled internally by _add_* methods.

Applied to files:

  • holidays/financial/national_stock_exchange_of_india.py
📚 Learning: 2025-06-16T14:08:09.492Z
Learnt from: KJhellico
PR: vacanza/holidays#2635
File: holidays/countries/bhutan.py:13-16
Timestamp: 2025-06-16T14:08:09.492Z
Learning: In the holidays library, translation is performed in the `_add_holiday` methods, not at the string level. Holiday strings passed to `_add_holiday_*` methods are processed through the translation machinery within those methods, so using `tr()` or `self.tr()` wrappers is unnecessary.

Applied to files:

  • holidays/financial/national_stock_exchange_of_india.py
📚 Learning: 2025-08-21T04:56:03.711Z
Learnt from: PPsyrius
PR: vacanza/holidays#2843
File: holidays/countries/burundi.py:63-101
Timestamp: 2025-08-21T04:56:03.711Z
Learning: In the holidays library, countries with localization support DO use tr() wrappers around holiday names when calling _add_* methods. This is the correct pattern for l10n-enabled country implementations, contrary to previous learning about translation being handled internally by _add_* methods.

Applied to files:

  • holidays/financial/national_stock_exchange_of_india.py
📚 Learning: 2025-05-10T04:32:15.760Z
Learnt from: PPsyrius
PR: vacanza/holidays#2537
File: holidays/countries/finland.py:0-0
Timestamp: 2025-05-10T04:32:15.760Z
Learning: In the holidays package, detailed historical context and additional information should be added as comments at the method level or above conditional blocks, while comments directly above tr() function calls should only contain the holiday name itself (e.g., "# Independence Day.").

Applied to files:

  • holidays/financial/national_stock_exchange_of_india.py
🧬 Code graph analysis (2)
tests/financial/test_india_stock_exchange.py (2)
tests/common.py (7)
  • TestCase (28-338)
  • CommonFinancialTests (377-382)
  • assertAliases (121-130)
  • assertNoHolidays (292-294)
  • assertHolidayName (195-199)
  • assertHolidays (228-230)
  • assertLocalizedHolidays (327-338)
holidays/financial/national_stock_exchange_of_india.py (3)
  • NSE (249-252)
  • XNSE (255-258)
  • NationalStockExchangeOfIndia (54-246)
holidays/financial/national_stock_exchange_of_india.py (2)
holidays/observed_holiday_base.py (1)
  • ObservedHolidayBase (102-246)
holidays/holiday_base.py (2)
  • get (946-969)
  • _add_holiday (797-809)
🔇 Additional comments (14)
README.md (1)

1831-1835: Row looks structurally correct.

Entity name (no acronym), 4 columns, default language bolded — consistent with this table’s conventions.

snapshots/financial/XNSE.json (1)

41-42: LGTM on multi-holiday separator and prior normalizations.

Semicolon is correct for multiple holidays (2025‑10‑02), and Ram Navami duplicate/synonym issues are resolved.

Also applies to: 23-23

holidays/locale/hi/LC_MESSAGES/XNSE.po (1)

15-28: Header metadata looks right.

Language = hi and X-Source-Language = en_IN match the entity’s default_language.

holidays/locale/en_US/LC_MESSAGES/XNSE.po (1)

15-28: Header is consistent.

Language en_US; X-Source-Language en_IN — good.

holidays/financial/national_stock_exchange_of_india.py (3)

243-246: Good call: avoid double-translation here.

Using the passed-in name with _add_holiday is correct, given call sites already use tr().


249-258: Aliases read well.

NSE/XNSE aliases are minimal and follow project style.


181-242: It looks like the sandbox doesn’t have make installed, so we can’t complete the sanity checks here. Could you please run the following in your local environment and share the output?

# 1) Rebuild locales/snapshots and packaging metadata
make l10n
make snapshot
make package

# 2) Verify no old strings remain
rg -nP 'Id-?Ul-?Fitr\s*\(Ramadan Eid\)' -C2 holidays snapshots || echo "OK: no old Eid strings"
rg -nP 'Baba\s+Saheb Ambedkar' -C2 holidays snapshots || echo "OK: unified Ambedkar label"

# 3) Check that combined‐holiday separator is semicolon (no slashes)
rg -nP ':\s*".*?/.*?"' snapshots/financial/XNSE.json && { echo "❌ Found '/' in snapshot"; exit 1; } || echo "✅ OK: no slashes"

# 4) Run NSE smoke tests
pytest -q -k XNSE

Once you’ve verified that everything passes (no failures, no old strings, and the separator is correct), we’ll be confident the rename/canonicalization is complete. Thanks!

tests/financial/test_india_stock_exchange.py (7)

42-50: LGTM: Dussehra dates align with implementation.


116-119: LGTM: Unified “Christmas Day” naming across years.


120-139: LGTM: 2023 full-year snapshot matches the implementation set.


141-159: LGTM: 2024 full-year snapshot matches the implementation set, including Laxmi Pujan.


200-219: LGTM: en_US localization assertions match default naming for 2023.


221-241: LGTM: hi localization rows are consistent and scoped to 2023 where coverage exists.


51-54: Naming Verified

The snapshot entries for both dates in snapshots/financial/XNSE.json use “Diwali Laxmi Pujan,” matching the test code exactly. No update needed.

Copy link
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: 3

♻️ Duplicate comments (8)
holidays/financial/national_stock_exchange_of_india.py (4)

57-59: Point the reference to the archived NSE Holidays landing page (not circulars).

Use the specific Holidays page for long-term stability and clearer provenance.

Apply:

     References:
-        * <https://web.archive.org/web/20250821175252/https://www.nseindia.com/resources/exchange-communication-circulars>
+        * <https://web.archive.org/web/20250712194409/https://www.nseindia.com/resources/exchange-communication-holidays>

197-200: Unify Ambedkar label to “Dr. Babasaheb Ambedkar Jayanti”.

This is the common IN form and aligns with other IN entities and locales.

Apply:

-        # Dr. Baba Saheb Ambedkar Jayanti
-        self._get_holiday(
-            tr("Dr. Baba Saheb Ambedkar Jayanti"), DR_BABA_SAHEB_AMBEDKAR_JAYANTI, self._year
-        )
+        # Dr. Babasaheb Ambedkar Jayanti.
+        self._get_holiday("Dr. Babasaheb Ambedkar Jayanti", DR_BABA_SAHEB_AMBEDKAR_JAYANTI, self._year)

Remember to update en_IN and hi PO entries and snapshots.


214-215: Canonicalize Eid label to en_IN “Id-ul-Fitr”.

Current string “Id-Ul-Fitr (Ramadan Eid)” is non-canonical and includes extra context not used elsewhere.

Apply:

-        # Id Ul Fitr (Ramadan Eid)
-        self._get_holiday(tr("Id-Ul-Fitr (Ramadan Eid)"), ID_UL_FITR, self._year)
+        # Id-ul-Fitr.
+        self._get_holiday("Id-ul-Fitr", ID_UL_FITR, self._year)

Update locales accordingly:

  • en_IN msgid “Id-ul-Fitr”
  • en_US msgstr “Eid al-Fitr”
  • Rebuild: make l10n && make snapshot

78-177: Optional: move year→date maps into _populate for consistency.

Most entities keep per-year dicts local to the population method to minimize class surface and ease future gating.

You can wrap them inside _populate_public_holidays with lowercased locals (e.g., bakri_id_dates = {...}) and read from those. No functional change.

tests/financial/test_india_stock_exchange.py (4)

26-26: Tighten fixture years to implemented coverage (2023–2025).

Reduces test surface and matches available data.

Apply:

-        super().setUpClass(NationalStockExchangeOfIndia, years=range(2022, 2026))
+        super().setUpClass(NationalStockExchangeOfIndia, years=range(2023, 2026))

31-33: Also assert no holidays for 2022 (immediate pre-coverage year).

Guards the boundary before first supported year.

Apply:

     def test_no_holidays(self):
         self.assertNoHolidays(NationalStockExchangeOfIndia(years=1993))
+        self.assertNoHolidays(NationalStockExchangeOfIndia(years=2022))

58-65: Update expected name to “Dr. Babasaheb Ambedkar Jayanti”.

Aligns tests with the canonical label proposed in the implementation.

Apply:

-        name = "Dr. Baba Saheb Ambedkar Jayanti"
+        name = "Dr. Babasaheb Ambedkar Jayanti"

101-107: Canonicalize Eid label in tests to “Id-ul-Fitr”.

Keep test expectations in sync with implementation and locales.

Apply:

-        name = "Id-Ul-Fitr (Ramadan Eid)"
+        name = "Id-ul-Fitr"
         self.assertHolidayName(
             name,
             "2024-04-11",
             "2025-03-31",
         )
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between e150447 and db6291d.

📒 Files selected for processing (2)
  • holidays/financial/national_stock_exchange_of_india.py (1 hunks)
  • tests/financial/test_india_stock_exchange.py (1 hunks)
🧰 Additional context used
🧠 Learnings (38)
📚 Learning: 2025-04-23T14:55:35.504Z
Learnt from: PPsyrius
PR: vacanza/holidays#2489
File: holidays/countries/sao_tome_and_principe.py:22-26
Timestamp: 2025-04-23T14:55:35.504Z
Learning: References in holidays classes should only be included if they're used for test case cross-checks or provide historical context about when holidays were added/removed, not just for the sake of having more references.

Applied to files:

  • holidays/financial/national_stock_exchange_of_india.py
  • tests/financial/test_india_stock_exchange.py
📚 Learning: 2025-08-21T04:51:55.283Z
Learnt from: PPsyrius
PR: vacanza/holidays#2843
File: holidays/countries/burundi.py:24-28
Timestamp: 2025-08-21T04:51:55.283Z
Learning: In the holidays library, timeanddate.com can be included as a reference specifically for historical Islamic holiday observance date verification, even when official government sources are available, as long as the official sources are listed first in the references.

Applied to files:

  • holidays/financial/national_stock_exchange_of_india.py
📚 Learning: 2025-03-19T16:54:58.657Z
Learnt from: PPsyrius
PR: vacanza/holidays#2354
File: holidays/countries/fiji.py:146-159
Timestamp: 2025-03-19T16:54:58.657Z
Learning: In the holidays library implementation, explicit holiday dates (like Diwali in Fiji) are only defined for historical years with official sources (2016-2025). Future dates beyond the explicitly defined range are automatically calculated by methods like `_add_diwali`, which provide approximations when official dates aren't yet available.

Applied to files:

  • holidays/financial/national_stock_exchange_of_india.py
📚 Learning: 2025-07-10T03:36:16.461Z
Learnt from: PPsyrius
PR: vacanza/holidays#2706
File: holidays/countries/cayman_islands.py:80-97
Timestamp: 2025-07-10T03:36:16.461Z
Learning: In the holidays library, date dictionaries that map years to specific dates (like queens_birthday_dates, spring_bank_dates, thanksgiving_day_dates, etc.) are typically defined within the _populate_public_holidays method rather than as module-level constants. This is the established library-wide pattern seen across multiple country implementations including United Kingdom, United States, Sri Lanka, and others.

Applied to files:

  • holidays/financial/national_stock_exchange_of_india.py
📚 Learning: 2025-06-14T20:12:37.212Z
Learnt from: KJhellico
PR: vacanza/holidays#2614
File: holidays/countries/guyana.py:146-179
Timestamp: 2025-06-14T20:12:37.212Z
Learning: The `_CustomHinduHolidays` mechanism works through `_CustomCalendarType` metaclass which renames public attributes (like `DIWALI_INDIA_DATES`) with a postfix, allowing `_HinduLunisolar::_get_holiday` to find and use custom holiday dates. When `_add_diwali_india()` is called, it uses the custom dates if available rather than calculated dates.

Applied to files:

  • holidays/financial/national_stock_exchange_of_india.py
📚 Learning: 2025-06-29T10:36:06.138Z
Learnt from: KJhellico
PR: vacanza/holidays#2671
File: holidays/countries/libya.py:51-108
Timestamp: 2025-06-29T10:36:06.138Z
Learning: There is no project-wide convention in the holidays library to organize holidays by calendar type (Islamic holidays first, then Gregorian holidays). Countries organize holidays in various ways - often chronologically, by importance, or by logical grouping - and Islamic holidays are frequently placed at the end of the _populate_public_holidays method rather than at the beginning.

Applied to files:

  • holidays/financial/national_stock_exchange_of_india.py
📚 Learning: 2025-06-06T14:40:31.932Z
Learnt from: KJhellico
PR: vacanza/holidays#2593
File: holidays/countries/senegal.py:66-110
Timestamp: 2025-06-06T14:40:31.932Z
Learning: In the holidays library, within the _populate_public_holidays method, holidays should be arranged by calendar type (Islamic holidays first, then Gregorian holidays) without additional type grouping comments. The organization by calendar type is sufficient and follows the project's established conventions.

Applied to files:

  • holidays/financial/national_stock_exchange_of_india.py
📚 Learning: 2025-04-03T16:58:27.175Z
Learnt from: Wasif-Shahzad
PR: vacanza/holidays#2409
File: holidays/countries/qatar.py:27-46
Timestamp: 2025-04-03T16:58:27.175Z
Learning: In the holidays library, method names like `_add_holiday_2nd_tue_of_feb()` and `_add_holiday_1st_sun_of_mar()` use calendar constants like FEB, TUE, MAR, and SUN internally through parent class implementations even when these constants don't appear directly in the file.

Applied to files:

  • holidays/financial/national_stock_exchange_of_india.py
📚 Learning: 2025-06-19T02:34:18.382Z
Learnt from: PPsyrius
PR: vacanza/holidays#2643
File: holidays/countries/mauritius.py:144-169
Timestamp: 2025-06-19T02:34:18.382Z
Learning: Custom holiday classes that extend _CustomHinduHolidays, _CustomIslamicHolidays, _CustomBuddhistHolidays, etc. in the holidays library do not use docstrings. They follow a pattern of using only inline comments above date dictionaries, as seen in Malaysia, Singapore, UAE, and other country implementations.

Applied to files:

  • holidays/financial/national_stock_exchange_of_india.py
📚 Learning: 2025-08-19T21:00:47.849Z
Learnt from: KJhellico
PR: vacanza/holidays#2831
File: holidays/countries/south_sudan.py:84-88
Timestamp: 2025-08-19T21:00:47.849Z
Learning: In the holidays library, Islamic holidays use dedicated methods for additional days (like `_add_eid_al_fitr_day_two`, `_add_eid_al_adha_day_two`) rather than parameters. The methods don't accept a `days` parameter - each day has its own specific method.

Applied to files:

  • holidays/financial/national_stock_exchange_of_india.py
📚 Learning: 2025-05-01T19:19:42.346Z
Learnt from: KJhellico
PR: vacanza/holidays#2386
File: tests/countries/test_nepal.py:551-554
Timestamp: 2025-05-01T19:19:42.346Z
Learning: In the holidays library, when multiple holidays fall on the same date, their names are always sorted alphabetically (in __setitem__ of HolidayBase), so the order of addition does not affect the resulting string.

Applied to files:

  • holidays/financial/national_stock_exchange_of_india.py
📚 Learning: 2025-07-10T03:36:16.461Z
Learnt from: PPsyrius
PR: vacanza/holidays#2706
File: holidays/countries/cayman_islands.py:80-97
Timestamp: 2025-07-10T03:36:16.461Z
Learning: In the holidays library, date dictionaries that map years to specific dates (like queens_birthday_dates, special holiday dates, etc.) are typically defined within the _populate_public_holidays method rather than as module-level constants. This is the established library-wide pattern and should be maintained for consistency.

Applied to files:

  • holidays/financial/national_stock_exchange_of_india.py
📚 Learning: 2025-06-19T02:34:14.456Z
Learnt from: PPsyrius
PR: vacanza/holidays#2643
File: holidays/countries/mauritius.py:171-184
Timestamp: 2025-06-19T02:34:14.456Z
Learning: In the holidays library, `_CustomIslamicHolidays` subclasses follow a consistent pattern of NOT having docstrings. They go directly to defining date dictionaries, as evidenced by Malaysia, Singapore, UAE, and dozens of other country implementations.

Applied to files:

  • holidays/financial/national_stock_exchange_of_india.py
📚 Learning: 2025-05-13T13:23:11.375Z
Learnt from: KJhellico
PR: vacanza/holidays#2483
File: holidays/countries/turks_and_caicos_islands.py:117-118
Timestamp: 2025-05-13T13:23:11.375Z
Learning: The holidays library uses `_add_christmas_day_two` method to add Boxing Day holiday, not `_add_boxing_day`.

Applied to files:

  • holidays/financial/national_stock_exchange_of_india.py
📚 Learning: 2025-03-08T11:28:48.652Z
Learnt from: KJhellico
PR: vacanza/holidays#2259
File: holidays/locale/en_IN/LC_MESSAGES/IN.po:285-299
Timestamp: 2025-03-08T11:28:48.652Z
Learning: In the holidays project, message IDs (msgids) in locale files use region-specific naming conventions (e.g., "Muharram", "Id-ul-Fitr" in en_IN locale for India), while translator comments use internationally recognized names from the project's default locale (en_US) such as "Ashura", "Eid al-Fitr". This difference is intentional for proper localization.

Applied to files:

  • holidays/financial/national_stock_exchange_of_india.py
📚 Learning: 2025-08-19T21:22:13.125Z
Learnt from: KJhellico
PR: vacanza/holidays#2831
File: holidays/countries/south_sudan.py:84-88
Timestamp: 2025-08-19T21:22:13.125Z
Learning: In the holidays library, message comments directly above holiday addition methods must match the holiday name exactly without any additions, modifications, or explanatory text. For example, if the holiday name is "Eid al-Fitr Holiday", the comment should be "# Eid al-Fitr Holiday." with no extra context.

Applied to files:

  • holidays/financial/national_stock_exchange_of_india.py
📚 Learning: 2025-08-21T04:56:03.711Z
Learnt from: PPsyrius
PR: vacanza/holidays#2843
File: holidays/countries/burundi.py:63-101
Timestamp: 2025-08-21T04:56:03.711Z
Learning: In the holidays library, countries with localization support consistently use tr() wrappers around holiday names when calling _add_* methods (e.g., self._add_new_years_day(tr("Holiday Name"))). This is the established pattern across United States, Thailand, and other l10n-enabled countries, contrary to any suggestion that translation is handled internally by _add_* methods.

Applied to files:

  • holidays/financial/national_stock_exchange_of_india.py
📚 Learning: 2025-06-16T14:08:09.492Z
Learnt from: KJhellico
PR: vacanza/holidays#2635
File: holidays/countries/bhutan.py:13-16
Timestamp: 2025-06-16T14:08:09.492Z
Learning: In the holidays library, translation is performed in the `_add_holiday` methods, not at the string level. Holiday strings passed to `_add_holiday_*` methods are processed through the translation machinery within those methods, so using `tr()` or `self.tr()` wrappers is unnecessary.

Applied to files:

  • holidays/financial/national_stock_exchange_of_india.py
📚 Learning: 2025-08-21T04:56:03.711Z
Learnt from: PPsyrius
PR: vacanza/holidays#2843
File: holidays/countries/burundi.py:63-101
Timestamp: 2025-08-21T04:56:03.711Z
Learning: In the holidays library, countries with localization support DO use tr() wrappers around holiday names when calling _add_* methods. This is the correct pattern for l10n-enabled country implementations, contrary to previous learning about translation being handled internally by _add_* methods.

Applied to files:

  • holidays/financial/national_stock_exchange_of_india.py
📚 Learning: 2025-05-10T04:02:13.815Z
Learnt from: PPsyrius
PR: vacanza/holidays#2537
File: holidays/countries/finland.py:249-253
Timestamp: 2025-05-10T04:02:13.815Z
Learning: Holiday name comments directly above tr() function calls in the holidays package should only contain the holiday name itself (e.g., "# Independence Day.") without any additional context, dates, or historical information.

Applied to files:

  • holidays/financial/national_stock_exchange_of_india.py
📚 Learning: 2025-05-10T04:32:15.760Z
Learnt from: PPsyrius
PR: vacanza/holidays#2537
File: holidays/countries/finland.py:0-0
Timestamp: 2025-05-10T04:32:15.760Z
Learning: In the holidays package, detailed historical context and additional information should be added as comments at the method level or above conditional blocks, while comments directly above tr() function calls should only contain the holiday name itself (e.g., "# Independence Day.").

Applied to files:

  • holidays/financial/national_stock_exchange_of_india.py
📚 Learning: 2025-06-14T11:04:31.180Z
Learnt from: PPsyrius
PR: vacanza/holidays#2609
File: holidays/countries/nauru.py:57-60
Timestamp: 2025-06-14T11:04:31.180Z
Learning: In the holidays library, the base `HolidayBase._populate()` method already includes a guard clause that prevents holiday population methods like `_populate_public_holidays()` from being called when the year is before `start_year` or after `end_year`. Therefore, individual country implementations do not need to add their own guard clauses for years before independence or other start dates.

Applied to files:

  • holidays/financial/national_stock_exchange_of_india.py
  • tests/financial/test_india_stock_exchange.py
📚 Learning: 2025-04-03T16:58:27.175Z
Learnt from: Wasif-Shahzad
PR: vacanza/holidays#2409
File: holidays/countries/qatar.py:27-46
Timestamp: 2025-04-03T16:58:27.175Z
Learning: In the holidays library, method names like `_add_holiday_2nd_tue_of_feb()` and `_add_holiday_1st_sun_of_mar()` use calendar constants internally through parent class implementations even when these constants don't appear directly in the file. Removing imports that seem unused based on a simple text search could break functionality.

Applied to files:

  • holidays/financial/national_stock_exchange_of_india.py
📚 Learning: 2025-06-16T12:28:31.641Z
Learnt from: PPsyrius
PR: vacanza/holidays#2632
File: holidays/countries/solomon_islands.py:95-98
Timestamp: 2025-06-16T12:28:31.641Z
Learning: Library-wide holiday patterns and their optimizations should be handled at the base class level (like InternationalHolidays) rather than documenting workarounds in individual country modules. This maintains separation of concerns and avoids documentation duplication.

Applied to files:

  • holidays/financial/national_stock_exchange_of_india.py
📚 Learning: 2025-03-23T10:11:50.465Z
Learnt from: KJhellico
PR: vacanza/holidays#2354
File: holidays/countries/fiji.py:63-70
Timestamp: 2025-03-23T10:11:50.465Z
Learning: In the holidays library, the `SAT_SUN_TO_NEXT_MON_TUE` rule is specifically used for consecutive holidays (like Christmas Day and Boxing Day) to ensure they're observed on separate weekdays (Monday and Tuesday) when they fall on weekends, while `SAT_SUN_TO_NEXT_MON` is used as the default rule for other holidays.

Applied to files:

  • holidays/financial/national_stock_exchange_of_india.py
📚 Learning: 2025-04-05T06:49:06.217Z
Learnt from: PPsyrius
PR: vacanza/holidays#2386
File: tests/countries/test_nepal.py:499-536
Timestamp: 2025-04-05T06:49:06.217Z
Learning: In the holidays project, test files follow a dual testing approach: individual methods test specific holidays across multiple years, while comprehensive year-specific tests (e.g., `test_2025`) verify all holidays for a specific year in a single assertion. Both approaches serve different testing purposes and complement each other.

Applied to files:

  • tests/financial/test_india_stock_exchange.py
📚 Learning: 2025-04-05T04:47:27.213Z
Learnt from: PPsyrius
PR: vacanza/holidays#2416
File: tests/countries/test_turkmenistan.py:52-64
Timestamp: 2025-04-05T04:47:27.213Z
Learning: For holiday tests in the vacanza/holidays project, structure tests by individual holidays rather than by years. Each test method should focus on a specific holiday and test it across multiple years (from start_year through 2050) using helper methods like `assertHolidayName`. For fixed holidays, use generators like `(f"{year}-01-01" for year in range(1991, 2051))`. For movable holidays, specify individual dates for specific years followed by a range check.

Applied to files:

  • tests/financial/test_india_stock_exchange.py
📚 Learning: 2025-05-06T21:07:11.577Z
Learnt from: KJhellico
PR: vacanza/holidays#2530
File: tests/countries/test_andorra.py:23-28
Timestamp: 2025-05-06T21:07:11.577Z
Learning: In the holidays project, test methods for country holidays follow a standard form where year ranges are explicitly recreated in each test method rather than being stored as class variables, to maintain consistency across all country tests.

Applied to files:

  • tests/financial/test_india_stock_exchange.py
📚 Learning: 2025-07-09T21:16:35.145Z
Learnt from: KJhellico
PR: vacanza/holidays#2623
File: tests/countries/test_christmas_island.py:136-146
Timestamp: 2025-07-09T21:16:35.145Z
Learning: In Christmas Island's holiday implementation, the test_christmas_day method cannot use assertNoNonObservedHoliday because in some years observed Christmas Day overlaps with Boxing Day when both holidays are moved due to weekend conflicts, causing the standard non-observed holiday check to fail inappropriately.

Applied to files:

  • tests/financial/test_india_stock_exchange.py
📚 Learning: 2025-07-24T15:21:31.632Z
Learnt from: PPsyrius
PR: vacanza/holidays#2750
File: tests/countries/test_germany.py:46-46
Timestamp: 2025-07-24T15:21:31.632Z
Learning: In the holidays project test files, the standard method name for testing the absence of holidays is `test_no_holidays`, not more descriptive names like `test_no_holidays_before_1990`. This is a consistent naming convention across country test files like France and Germany.

Applied to files:

  • tests/financial/test_india_stock_exchange.py
📚 Learning: 2025-07-02T18:21:59.302Z
Learnt from: KJhellico
PR: vacanza/holidays#2608
File: tests/countries/test_saint_vincent_and_the_grenadines.py:162-178
Timestamp: 2025-07-02T18:21:59.302Z
Learning: In the Saint Vincent and the Grenadines holiday tests, for holidays without observed rules that only require a single assertHolidayName call, pass the holiday name directly as a string literal rather than storing it in a variable first for cleaner, more concise code.

Applied to files:

  • tests/financial/test_india_stock_exchange.py
📚 Learning: 2025-04-02T18:38:35.164Z
Learnt from: KJhellico
PR: vacanza/holidays#2398
File: tests/countries/test_guinea.py:237-239
Timestamp: 2025-04-02T18:38:35.164Z
Learning: In the vacanza/holidays project, the method assertLocalizedHolidays in country test files should be called with positional parameters rather than named parameters to maintain consistency with the rest of the codebase.

Applied to files:

  • tests/financial/test_india_stock_exchange.py
📚 Learning: 2025-08-11T10:14:28.517Z
Learnt from: PPsyrius
PR: vacanza/holidays#2794
File: holidays/groups/christian.py:328-343
Timestamp: 2025-08-11T10:14:28.517Z
Learning: For Ethiopian holidays in the `holidays/groups/christian.py` file, docstring wording should maintain source-accurate phrasing (e.g., "in coincidence of" for Ethiopian New Year/Enkutatash), even when it might read awkwardly in English, to ensure consistency with official Ethiopian documentation.

Applied to files:

  • tests/financial/test_india_stock_exchange.py
📚 Learning: 2025-05-09T18:36:09.607Z
Learnt from: PPsyrius
PR: vacanza/holidays#2537
File: tests/countries/test_finland.py:23-26
Timestamp: 2025-05-09T18:36:09.607Z
Learning: The holidays project prioritizes complete historical coverage in tests, verifying holidays from their first year of observance (e.g., 1853 for Finland) through future projections, rather than using shorter sliding windows.

Applied to files:

  • tests/financial/test_india_stock_exchange.py
📚 Learning: 2025-06-15T11:52:39.572Z
Learnt from: PPsyrius
PR: vacanza/holidays#2601
File: tests/countries/test_mongolia.py:128-156
Timestamp: 2025-06-15T11:52:39.572Z
Learning: In the vacanza/holidays project tests, when testing holidays that span multiple consecutive days across many years (like Mongolia's National Festival spanning July 11-13), prefer explicit for loops over complex nested generator expressions with unpacking. The explicit loops are more readable, easier to maintain, and better communicate the testing intent even though the Big O complexity is equivalent.

Applied to files:

  • tests/financial/test_india_stock_exchange.py
📚 Learning: 2025-04-05T04:29:38.042Z
Learnt from: PPsyrius
PR: vacanza/holidays#2416
File: tests/countries/test_turkmenistan.py:85-86
Timestamp: 2025-04-05T04:29:38.042Z
Learning: For testing holiday implementations in the vacanza/holidays repository, recommend using `from tests.common import CommonCountryTests` as the base class instead of directly using `unittest.TestCase` to maintain consistency with project conventions and leverage common test utilities.

Applied to files:

  • tests/financial/test_india_stock_exchange.py
📚 Learning: 2025-04-04T10:52:41.546Z
Learnt from: KJhellico
PR: vacanza/holidays#2398
File: holidays/countries/guinea.py:106-110
Timestamp: 2025-04-04T10:52:41.546Z
Learning: In the Guinea holidays implementation, observed Eid al-Fitr cases are properly covered by the test_eid_al_fitr_day() method, which tests both the regular holiday dates and the observed dates when the holiday falls on a non-working day (for years >= 2023).

Applied to files:

  • tests/financial/test_india_stock_exchange.py
📚 Learning: 2025-08-12T17:16:54.497Z
Learnt from: PPsyrius
PR: vacanza/holidays#2794
File: tests/calendars/test_julian.py:35-36
Timestamp: 2025-08-12T17:16:54.497Z
Learning: In the vacanza/holidays project calendar tests (Thai, Ethiopian, Julian, etc.), the established testing pattern for validation methods is to use simple for loops like `for year in known_data_dict:` followed by `self.assertEqual(expected, actual)` without using unittest's subTest feature. This pattern is consistently maintained across all calendar test files.

Applied to files:

  • tests/financial/test_india_stock_exchange.py
🧬 Code graph analysis (2)
holidays/financial/national_stock_exchange_of_india.py (2)
holidays/observed_holiday_base.py (1)
  • ObservedHolidayBase (102-246)
holidays/holiday_base.py (2)
  • get (946-969)
  • _add_holiday (797-809)
tests/financial/test_india_stock_exchange.py (2)
tests/common.py (7)
  • TestCase (28-338)
  • CommonFinancialTests (377-382)
  • assertAliases (121-130)
  • assertNoHolidays (292-294)
  • assertHolidayName (195-199)
  • assertHolidays (228-230)
  • assertLocalizedHolidays (327-338)
holidays/financial/national_stock_exchange_of_india.py (3)
  • NSE (247-250)
  • XNSE (253-256)
  • NationalStockExchangeOfIndia (54-244)
🔇 Additional comments (3)
holidays/financial/national_stock_exchange_of_india.py (3)

241-244: Helper reads cleanly and returns None when no date is defined. LGTM.

No issues.


247-256: Public aliases (NSE/XNSE) look correct and minimal.

Matches registry expectations.


14-14: Drop gettext import and tr() at call sites; rely on HolidayBase translation.

The library already translates inside _add_holiday via self.tr(name). The current usage risks double-translation and using the wrong gettext domain. Keep raw msgids in code and let HolidayBase handle localization at runtime.

Apply:

-from gettext import gettext as tr
@@
-    # %s (observed).
-    observed_label = tr("%s (observed)")
+    # %s (observed).
+    observed_label = "%s (observed)"
@@
-        # Bakri Id
-        self._get_holiday(tr("Bakri Id"), BAKRI_ID, self._year)
+        # Bakri Id.
+        self._get_holiday("Bakri Id", BAKRI_ID, self._year)
@@
-        # Christmas Day
-        self._get_holiday(tr("Christmas Day"), CHRISTMAS_DAY, self._year)
+        # Christmas Day.
+        self._get_holiday("Christmas Day", CHRISTMAS_DAY, self._year)
@@
-        # Diwali Balipratipada
-        self._get_holiday(tr("Diwali Balipratipada"), DIWALI_BALIPRATIPADA, self._year)
+        # Diwali Balipratipada.
+        self._get_holiday("Diwali Balipratipāda", DIWALI_BALIPRATIPADA, self._year)
@@
-        # Diwali Laxmi Pujan
-        self._get_holiday(tr("Diwali Laxmi Pujan"), DIWALI_LAXMI_PUJAN, self._year)
+        # Diwali Lakshmi Puja.
+        self._get_holiday("Diwali Lakshmi Puja", DIWALI_LAXMI_PUJAN, self._year)
@@
-        # Dussehra
-        self._get_holiday(tr("Dussehra"), DUSSEHRA, self._year)
+        # Dussehra.
+        self._get_holiday("Dussehra", DUSSEHRA, self._year)
@@
-        # Dr. Baba Saheb Ambedkar Jayanti
-        self._get_holiday(
-            tr("Dr. Baba Saheb Ambedkar Jayanti"), DR_BABA_SAHEB_AMBEDKAR_JAYANTI, self._year
-        )
+        # Dr. Babasaheb Ambedkar Jayanti.
+        self._get_holiday(
+            "Dr. Babasaheb Ambedkar Jayanti", DR_BABA_SAHEB_AMBEDKAR_JAYANTI, self._year
+        )
@@
-        # Ganesh Chaturthi
-        self._get_holiday(tr("Ganesh Chaturthi"), GANESH_CHATURTHI, self._year)
+        # Ganesh Chaturthi.
+        self._get_holiday("Ganesh Chaturthi", GANESH_CHATURTHI, self._year)
@@
-        # Good Friday
-        self._get_holiday(tr("Good Friday"), GOOD_FRIDAY, self._year)
+        # Good Friday.
+        self._get_holiday("Good Friday", GOOD_FRIDAY, self._year)
@@
-        # Guru Nanak Jayanti
-        self._get_holiday(tr("Guru Nanak Jayanti"), GURU_NANAK_JAYANTI, self._year)
+        # Guru Nanak Jayanti.
+        self._get_holiday("Guru Nanak Jayanti", GURU_NANAK_JAYANTI, self._year)
@@
-        # Holi
-        self._get_holiday(tr("Holi"), HOLI, self._year)
+        # Holi.
+        self._get_holiday("Holi", HOLI, self._year)
@@
-        # Id Ul Fitr (Ramadan Eid)
-        self._get_holiday(tr("Id-Ul-Fitr (Ramadan Eid)"), ID_UL_FITR, self._year)
+        # Id-ul-Fitr.
+        self._get_holiday("Id-ul-Fitr", ID_UL_FITR, self._year)
@@
-        # Independence Day
-        self._get_holiday(tr("Independence Day"), INDEPENDENCE_DAY, self._year)
+        # Independence Day.
+        self._get_holiday("Independence Day", INDEPENDENCE_DAY, self._year)
@@
-        # Maharashtra Day
-        self._get_holiday(tr("Maharashtra Day"), MAHARASHTRA_DAY, self._year)
+        # Maharashtra Day.
+        self._get_holiday("Maharashtra Day", MAHARASHTRA_DAY, self._year)
@@
-        # Maha Shivaratri
-        self._get_holiday(tr("Maha Shivaratri"), MAHA_SHIVARATRI, self._year)
+        # Maha Shivaratri.
+        self._get_holiday("Maha Shivaratri", MAHA_SHIVARATRI, self._year)
@@
-        # Mahatma Gandhi Jayanti
-        self._get_holiday(tr("Mahatma Gandhi Jayanti"), MAHATMA_GANDHI_JAYANTI, self._year)
+        # Mahatma Gandhi Jayanti.
+        self._get_holiday("Mahatma Gandhi Jayanti", MAHATMA_GANDHI_JAYANTI, self._year)
@@
-        # Mahavir Jayanti
-        self._get_holiday(tr("Mahavir Jayanti"), MAHAVIR_JAYANTI, self._year)
+        # Mahavir Jayanti.
+        self._get_holiday("Mahavir Jayanti", MAHAVIR_JAYANTI, self._year)
@@
-        # Muharram
-        self._get_holiday(tr("Muharram"), MUHARRAM, self._year)
+        # Muharram.
+        self._get_holiday("Muharram", MUHARRAM, self._year)
@@
-        # Ram Navami
-        self._get_holiday(tr("Ram Navami"), RAM_NAVAMI, self._year)
+        # Ram Navami.
+        self._get_holiday("Ram Navami", RAM_NAVAMI, self._year)
@@
-        # Republic Day
-        self._get_holiday(tr("Republic Day"), REPUBLIC_DAY, self._year)
+        # Republic Day.
+        self._get_holiday("Republic Day", REPUBLIC_DAY, self._year)

Follow-ups:

  • Run: make l10n && make snapshot && pytest -k XNSE
  • Update PO msgids if you adopt the spelling changes (“Babasaheb”, “Id-ul-Fitr”, “Lakshmi Puja”, and optional macron in “Balipratipāda”). If you prefer ASCII only, keep “Balipratipada”.

Also applies to: 71-71, 182-240

⛔ Skipped due to learnings
Learnt from: PPsyrius
PR: vacanza/holidays#2843
File: holidays/countries/burundi.py:13-13
Timestamp: 2025-08-21T04:51:16.392Z
Learning: In the holidays library, country classes with localization support consistently use `from gettext import gettext as tr` import and wrap class-level attributes like `estimated_label`, `observed_label`, and `observed_estimated_label` with `tr()` calls. This is the standard library-wide practice for l10n-enabled entities and is required for proper string extraction when generating .po files.
Learnt from: PPsyrius
PR: vacanza/holidays#2843
File: holidays/countries/burundi.py:63-101
Timestamp: 2025-08-21T04:56:03.711Z
Learning: In the holidays library, countries with localization support consistently use tr() wrappers around holiday names when calling _add_* methods (e.g., self._add_new_years_day(tr("Holiday Name"))). This is the established pattern across United States, Thailand, and other l10n-enabled countries, contrary to any suggestion that translation is handled internally by _add_* methods.
Learnt from: PPsyrius
PR: vacanza/holidays#2843
File: holidays/countries/burundi.py:63-101
Timestamp: 2025-08-21T04:56:03.711Z
Learning: In the holidays library, countries with localization support DO use tr() wrappers around holiday names when calling _add_* methods. This is the correct pattern for l10n-enabled country implementations, contrary to previous learning about translation being handled internally by _add_* methods.
Learnt from: KJhellico
PR: vacanza/holidays#2635
File: holidays/countries/bhutan.py:13-16
Timestamp: 2025-06-16T14:08:09.492Z
Learning: In the holidays library, translation is performed in the `_add_holiday` methods, not at the string level. Holiday strings passed to `_add_holiday_*` methods are processed through the translation machinery within those methods, so using `tr()` or `self.tr()` wrappers is unnecessary.
Learnt from: KJhellico
PR: vacanza/holidays#2651
File: holidays/locale/nl/LC_MESSAGES/BQ.po:29-95
Timestamp: 2025-06-25T20:55:00.642Z
Learning: In the holidays library, Dutch locale files (.po) with `X-Source-Language: nl` should have empty msgstr entries when the target language is also Dutch. The library uses fallback=True with gettext, which returns the original msgid when msgstr is empty. This is the correct pattern for native language files and does not cause blank holiday names.
Learnt from: Wasif-Shahzad
PR: vacanza/holidays#2409
File: holidays/countries/qatar.py:27-46
Timestamp: 2025-04-03T16:58:27.175Z
Learning: In the holidays library, method names like `_add_holiday_2nd_tue_of_feb()` and `_add_holiday_1st_sun_of_mar()` use calendar constants internally through parent class implementations even when these constants don't appear directly in the file. Removing imports that seem unused based on a simple text search could break functionality.
Learnt from: KJhellico
PR: vacanza/holidays#2259
File: holidays/locale/en_IN/LC_MESSAGES/IN.po:285-299
Timestamp: 2025-03-08T11:28:48.652Z
Learning: In the holidays project, message IDs (msgids) in locale files use region-specific naming conventions (e.g., "Muharram", "Id-ul-Fitr" in en_IN locale for India), while translator comments use internationally recognized names from the project's default locale (en_US) such as "Ashura", "Eid al-Fitr". This difference is intentional for proper localization.
Learnt from: PPsyrius
PR: vacanza/holidays#2537
File: holidays/countries/finland.py:195-199
Timestamp: 2025-05-09T18:34:33.990Z
Learning: In the holidays library, localization (l10n) is handled through separate .po files for different languages rather than combining multiple translations in a single string. The code should use the default language with tr() function, and translations are provided in language-specific .po files.
Learnt from: PPsyrius
PR: vacanza/holidays#2537
File: holidays/countries/finland.py:249-253
Timestamp: 2025-05-10T04:02:13.815Z
Learning: Holiday name comments directly above tr() function calls in the holidays package should only contain the holiday name itself (e.g., "# Independence Day.") without any additional context, dates, or historical information.
Learnt from: KJhellico
PR: vacanza/holidays#2530
File: holidays/countries/andorra.py:13-14
Timestamp: 2025-05-06T15:29:31.893Z
Learning: In this codebase, `tr` imported as `from gettext import gettext as tr` is used as a message marker for extracting translatable strings when generating .po files, not just for runtime translation.

@saheelsapovadia
Copy link
Contributor Author

@PPsyrius , can review the PR? thanks.

Copy link
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.

Last one 👍

@KJhellico
Copy link
Collaborator

Snapshot needs to be updated, and all looks good.

only year 2023, 2024 & 2025 are added for now. I am waiting for confirmation on the approach. Once approach is approved will add more years for NSE.

It's going to be a separate PR, right?

@saheelsapovadia
Copy link
Contributor Author

Snapshot needs to be updated, and all looks good.

only year 2023, 2024 & 2025 are added for now. I am waiting for confirmation on the approach. Once approach is approved will add more years for NSE.

It's going to be a separate PR, right?

Yes, I think most of the holidays have got covered from 2001 till ~2036.
Still will add more years and exceptions of holidays with references in seperate PR.

Copy link
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.

Please run make snapshot again to update snapshots/financial/XNSE.json

@saheelsapovadia
Copy link
Contributor Author

Please run make snapshot again to update snapshots/financial/XNSE.json

updated the snapshot file.

PPsyrius
PPsyrius previously approved these changes Aug 30, 2025
Copy link
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 🇮🇳

KJhellico
KJhellico previously approved these changes Aug 30, 2025
Copy link
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! 👍

@arkid15r arkid15r dismissed stale reviews from KJhellico and PPsyrius via b5452a7 August 30, 2025 19:16
Copy link

Copy link
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: 2

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between ca76cb0 and b5452a7.

📒 Files selected for processing (1)
  • holidays/registry.py (1 hunks)
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: KJhellico
PR: vacanza/holidays#2834
File: holidays/financial/national_stock_exchange_of_india.py:38-44
Timestamp: 2025-08-26T20:10:05.288Z
Learning: For National Stock Exchange of India (NSE) holidays implementation, only `estimated_label = tr("%s (estimated)")` is needed for localization support. The `observed_label` and `observed_estimated_label` are not required for this financial market holidays implementation.
📚 Learning: 2025-07-14T19:32:44.256Z
Learnt from: PPsyrius
PR: vacanza/holidays#2716
File: holidays/registry.py:164-164
Timestamp: 2025-07-14T19:32:44.256Z
Learning: The COUNTRIES dictionary in holidays/registry.py contains exactly 215 entries as of PR #2716, with FINANCIAL dictionary entries (4 total) being tracked separately and not included in the country count for README.md.

Applied to files:

  • holidays/registry.py
📚 Learning: 2025-08-08T10:33:55.695Z
Learnt from: KJhellico
PR: vacanza/holidays#2763
File: README.md:108-110
Timestamp: 2025-08-08T10:33:55.695Z
Learning: When verifying the country total in holidays/registry.py, isolate between '^COUNTRIES:' and '^FINANCIAL:' and count only lines matching the strict key pattern '^\s*"[a-z0-9_ ]+":\s*\(' to avoid overcounting non-entry quoted lines. As of PR vacanza/holidays#2763, this yields 227 entries.

Applied to files:

  • holidays/registry.py

@saheelsapovadia
Copy link
Contributor Author

I see the reviews were dismissed, is there anything further required?
@arkid15r
@KJhellico @PPsyrius

@arkid15r arkid15r enabled auto-merge August 30, 2025 19:33
@arkid15r
Copy link
Collaborator

I see the reviews were dismissed, is there anything further required? @arkid15r @KJhellico @PPsyrius

This is an automatic dismissal due to some new changes in the PR.

Copy link
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.

Great work @saheelsapovadia 👍

@arkid15r arkid15r added this pull request to the merge queue Aug 30, 2025
Merged via the queue into vacanza:dev with commit 53770ab Aug 30, 2025
36 checks passed
@saheelsapovadia
Copy link
Contributor Author

Great work @saheelsapovadia 👍

Thank you @arkid15r .
Thanks @PPsyrius @KJhellico for guiding me.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add new market holidays for NSE and BSE Indian stock exchanges

4 participants

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载