Update Malaysia holidays: add 2026 public holidays#3140
Update Malaysia holidays: add 2026 public holidays#3140arkid15r merged 6 commits intovacanza:devfrom
Conversation
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings. WalkthroughUpdates Malaysia holiday data and tests: adds/extends 2026 dates across Buddhist, Chinese, Hindu, and Islamic calendars; removes many "(estimated)" labels in snapshots; renames and adds public holiday constants (16 special slots + observed variants); updates locale translations; and refactors tests and test infra to support subdivision-level special flags and dynamic year ranges. Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes
Focus review on:
Possibly related PRs
Suggested reviewers
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro 📒 Files selected for processing (2)
🧰 Additional context used🧠 Learnings (53)📓 Common learnings📚 Learning: 2025-04-03T05:59:57.480ZApplied to files:
📚 Learning: 2025-03-29T15:15:05.919ZApplied to files:
📚 Learning: 2025-06-24T17:26:17.728ZApplied to files:
📚 Learning: 2025-06-19T02:34:18.382ZApplied to files:
📚 Learning: 2025-09-28T05:42:12.777ZApplied to files:
📚 Learning: 2025-09-18T00:32:25.031ZApplied to files:
📚 Learning: 2025-06-19T02:34:14.456ZApplied to files:
📚 Learning: 2025-08-25T09:57:22.291ZApplied to files:
📚 Learning: 2025-08-19T21:22:13.125ZApplied to files:
📚 Learning: 2025-03-19T16:53:00.375ZApplied to files:
📚 Learning: 2025-07-14T20:23:48.198ZApplied to files:
📚 Learning: 2025-07-10T03:36:16.461ZApplied to files:
📚 Learning: 2025-03-19T16:54:58.657ZApplied to files:
📚 Learning: 2025-09-17T15:16:16.192ZApplied to files:
📚 Learning: 2025-09-17T15:15:24.269ZApplied to files:
📚 Learning: 2025-09-14T04:44:28.854ZApplied to files:
📚 Learning: 2025-07-10T03:36:16.461ZApplied to files:
📚 Learning: 2025-04-13T19:10:31.502ZApplied to files:
📚 Learning: 2025-04-13T20:41:56.613ZApplied to files:
📚 Learning: 2025-05-06T13:01:22.693ZApplied to files:
📚 Learning: 2025-08-25T09:57:22.291ZApplied to files:
📚 Learning: 2025-09-10T03:46:34.523ZApplied to files:
📚 Learning: 2025-08-15T19:16:14.119ZApplied to files:
📚 Learning: 2025-10-28T17:26:45.090ZApplied to files:
📚 Learning: 2025-11-08T04:57:36.307ZApplied to files:
📚 Learning: 2025-11-08T04:57:50.267ZApplied to files:
📚 Learning: 2025-06-16T12:28:31.641ZApplied to files:
📚 Learning: 2025-09-14T06:39:08.485ZApplied to files:
📚 Learning: 2025-06-10T12:43:10.577ZApplied to files:
📚 Learning: 2025-04-23T09:59:19.886ZApplied to files:
📚 Learning: 2025-06-14T11:04:24.104ZApplied to files:
📚 Learning: 2025-03-05T02:35:03.298ZApplied to files:
📚 Learning: 2025-03-04T11:41:56.389ZApplied to files:
📚 Learning: 2025-08-30T15:27:54.643ZApplied to files:
📚 Learning: 2025-08-30T22:55:34.525ZApplied to files:
📚 Learning: 2025-08-25T10:51:08.068ZApplied to files:
📚 Learning: 2025-09-16T04:16:10.671ZApplied to files:
📚 Learning: 2025-08-30T15:30:41.037ZApplied to files:
📚 Learning: 2025-06-14T20:12:37.212ZApplied to files:
📚 Learning: 2025-10-03T17:46:23.800ZApplied to files:
📚 Learning: 2025-09-14T16:05:55.205ZApplied to files:
📚 Learning: 2025-04-04T10:52:41.546ZApplied to files:
📚 Learning: 2025-04-04T10:52:41.546ZApplied to files:
📚 Learning: 2025-09-14T16:03:13.558ZApplied to files:
📚 Learning: 2025-08-21T05:56:33.276ZApplied to files:
📚 Learning: 2025-08-21T04:56:03.780ZApplied to files:
📚 Learning: 2025-09-18T07:01:12.236ZApplied to files:
📚 Learning: 2025-05-10T04:02:13.815ZApplied to files:
📚 Learning: 2025-03-04T11:32:45.095ZApplied to files:
📚 Learning: 2025-09-14T04:41:10.139ZApplied to files:
📚 Learning: 2025-03-04T11:32:45.095ZApplied to files:
📚 Learning: 2025-12-15T22:50:33.654ZApplied to files:
🧬 Code graph analysis (1)holidays/countries/malaysia.py (1)
🪛 Ruff (0.14.8)holidays/countries/malaysia.py836-841: Mutable class attributes should be annotated with (RUF012) 842-844: Mutable class attributes should be annotated with (RUF012) 846-851: Mutable class attributes should be annotated with (RUF012) 852-854: Mutable class attributes should be annotated with (RUF012) 856-861: Mutable class attributes should be annotated with (RUF012) 862-864: Mutable class attributes should be annotated with (RUF012) 866-871: Mutable class attributes should be annotated with (RUF012) 872-874: Mutable class attributes should be annotated with (RUF012) 876-881: Mutable class attributes should be annotated with (RUF012) 882-884: Mutable class attributes should be annotated with (RUF012) 886-891: Mutable class attributes should be annotated with (RUF012) 892-894: Mutable class attributes should be annotated with (RUF012) 896-901: Mutable class attributes should be annotated with (RUF012) 902-904: Mutable class attributes should be annotated with (RUF012) 906-911: Mutable class attributes should be annotated with (RUF012) 912-914: Mutable class attributes should be annotated with (RUF012) 916-921: Mutable class attributes should be annotated with (RUF012) 922-924: Mutable class attributes should be annotated with (RUF012) 926-931: Mutable class attributes should be annotated with (RUF012) 932-934: Mutable class attributes should be annotated with (RUF012) 936-941: Mutable class attributes should be annotated with (RUF012) 942-946: Mutable class attributes should be annotated with (RUF012) 948-950: Mutable class attributes should be annotated with (RUF012) 952-957: Mutable class attributes should be annotated with (RUF012) 958-960: Mutable class attributes should be annotated with (RUF012) 962-968: Mutable class attributes should be annotated with (RUF012) 969-971: Mutable class attributes should be annotated with (RUF012) 973-979: Mutable class attributes should be annotated with (RUF012) 980-982: Mutable class attributes should be annotated with (RUF012) 984-990: Mutable class attributes should be annotated with (RUF012) ⏰ Context from checks skipped due to timeout of 300000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
🔇 Additional comments (8)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #3140 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 306 306
Lines 18231 18237 +6
Branches 2323 2323
=========================================
+ Hits 18231 18237 +6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
holidays/countries/malaysia.py (1)
804-839: Renaming election constants and centralizing “Additional holiday” text looks reasonable, but double‑check external usageMoving to:
general_election_additional_holiday = tr("Cuti Peristiwa (pilihan raya umum)")additional_holiday = tr("Cuti Peristiwa")and wiring these into
special_public_holidays(1999, 2018, 2022, 2023, 2025) matches the English snapshot labels and improves reuse of the Malay strings.Because these attributes are on a public class, it’s worth confirming there are no external consumers still expecting the old names (e.g.,
election_polling_dayorelection_additional_holiday), but within this repo all internal references appear updated and consistent with the new snapshot content.tests/countries/test_malaysia.py (1)
388-558: Manualyears_foundcoverage checks are appropriate; Ruff PT009 is optionalFor Isra and Mi'raj, Beginning of Ramadan, Arafat Day, Eid al‑Fitr third day, Nuzul al‑Quran, and Eid al‑Adha second day:
- The
years_found = {dt.year for dt in holidays.get_named(..., lookup="startswith")}plus subset / disjoint checks give precise control over per‑subdivision year coverage when no dedicated “no‑estimated” helper exists yet.- These mirror the intentional Indonesia tests pattern for Lunar New Year and Vesak.
Ruff’s PT009 suggestion to replace
self.assertTrue(...)/self.assertFalse(...)with bareasserthere is purely stylistic; keeping unittest‑style asserts is fine if the repo isn’t standardizing on bare asserts.If you do want to satisfy PT009, you can mechanically convert these e.g.:
- self.assertTrue(set(self.full_range).issubset(years_found)) + assert set(self.full_range).issubset(years_found)across the affected blocks.
There was a problem hiding this comment.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
holidays/countries/malaysia.py (1)
707-721: Add 2025 and fix 2026 entries in HARI_HOL_JOHOR_DATES.The test expects
2025-07-31, and the dictionary jumps from 2024 to 2026. Additionally, 2026 should be July 21, not July 20.+ 2025: (JUL, 31), - 2026: (JUL, 20), + 2026: (JUL, 21),
♻️ Duplicate comments (1)
holidays/countries/malaysia.py (1)
837-994: Per-subdivision special holidays follow established patterns.The
special_XX_public_holidaysandspecial_XX_public_holidays_observeddicts use the standard tuple shapes (flat for single entries, tuple-of-tuples for multiples). This matches theStaticHolidaysconvention.Ruff's RUF012 warnings about
ClassVarare valid but optional per project style. The existingspecial_public_holidaysin the same class doesn't useClassVareither.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (3)
holidays/countries/malaysia.py(13 hunks)tests/common.py(6 hunks)tests/countries/test_malaysia.py(40 hunks)
🧰 Additional context used
🧠 Learnings (88)
📓 Common learnings
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2881
File: tests/countries/test_indonesia.py:221-223
Timestamp: 2025-09-28T05:42:12.777Z
Learning: In tests/countries/test_indonesia.py, the manual set inclusion checks using get_named and years_found for Lunar New Year (test_lunar_new_year) and Vesak Day (test_vesak_day) are intentional and should remain until both holidays get their own `{insert}_no_estimated` flags implemented, rather than using standard harness assertions like assertHolidayName/assertNoHolidayName.
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2881
File: tests/countries/test_french_polynesia.py:19-22
Timestamp: 2025-11-08T05:09:56.159Z
Learning: In the vacanza/holidays project's test framework (PR #2881 onwards), the base class CommonCountryTests provides a default test_no_holidays implementation that automatically tests years=start_year - 1 for standard PUBLIC category cases. Individual country test files should only override test_no_holidays when the country supports additional non-PUBLIC categories (GOVERNMENT, WORKDAY, OPTIONAL, etc.) with different start years requiring separate validation.
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2881
File: holidays/countries/south_africa.py:69-75
Timestamp: 2025-09-14T07:26:25.431Z
Learning: When reviewing historical holiday implementations in the vacanza/holidays repository, trust the maintainers' research and implementation decisions for specific historical edge cases, especially when they can provide sources like Wikipedia or other historical documentation that supports unusual or complex date calculation rules during specific time periods.
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 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.
Learnt from: KJhellico
Repo: vacanza/holidays PR: 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.
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 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: PPsyrius
Repo: vacanza/holidays PR: 2881
File: tests/countries/test_argentina.py:375-375
Timestamp: 2025-09-03T16:49:35.246Z
Learning: In the holidays library, national holiday tests use self.full_range (or similar comprehensive year ranges) even when explicit test dates only show modern observance. This is intentional for correctness and comprehensive coverage, unlike subdivision-specific holidays which have explicit year boundaries based on known start dates.
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 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.
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 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.
Learnt from: KJhellico
Repo: vacanza/holidays PR: 2532
File: tests/countries/test_cocos_islands.py:78-89
Timestamp: 2025-05-12T15:31:58.079Z
Learning: In the holidays project, tests for movable holidays (like Easter Monday) should always use static date sets only, not calculation functions.
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2323
File: holidays/countries/macau.py:278-377
Timestamp: 2025-03-05T02:35:03.298Z
Learning: For Macau holiday implementations, it's preferable to maintain separate methods for different holiday categories (MANDATORY, GOVERNMENT, PUBLIC) as they are based on different sets of laws, making the code easier to maintain despite having multiple year-based conditionals.
📚 Learning: 2025-09-28T05:42:12.777Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2881
File: tests/countries/test_indonesia.py:221-223
Timestamp: 2025-09-28T05:42:12.777Z
Learning: In tests/countries/test_indonesia.py, the manual set inclusion checks using get_named and years_found for Lunar New Year (test_lunar_new_year) and Vesak Day (test_vesak_day) are intentional and should remain until both holidays get their own `{insert}_no_estimated` flags implemented, rather than using standard harness assertions like assertHolidayName/assertNoHolidayName.
Applied to files:
tests/countries/test_malaysia.pyholidays/countries/malaysia.pytests/common.py
📚 Learning: 2025-05-06T21:07:11.577Z
Learnt from: KJhellico
Repo: vacanza/holidays PR: 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/countries/test_malaysia.pyholidays/countries/malaysia.py
📚 Learning: 2025-11-08T05:09:56.159Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2881
File: tests/countries/test_french_polynesia.py:19-22
Timestamp: 2025-11-08T05:09:56.159Z
Learning: In the vacanza/holidays project's test framework (PR #2881 onwards), the base class CommonCountryTests provides a default test_no_holidays implementation that automatically tests years=start_year - 1 for standard PUBLIC category cases. Individual country test files should only override test_no_holidays when the country supports additional non-PUBLIC categories (GOVERNMENT, WORKDAY, OPTIONAL, etc.) with different start years requiring separate validation.
Applied to files:
tests/countries/test_malaysia.pytests/common.py
📚 Learning: 2025-04-05T06:49:06.217Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 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/countries/test_malaysia.py
📚 Learning: 2025-09-03T16:49:35.246Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2881
File: tests/countries/test_argentina.py:375-375
Timestamp: 2025-09-03T16:49:35.246Z
Learning: In the holidays library, national holiday tests use self.full_range (or similar comprehensive year ranges) even when explicit test dates only show modern observance. This is intentional for correctness and comprehensive coverage, unlike subdivision-specific holidays which have explicit year boundaries based on known start dates.
Applied to files:
tests/countries/test_malaysia.py
📚 Learning: 2025-09-14T17:17:14.387Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2881
File: tests/countries/test_saint_helena_ascension_and_tristan_da_cunha.py:209-209
Timestamp: 2025-09-14T17:17:14.387Z
Learning: In tests/countries/test_saint_helena_ascension_and_tristan_da_cunha.py, the explicit loop iteration pattern for subdivision-specific holiday checks (like Anniversary Day for TA subdivision) is intentionally preferred over using assertSubdivTa helper methods, as confirmed by PPsyrius.
Applied to files:
tests/countries/test_malaysia.pytests/common.py
📚 Learning: 2025-04-05T04:47:27.213Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 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/countries/test_malaysia.py
📚 Learning: 2025-09-14T04:41:10.139Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2881
File: tests/countries/test_south_africa.py:22-22
Timestamp: 2025-09-14T04:41:10.139Z
Learning: South Africa's observed holiday system only started in 1995, so in tests/countries/test_south_africa.py, using years_non_observed=range(1995, 2050) is intentional to limit testing to years where observed holidays actually exist, improving both correctness and performance.
Applied to files:
tests/countries/test_malaysia.pyholidays/countries/malaysia.py
📚 Learning: 2025-09-18T03:19:23.722Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2881
File: tests/countries/test_algeria.py:28-30
Timestamp: 2025-09-18T03:19:23.722Z
Learning: In the vacanza/holidays project, tests now use self.start_year and self.end_year from the TestCase class instead of country-specific aliases (like DZ.start_year) for start_year and end_year references. This approach provides the test framework with better control over test year ranges rather than being tied to specific country start years.
Applied to files:
tests/countries/test_malaysia.pytests/common.py
📚 Learning: 2025-11-28T02:24:17.418Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 3088
File: tests/countries/test_gabon.py:88-110
Timestamp: 2025-11-28T02:24:17.418Z
Learning: For Gabon's holiday implementation (tests/countries/test_gabon.py), all Islamic holiday dates are currently estimates. Therefore, the correct test pattern is to use assertIslamicNoEstimatedHolidayName for both specific known dates and the full range (e.g., test_eid_al_fitr and test_eid_al_adha), rather than using assertHolidayName for specific dates followed by assertIslamicNoEstimatedHolidayName for the range.
Applied to files:
tests/countries/test_malaysia.py
📚 Learning: 2025-09-20T04:11:45.011Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2881
File: tests/countries/test_argentina.py:1080-1082
Timestamp: 2025-09-20T04:11:45.011Z
Learning: In the vacanza/holidays project's TestCase syntactic sugar framework, assertion method names follow the pattern `assert` + `{category}` + `{flag}` + `{method}`. For example, `assertIslamicIslamicNoEstimatedHolidayName` breaks down as: assert + Islamic (category) + IslamicNoEstimated (flag) + HolidayName (method). The apparent "duplication" of "Islamic" is intentional - the first refers to the category, the second is part of the flag name.
Applied to files:
tests/countries/test_malaysia.py
📚 Learning: 2025-08-25T04:28:02.061Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2848
File: tests/countries/test_somalia.py:44-127
Timestamp: 2025-08-25T04:28:02.061Z
Learning: In the holidays library, Islamic holiday tests use `self.no_estimated_holidays = Country(years=years, islamic_show_estimated=False)` as the library-wide standard approach to simplify test cases. This pattern is intentional and preferred over testing estimated labels.
Applied to files:
tests/countries/test_malaysia.py
📚 Learning: 2025-08-22T19:06:04.303Z
Learnt from: KJhellico
Repo: vacanza/holidays PR: 2850
File: holidays/countries/christmas_island.py:75-80
Timestamp: 2025-08-22T19:06:04.303Z
Learning: Christmas Island's docstring for the `islamic_show_estimated` parameter follows the exact same format used consistently across all countries with Islamic holidays in the codebase: "Whether to add 'estimated' label to Islamic holidays name if holiday date is estimated." This is the standard, established pattern and should not be changed.
Applied to files:
tests/countries/test_malaysia.py
📚 Learning: 2025-09-14T16:03:13.558Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2881
File: tests/countries/test_barbados.py:21-23
Timestamp: 2025-09-14T16:03:13.558Z
Learning: In tests/countries/test_barbados.py, using years_non_observed=range(2000, 2024) is intentional because all observed holiday examples fall within 2001-2023, making this range appropriate for limiting testing to years where observed holidays actually exist in the test data.
Applied to files:
tests/countries/test_malaysia.pyholidays/countries/malaysia.py
📚 Learning: 2025-04-05T04:50:40.752Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 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/countries/test_malaysia.py
📚 Learning: 2025-09-14T16:05:55.205Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2881
File: tests/countries/test_iran.py:28-28
Timestamp: 2025-09-14T16:05:55.205Z
Learning: In tests/countries/test_iran.py, using years=(self.start_year - 1, 2102) in the no-holiday test is intentional because Iran uses the Persian Calendar which has specific supported year range constraints, and 2102 represents the upper limit of the Persian Calendar's supported range, not just an arbitrary far-future date.
Applied to files:
tests/countries/test_malaysia.pyholidays/countries/malaysia.py
📚 Learning: 2025-09-10T21:12:39.614Z
Learnt from: KJhellico
Repo: vacanza/holidays PR: 2854
File: tests/countries/test_sudan.py:21-25
Timestamp: 2025-09-10T21:12:39.614Z
Learning: Sudan holidays implementation does not include observed holiday logic (holidays that shift when falling on weekends), so test files for Sudan should not use years_non_observed parameter in the setUpClass method.
Applied to files:
tests/countries/test_malaysia.py
📚 Learning: 2025-09-10T16:17:30.428Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2881
File: tests/countries/test_bosnia_and_herzegovina.py:21-24
Timestamp: 2025-09-10T16:17:30.428Z
Learning: Bosnia and Herzegovina holidays implementation currently lacks a start_year attribute. In tests/countries/test_bosnia_and_herzegovina.py, using cls.full_range = range(2000, 2050) is intentional to bound assertions and setup. Do not suggest replacing it with harness default full_range until start_year is introduced.
Applied to files:
tests/countries/test_malaysia.py
📚 Learning: 2025-09-10T13:46:06.329Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2881
File: tests/countries/test_canada.py:745-747
Timestamp: 2025-09-10T13:46:06.329Z
Learning: In the vacanza/holidays test framework, assertion methods like assertNoSubdivNuOptionalHolidayName correctly accept multiple range objects as separate arguments, such as assertNoSubdivNuOptionalHolidayName(name, range(CA.start_year, 2000), range(2020, 2050)). This is the intended usage pattern and should not be "fixed" by splitting into separate calls.
Applied to files:
tests/countries/test_malaysia.py
📚 Learning: 2025-04-04T10:52:41.546Z
Learnt from: KJhellico
Repo: vacanza/holidays PR: 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/countries/test_malaysia.pyholidays/countries/malaysia.py
📚 Learning: 2025-09-17T09:07:56.459Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2881
File: tests/countries/test_paraguay.py:134-139
Timestamp: 2025-09-17T09:07:56.459Z
Learning: In the vacanza/holidays project, when testing holidays that start from a specific year (not the country's start_year), the standard pattern is to use `range(specific_year, self.end_year)` for the holiday dates and `assertNoHolidayName(name, range(self.start_year, specific_year))` for the gap period. Using `self.full_range` with year conditions like `if year >= specific_year` is not the established pattern and would be inconsistent with the codebase.
Applied to files:
tests/countries/test_malaysia.py
📚 Learning: 2025-09-03T14:05:10.592Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2881
File: tests/countries/test_aruba.py:77-79
Timestamp: 2025-09-03T14:05:10.592Z
Learning: The assertNoHolidayName helper method in the vacanza/holidays test framework accepts both individual years (scalars) and iterables of years, making calls like assertNoHolidayName(name, AW.start_year, range(2023, 2050)) valid where AW.start_year is a single integer year.
Applied to files:
tests/countries/test_malaysia.py
📚 Learning: 2025-09-17T09:07:56.459Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2881
File: tests/countries/test_paraguay.py:134-139
Timestamp: 2025-09-17T09:07:56.459Z
Learning: In the vacanza/holidays project, for holidays that start from a specific year (not the country's start_year), the standard pattern is to use `range(specific_year, self.end_year)` rather than `self.full_range` with year conditions. This maintains consistency across the codebase and clearly separates the holiday period from the pre-holiday period using `assertNoHolidayName(name, range(self.start_year, specific_year))`.
Applied to files:
tests/countries/test_malaysia.py
📚 Learning: 2025-09-14T16:23:46.707Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2881
File: tests/countries/test_botswana.py:59-59
Timestamp: 2025-09-14T16:23:46.707Z
Learning: In Botswana's holiday tests, assertNonObservedHoliday(dt) is used to verify that certain holidays (like Easter holidays) stay on their original dates regardless of the observed holiday system, which is different from assertNoNonObservedHoliday that checks for absence of non-observed holidays.
Applied to files:
tests/countries/test_malaysia.py
📚 Learning: 2025-09-14T04:44:28.854Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2881
File: tests/countries/test_indonesia.py:22-22
Timestamp: 2025-09-14T04:44:28.854Z
Learning: In Indonesia's holidays implementation, observed holidays are only available in years 2004 and 2020 due to presidential decrees, so years_non_observed=(2004, 2020) should be passed as a tuple of discrete years rather than a range.
Applied to files:
tests/countries/test_malaysia.pyholidays/countries/malaysia.py
📚 Learning: 2025-04-04T10:52:41.546Z
Learnt from: KJhellico
Repo: vacanza/holidays PR: 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 covered by the test_eid_al_fitr_day() method, which tests both regular holiday dates and the observed dates when the holiday falls on a non-working day (for years >= 2023).
Applied to files:
tests/countries/test_malaysia.pyholidays/countries/malaysia.py
📚 Learning: 2025-04-13T19:10:31.502Z
Learnt from: KJhellico
Repo: vacanza/holidays PR: 2465
File: holidays/countries/suriname.py:219-251
Timestamp: 2025-04-13T19:10:31.502Z
Learning: The `_CustomIslamicHolidays` classes in this project contain only exact verified holiday dates from reliable sources, rather than calculated or estimated future dates. This is by design to ensure accuracy, particularly for religious holidays that may follow lunar calendars or depend on local observations.
Applied to files:
tests/countries/test_malaysia.pyholidays/countries/malaysia.py
📚 Learning: 2025-09-10T13:39:34.625Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2881
File: tests/countries/test_angola.py:22-22
Timestamp: 2025-09-10T13:39:34.625Z
Learning: In the holidays project, the main testing range should always span from start_year to 2050 (or end_year if available). This applies to both the main years parameter and years_non_observed parameter in test setups to maintain consistency across all country tests.
Applied to files:
tests/countries/test_malaysia.py
📚 Learning: 2025-06-14T10:58:43.636Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2629
File: tests/countries/test_namibia.py:22-23
Timestamp: 2025-06-14T10:58:43.636Z
Learning: In the vacanza/holidays project, country test files consistently use range(start_year, 2050) which intentionally excludes 2050 and stops at 2049. This is a library-wide implementation pattern, not an off-by-one error.
Applied to files:
tests/countries/test_malaysia.py
📚 Learning: 2025-09-02T08:02:03.604Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2881
File: tests/financial/test_ice_futures_europe.py:22-22
Timestamp: 2025-09-02T08:02:03.604Z
Learning: In the vacanza/holidays project, cls.full_range should only be introduced in financial test classes when there are test methods that actually iterate over or use the full year range. For test classes like ICEFuturesEurope that only have year-specific tests (e.g., test_2021, test_2022), using the range directly in setUpClass is preferred to avoid premature abstraction.
Applied to files:
tests/countries/test_malaysia.pytests/common.py
📚 Learning: 2025-09-10T14:35:54.603Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2881
File: tests/countries/test_brazil.py:28-30
Timestamp: 2025-09-10T14:35:54.603Z
Learning: In the holidays project, the test_no_holidays method should test ALL supported_categories (via categories=CountryClass.supported_categories) rather than just the default PUBLIC category, to ensure comprehensive validation that no holidays exist before start_year across any supported category including OPTIONAL and subdivision categories.
Applied to files:
tests/countries/test_malaysia.pytests/common.py
📚 Learning: 2025-08-08T21:52:45.289Z
Learnt from: KJhellico
Repo: vacanza/holidays PR: 2763
File: holidays/groups/mandaean.py:58-69
Timestamp: 2025-08-08T21:52:45.289Z
Learning: HolidayBase in the holidays library has a default end_year = 2100 (defined as DEFAULT_END_YEAR in holidays/constants.py), which is automatically inherited by all country classes unless explicitly overridden.
Applied to files:
tests/countries/test_malaysia.py
📚 Learning: 2025-06-19T02:34:18.382Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 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/countries/malaysia.py
📚 Learning: 2025-06-19T02:34:14.456Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 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/countries/malaysia.py
📚 Learning: 2025-03-29T15:15:05.919Z
Learnt from: KJhellico
Repo: vacanza/holidays PR: 2354
File: holidays/countries/fiji.py:171-183
Timestamp: 2025-03-29T15:15:05.919Z
Learning: In the Fiji holidays implementation, the maintainers are aware of the need to extend the MAWLID_DATES dictionary beyond 2025 when future official references become available, and will do so when appropriate. No suggestions about extending this dictionary should be made in future reviews.
Applied to files:
holidays/countries/malaysia.py
📚 Learning: 2025-03-19T16:54:58.657Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 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/countries/malaysia.py
📚 Learning: 2025-09-18T00:32:25.031Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2944
File: tests/countries/test_myanmar.py:32-39
Timestamp: 2025-09-18T00:32:25.031Z
Learning: Myanmar holidays implementation uses StaticHolidays with special_public_holidays for government-declared substitutions/bridging days, not ObservedHolidayBase for weekend-to-weekday shifting. Myanmar's substituted holidays are always present and don't have observed=False functionality.
Applied to files:
holidays/countries/malaysia.py
📚 Learning: 2025-03-05T02:35:03.298Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2323
File: holidays/countries/macau.py:278-377
Timestamp: 2025-03-05T02:35:03.298Z
Learning: For Macau holiday implementations, it's preferable to maintain separate methods for different holiday categories (MANDATORY, GOVERNMENT, PUBLIC) as they are based on different sets of laws, making the code easier to maintain despite having multiple year-based conditionals.
Applied to files:
holidays/countries/malaysia.py
📚 Learning: 2025-06-06T14:40:31.932Z
Learnt from: KJhellico
Repo: vacanza/holidays PR: 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/countries/malaysia.py
📚 Learning: 2025-09-10T03:46:34.523Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2912
File: holidays/countries/philippines.py:56-56
Timestamp: 2025-09-10T03:46:34.523Z
Learning: Lawphil doesn't always immediately include the latest proclamations - verify links exist before suggesting them as alternatives to Official Gazette references for Philippines holidays.
Applied to files:
holidays/countries/malaysia.py
📚 Learning: 2025-08-15T19:16:14.119Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2821
File: holidays/countries/tanzania.py:37-83
Timestamp: 2025-08-15T19:16:14.119Z
Learning: PDF filenames in government holiday documentation may not always reflect the actual year covered in the content. The Tanzania Bank of Tanzania (BOT) 2024 public holidays document is hosted at a URL containing "2023" in the filename but contains 2024 holiday information.
Applied to files:
holidays/countries/malaysia.py
📚 Learning: 2025-10-28T17:26:45.090Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 3026
File: holidays/countries/spain.py:189-189
Timestamp: 2025-10-28T17:26:45.090Z
Learning: In the vacanza/holidays codebase, `_populate` methods (such as `_populate_public_holidays`, `_populate_subdiv_holidays`, and subdivision-specific methods like `_populate_subdiv_XX_public_holidays`) intentionally do not include return type annotations like `-> None`. This is a consistent pattern across country implementations (e.g., Germany, United States, Spain) and should not be changed even when static analysis tools like Ruff suggest adding them.
<!-- </add_learning>
Applied to files:
holidays/countries/malaysia.pytests/common.py
📚 Learning: 2025-11-08T04:57:36.307Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2881
File: tests/countries/test_cambodia.py:20-22
Timestamp: 2025-11-08T04:57:36.307Z
Learning: In the vacanza/holidays test suite, `setUpClass` methods in test files intentionally do not include return type annotations like `-> None`. This is a consistent pattern across all country test files and should not be changed, even when static analysis tools like Ruff suggest adding them.
Applied to files:
holidays/countries/malaysia.py
📚 Learning: 2025-03-19T16:53:00.375Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2354
File: holidays/countries/fiji.py:185-188
Timestamp: 2025-03-19T16:53:00.375Z
Learning: In the Fiji holidays implementation, the `special_public_holidays_observed` dictionary in `FijiStaticHolidays` is only used for exceptions to the normal observance rules, not for documenting all holidays. Only 2019's Constitution Day needed a special entry as it didn't follow the standard patterns.
Applied to files:
holidays/countries/malaysia.py
📚 Learning: 2025-11-08T04:57:50.267Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2881
File: tests/countries/test_cameroon.py:21-23
Timestamp: 2025-11-08T04:57:50.267Z
Learning: In the vacanza/holidays test suite, do not suggest adding return type annotations (such as `-> None`) to `setUpClass` class methods in test files. This is a consistent pattern across the test suite and should be maintained even when static analysis tools like Ruff suggest adding them.
Applied to files:
holidays/countries/malaysia.py
📚 Learning: 2025-06-16T12:28:31.641Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 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/countries/malaysia.py
📚 Learning: 2025-09-14T06:39:08.485Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2881
File: holidays/countries/south_africa.py:163-170
Timestamp: 2025-09-14T06:39:08.485Z
Learning: In South Africa's holidays implementation (holidays/countries/south_africa.py), the 2021 election uses the literal "Municipal elections" instead of the local_elections constant ("Local Government Elections") - this inconsistency is intentional and should not be flagged as an issue.
Applied to files:
holidays/countries/malaysia.py
📚 Learning: 2025-06-10T12:43:10.577Z
Learnt from: ankushhKapoor
Repo: vacanza/holidays PR: 2601
File: holidays/calendars/mongolian.py:1-1
Timestamp: 2025-06-10T12:43:10.577Z
Learning: The holidays project's calendar files (in holidays/calendars/) follow a consistent pattern of NOT having module-level docstrings. They only use class-level docstrings for their main classes. When reviewing calendar files, maintain this consistency and do not suggest adding module docstrings.
Applied to files:
holidays/countries/malaysia.py
📚 Learning: 2025-04-23T09:59:19.886Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2490
File: holidays/countries/ethiopia.py:45-45
Timestamp: 2025-04-23T09:59:19.886Z
Learning: For the Ethiopia holidays class, it's appropriate to add a return type hint only to the `_is_leap_year` method to match the base class implementation in `holidays/holiday_base.py`, while keeping other methods without type hints to maintain consistency with other country implementations.
Applied to files:
holidays/countries/malaysia.py
📚 Learning: 2025-06-14T11:04:24.104Z
Learnt from: KJhellico
Repo: vacanza/holidays PR: 2629
File: holidays/countries/namibia.py:70-73
Timestamp: 2025-06-14T11:04:24.104Z
Learning: In Namibia's holiday system, holidays declared by presidential proclamation under Section 1(3) of the Public Holidays Act may not automatically be subject to the Sunday-to-Monday observation rule in Section 1(2), which primarily applies to holidays listed in the Schedule. Genocide Remembrance Day (May 28) starting in 2025 is treated as a fixed commemorative date without observed day handling.
Applied to files:
holidays/countries/malaysia.py
📚 Learning: 2025-03-04T11:41:56.389Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2323
File: holidays/countries/macau.py:284-366
Timestamp: 2025-03-04T11:41:56.389Z
Learning: For Macau holidays implementation, maintaining separate methods for each holiday category (PUBLIC, MANDATORY, GOVERNMENT) is preferred because these categories are based on different sets of laws and have distinct historical evolution.
Applied to files:
holidays/countries/malaysia.py
📚 Learning: 2025-08-30T15:27:54.643Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2874
File: holidays/countries/nigeria.py:31-44
Timestamp: 2025-08-30T15:27:54.643Z
Learning: In Nigerian holiday legislation: The Public Holidays Decree 1979 is the foundational document that established official holiday names (including Oct 1). The 1984 amendment only added Workers' Day. The 2004 consolidated version maintained existing holiday names without changes. When documenting Nigerian holidays, prioritize the 1979 decree for original holiday definitions, with later documents as amendments/consolidations.
Applied to files:
holidays/countries/malaysia.py
📚 Learning: 2025-08-30T22:55:34.525Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2874
File: holidays/countries/nigeria.py:31-44
Timestamp: 2025-08-30T22:55:34.525Z
Learning: For Nigeria holiday implementation reference ordering: The current ordering with Wikipedia first, followed by official sources, follows the newer standard for the holidays library and should not be changed to put legal sources first.
Applied to files:
holidays/countries/malaysia.py
📚 Learning: 2025-08-25T10:51:08.068Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2831
File: holidays/countries/south_sudan.py:21-30
Timestamp: 2025-08-25T10:51:08.068Z
Learning: In the holidays library, references in country/market holiday implementations should be ordered as follows: Wikipedia links for the country/market holidays first, then country-specific official sources for newer implementations, then Wikipedia links for each individual non-standard holiday if any are required. Official government sources should not be placed first ahead of Wikipedia links.
Applied to files:
holidays/countries/malaysia.py
📚 Learning: 2025-09-16T04:16:10.671Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2928
File: holidays/countries/algeria.py:143-154
Timestamp: 2025-09-16T04:16:10.671Z
Learning: When reviewing holiday implementations, always verify the actual legal text or official sources before making assumptions about holiday durations. Traditional religious observance patterns do not necessarily reflect what national laws specify for public holidays.
Applied to files:
holidays/countries/malaysia.py
📚 Learning: 2025-08-30T15:30:41.037Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2874
File: holidays/countries/nigeria.py:89-92
Timestamp: 2025-08-30T15:30:41.037Z
Learning: For Nigerian holidays, the 1985 Amendment is the authoritative source for Workers' Day addition to national public holidays, superseding any earlier state-level or workday category observances.
Applied to files:
holidays/countries/malaysia.py
📚 Learning: 2025-08-25T09:57:22.291Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2833
File: holidays/countries/uganda.py:50-56
Timestamp: 2025-08-25T09:57:22.291Z
Learning: In the holidays package, when adding contextual comments about holiday establishment dates, avoid making claims about specific laws, parliamentary acts, or government decisions unless they can be verified from authoritative sources like official government legal databases, gazettes, or parliamentary records. Unverified legal claims should not be added to comments even if they seem plausible.
Applied to files:
holidays/countries/malaysia.py
📚 Learning: 2025-09-03T17:53:29.103Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2881
File: holidays/countries/algeria.py:33-40
Timestamp: 2025-09-03T17:53:29.103Z
Learning: For Algeria's holidays implementation, the Google Drive links in the legal references are the official government sources redirected from https://portailjuridique.esi.dz/français/fêtes-et-congés-légales. These should be kept as-is when properly archived via Wayback Machine, as they represent the actual official documents served by the Algerian government portal.
Applied to files:
holidays/countries/malaysia.py
📚 Learning: 2025-09-17T15:15:24.269Z
Learnt from: KJhellico
Repo: vacanza/holidays PR: 2944
File: holidays/countries/myanmar.py:112-121
Timestamp: 2025-09-17T15:15:24.269Z
Learning: The Myanmar government's "continuous public days for 2024-2025" policy specifically covers Tabaung and Tazaungmon full moon days by bridging gaps with weekends, but does not apply to Myanmar New Year (Thingyan) extra days, which follow a separate policy that correctly uses `self._year >= 2024`.
Applied to files:
holidays/countries/malaysia.py
📚 Learning: 2025-06-14T20:12:37.212Z
Learnt from: KJhellico
Repo: vacanza/holidays PR: 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/countries/malaysia.py
📚 Learning: 2025-10-03T17:46:23.800Z
Learnt from: KJhellico
Repo: vacanza/holidays PR: 2981
File: holidays/calendars/islamic.py:3987-4003
Timestamp: 2025-10-03T17:46:23.800Z
Learning: In the holidays library Islamic calendar implementation with calendar_shift feature, CONFIRMED_YEARS represents years where the base Umm al-Qura calculation plus the calendar_shift has been verified as correct, while confirmed_dates contains explicit dates that should not be shifted. Years within CONFIRMED_YEARS but not in the explicit date dictionaries will use the base Umm al-Qura algorithm with the calendar_shift applied and be marked as "confirmed" rather than "estimated".
Applied to files:
holidays/countries/malaysia.py
📚 Learning: 2025-09-17T15:16:16.192Z
Learnt from: KJhellico
Repo: vacanza/holidays PR: 2944
File: holidays/countries/myanmar.py:183-191
Timestamp: 2025-09-17T15:16:16.192Z
Learning: The special_public_holidays formatting pattern in the holidays codebase follows a consistent convention: single entries per year use flat tuple format like `2024: (MONTH, DAY, name)`, while multiple entries per year use tuple-of-tuples format like `2024: ((MONTH, DAY, name), (MONTH, DAY, name))`. This pattern is used consistently across all countries.
Applied to files:
holidays/countries/malaysia.py
📚 Learning: 2025-04-13T20:41:56.613Z
Learnt from: KJhellico
Repo: vacanza/holidays PR: 2386
File: holidays/countries/nepal.py:266-284
Timestamp: 2025-04-13T20:41:56.613Z
Learning: The Islamic holiday dates in the holidays library should only include officially verified dates, not predicted ones, to maintain accuracy. This is especially important for holidays that depend on lunar observations like Eid al-Fitr and Eid al-Adha.
Applied to files:
holidays/countries/malaysia.py
📚 Learning: 2025-05-06T13:01:22.693Z
Learnt from: Wasif-Shahzad
Repo: vacanza/holidays PR: 2522
File: holidays/countries/yemen.py:158-163
Timestamp: 2025-05-06T13:01:22.693Z
Learning: In the holidays library, the RAMADAN_BEGINNING_DATES dictionary in country-specific Islamic holiday classes (like YemenIslamicHolidays) is used indirectly through the backend. When a country class calls _add_holiday_29_ramadan(), the IslamicHolidays implementation uses the country's custom calendar dates to calculate the 29th day of Ramadan by adding 28 days to the beginning date.
Applied to files:
holidays/countries/malaysia.py
📚 Learning: 2025-07-10T03:36:16.461Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 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/countries/malaysia.py
📚 Learning: 2025-07-10T03:36:16.461Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 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/countries/malaysia.py
📚 Learning: 2025-08-21T05:56:33.276Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2843
File: holidays/countries/burundi.py:15-16
Timestamp: 2025-08-21T05:56:33.276Z
Learning: In the holidays library, when importing Gregorian month constants from holidays.calendars.gregorian, only import the months that are actually used in the date data. For example, if Islamic holiday dates only reference JUN, JUL, SEP, OCT, then only import those specific constants rather than importing additional unused months.
Applied to files:
holidays/countries/malaysia.py
📚 Learning: 2025-08-21T04:56:03.780Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2843
File: holidays/countries/burundi.py:63-101
Timestamp: 2025-08-21T04:56:03.780Z
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/countries/malaysia.py
📚 Learning: 2025-09-18T07:01:12.236Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2942
File: holidays/countries/south_africa.py:91-98
Timestamp: 2025-09-18T07:01:12.236Z
Learning: In the holidays library South Africa implementation, inline ternary operators for holiday name selection (like "Republic Day" if self._year >= 1961 else "Union Day") are intentionally kept inline rather than extracted to separate variables, as this structure is designed in preparation for future localization (l10n) support where the contextual relationship between conditions and translatable strings needs to be preserved.
Applied to files:
holidays/countries/malaysia.py
📚 Learning: 2025-07-14T20:23:48.198Z
Learnt from: KJhellico
Repo: vacanza/holidays PR: 2654
File: holidays/countries/cabo_verde.py:133-141
Timestamp: 2025-07-14T20:23:48.198Z
Learning: The holidays library provides helper methods `_add_holiday_2nd_sun_of_may()` and `_add_holiday_3rd_sun_of_jun()` for adding holidays on the 2nd Sunday of May and 3rd Sunday of June respectively. These methods are used across multiple country implementations including Latvia, Finland, Belarus, Malaysia, Madagascar, and Cape Verde.
Applied to files:
holidays/countries/malaysia.py
📚 Learning: 2025-05-10T04:02:13.815Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 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/countries/malaysia.py
📚 Learning: 2025-03-04T11:32:45.095Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2323
File: holidays/countries/macau.py:407-461
Timestamp: 2025-03-04T11:32:45.095Z
Learning: In the holidays library, the standard approach for organizing static holidays is to use separate dictionaries for different categories (like `special_government_holidays`, `special_mandatory_holidays`, and `special_public_holidays`), which are utilized by syntactic sugar methods to pick up the appropriate holidays based on the selected category.
Applied to files:
holidays/countries/malaysia.pytests/common.py
📚 Learning: 2025-03-04T11:32:45.095Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2323
File: holidays/countries/macau.py:407-461
Timestamp: 2025-03-04T11:32:45.095Z
Learning: In the holidays library, the standard approach for organizing static holidays is to use separate dictionaries for different categories (`government`, `mandatory`, and `public`), which are utilized by syntactic sugar methods.
Applied to files:
holidays/countries/malaysia.pytests/common.py
📚 Learning: 2025-12-15T22:50:33.654Z
Learnt from: KJhellico
Repo: vacanza/holidays PR: 3135
File: holidays/countries/united_states.py:1175-1178
Timestamp: 2025-12-15T22:50:33.654Z
Learning: In the holidays library (vacanza/holidays), for Puerto Rico and potentially other US territories, maintain the documented separation: place Spanish holiday name comments on one line, followed by a blank line, and then the English localization comment. Do not remove the blank line separator, as it documents the Spanish name (e.g., 'Día de la Abolición de la Esclavitud') while the English name below (e.g., 'Emancipation Day') is the actual localization.
Applied to files:
holidays/countries/malaysia.py
📚 Learning: 2025-06-18T10:58:28.058Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2642
File: holidays/countries/france.py:184-206
Timestamp: 2025-06-18T10:58:28.058Z
Learning: In the holidays library France implementation, creating shared private methods between subdivision-specific holiday population methods (like _populate_subdiv_57_public_holidays and _populate_subdiv_6ae_public_holidays) is not supported by the current framework architecture, so duplicate code between functionally identical subdivision methods should be left as-is.
Applied to files:
tests/common.py
📚 Learning: 2025-06-18T10:07:58.780Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2642
File: holidays/countries/french_southern_territories.py:41-44
Timestamp: 2025-06-18T10:07:58.780Z
Learning: Territorial holiday classes that inherit from parent countries (like HolidaysAX from Finland, HolidaysSJ from Norway, HolidaysTF from France) follow a standard pattern of silently overriding self.subdiv in their _populate_public_holidays() method without validation, as this ensures they always use the correct subdivision code for their territory regardless of user input.
Applied to files:
tests/common.py
📚 Learning: 2025-09-20T12:24:28.864Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2881
File: tests/countries/test_curacao.py:29-29
Timestamp: 2025-09-20T12:24:28.864Z
Learning: For Curacao in the holidays library, PUBLIC and HALF_DAY categories have different start years - PUBLIC holidays begin at the country's start_year while HALF_DAY holidays begin in 2010. When testing no_holidays methods, each category should be tested separately with appropriate pre-start years rather than using a unified supported_categories approach.
Applied to files:
tests/common.py
📚 Learning: 2025-06-13T12:18:03.539Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2614
File: holidays/countries/guyana.py:78-90
Timestamp: 2025-06-13T12:18:03.539Z
Learning: The holidays codebase now uses the constructor signature pattern `__init__(self, *args, islamic_show_estimated: bool = True, **kwargs)` across country classes.
Applied to files:
tests/common.py
📚 Learning: 2025-05-04T10:29:46.780Z
Learnt from: KJhellico
Repo: vacanza/holidays PR: 2525
File: holidays/countries/togo.py:0-0
Timestamp: 2025-05-04T10:29:46.780Z
Learning: When a country class in the holidays library uses additional categories beyond PUBLIC, the `supported_categories` tuple should contain all categories, including PUBLIC. Only when PUBLIC is the only category being used should it be omitted from `supported_categories`.
Applied to files:
tests/common.py
📚 Learning: 2025-04-08T14:46:10.656Z
Learnt from: KJhellico
Repo: vacanza/holidays PR: 2437
File: holidays/countries/bhutan.py:27-30
Timestamp: 2025-04-08T14:46:10.656Z
Learning: For country classes in the holidays library, there's no need to explicitly specify `supported_categories = (PUBLIC,)` when PUBLIC is the only category being used, as it's already the default category inherited from HolidayBase.
Applied to files:
tests/common.py
📚 Learning: 2025-09-04T09:48:11.738Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2881
File: tests/countries/test_andorra.py:29-31
Timestamp: 2025-09-04T09:48:11.738Z
Learning: In the holidays library, when accessing supported_categories in test files, the library-wide standard is to use the full class name (e.g., Andorra.supported_categories) rather than aliases (e.g., AD.supported_categories), maintaining consistency across the codebase.
Applied to files:
tests/common.py
📚 Learning: 2025-09-14T16:19:23.651Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2881
File: tests/countries/test_antigua_and_barbuda.py:27-29
Timestamp: 2025-09-14T16:19:23.651Z
Learning: For Antigua and Barbuda in the holidays library, only the default PUBLIC category is used, so there's no need to specify `categories=AntiguaAndBarbuda.supported_categories` in test_no_holidays methods, as it would be equivalent to the default behavior and AntiguaAndBarbuda doesn't define supported_categories.
Applied to files:
tests/common.py
📚 Learning: 2025-09-19T10:01:41.205Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2881
File: tests/countries/test_bolivia.py:29-29
Timestamp: 2025-09-19T10:01:41.205Z
Learning: For Bolivia in the holidays library, only the default PUBLIC category is used, so there's no need to specify `categories=Bolivia.supported_categories` in test_no_holidays methods, as it would be equivalent to the default behavior and Bolivia doesn't define supported_categories.
Applied to files:
tests/common.py
📚 Learning: 2025-09-25T08:56:22.473Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2881
File: tests/countries/test_azerbaijan.py:23-24
Timestamp: 2025-09-25T08:56:22.473Z
Learning: In the vacanza/holidays project's test framework, TestCase.setUpClass is designed to handle pre-existing cls.full_range attributes. If a test class manually sets cls.full_range before calling super().setUpClass(), the framework will use cls.full_range.start and cls.full_range.stop to set start_year and end_year, then use cls.full_range as the years parameter. This allows test classes to define custom year ranges when needed while still integrating with the framework.
Applied to files:
tests/common.py
📚 Learning: 2025-06-18T17:01:58.067Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2642
File: tests/countries/test_wallis_and_futuna.py:19-23
Timestamp: 2025-06-18T17:01:58.067Z
Learning: In the vacanza/holidays repository, the standard pattern for test class setUpClass methods is `super().setUpClass(HolidayClass)` or `super().setUpClass(HolidayClass, years=...)` where HolidayClass is passed as the first argument. This is the correct signature that matches the CommonCountryTests.setUpClass method which accepts test_class as the first parameter after cls. Pylint warnings about parameter count mismatch are false positives when comparing against TestCase.setUpClass instead of the immediate parent CommonCountryTests.setUpClass.
Applied to files:
tests/common.py
📚 Learning: 2025-06-13T15:15:25.159Z
Learnt from: KJhellico
Repo: vacanza/holidays PR: 2609
File: tests/countries/test_nauru.py:20-24
Timestamp: 2025-06-13T15:15:25.159Z
Learning: In the vacanza/holidays test suite, overriding `setUpClass` is intentionally done with the single `cls` parameter (no *args/**kwargs), so signature-mismatch lint warnings are ignored project-wide.
Applied to files:
tests/common.py
📚 Learning: 2025-04-25T20:27:59.086Z
Learnt from: KJhellico
Repo: vacanza/holidays PR: 2402
File: holidays/countries/trinidad_and_tobago.py:85-92
Timestamp: 2025-04-25T20:27:59.086Z
Learning: The `_populate_observed` method in holiday classes should maintain the same signature as the parent class `ObservedHolidayBase`, even if specific child class implementations don't use all parameters.
Applied to files:
tests/common.py
🧬 Code graph analysis (2)
tests/countries/test_malaysia.py (2)
tests/common.py (1)
setUpClass(148-353)holidays/countries/malaysia.py (1)
Malaysia(61-582)
tests/common.py (2)
holidays/groups/islamic.py (1)
IslamicHolidays(20-455)holidays/holiday_base.py (1)
append(965-976)
🪛 Ruff (0.14.8)
holidays/countries/malaysia.py
837-842: Mutable class attributes should be annotated with typing.ClassVar
(RUF012)
843-845: Mutable class attributes should be annotated with typing.ClassVar
(RUF012)
847-852: Mutable class attributes should be annotated with typing.ClassVar
(RUF012)
853-855: Mutable class attributes should be annotated with typing.ClassVar
(RUF012)
857-862: Mutable class attributes should be annotated with typing.ClassVar
(RUF012)
863-865: Mutable class attributes should be annotated with typing.ClassVar
(RUF012)
867-872: Mutable class attributes should be annotated with typing.ClassVar
(RUF012)
873-875: Mutable class attributes should be annotated with typing.ClassVar
(RUF012)
877-882: Mutable class attributes should be annotated with typing.ClassVar
(RUF012)
883-885: Mutable class attributes should be annotated with typing.ClassVar
(RUF012)
887-892: Mutable class attributes should be annotated with typing.ClassVar
(RUF012)
893-895: Mutable class attributes should be annotated with typing.ClassVar
(RUF012)
897-902: Mutable class attributes should be annotated with typing.ClassVar
(RUF012)
903-905: Mutable class attributes should be annotated with typing.ClassVar
(RUF012)
907-912: Mutable class attributes should be annotated with typing.ClassVar
(RUF012)
913-915: Mutable class attributes should be annotated with typing.ClassVar
(RUF012)
917-922: Mutable class attributes should be annotated with typing.ClassVar
(RUF012)
923-925: Mutable class attributes should be annotated with typing.ClassVar
(RUF012)
927-932: Mutable class attributes should be annotated with typing.ClassVar
(RUF012)
933-935: Mutable class attributes should be annotated with typing.ClassVar
(RUF012)
937-942: Mutable class attributes should be annotated with typing.ClassVar
(RUF012)
943-947: Mutable class attributes should be annotated with typing.ClassVar
(RUF012)
949-951: Mutable class attributes should be annotated with typing.ClassVar
(RUF012)
953-958: Mutable class attributes should be annotated with typing.ClassVar
(RUF012)
959-961: Mutable class attributes should be annotated with typing.ClassVar
(RUF012)
963-969: Mutable class attributes should be annotated with typing.ClassVar
(RUF012)
970-972: Mutable class attributes should be annotated with typing.ClassVar
(RUF012)
974-980: Mutable class attributes should be annotated with typing.ClassVar
(RUF012)
981-983: Mutable class attributes should be annotated with typing.ClassVar
(RUF012)
985-991: Mutable class attributes should be annotated with typing.ClassVar
(RUF012)
tests/common.py
41-41: Missing return type annotation for staticmethod _get_or_create_lookup
(ANN205)
155-155: Missing type annotation for **year_variants
(ANN003)
⏰ Context from checks skipped due to timeout of 300000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
- GitHub Check: Test Python 3.14 on windows-latest
- GitHub Check: Test Python 3.11 on windows-latest
- GitHub Check: Test Python 3.12 on windows-latest
- GitHub Check: Test Python 3.13 on windows-latest
- GitHub Check: Test Python 3.10 on windows-latest
|



Proposed change
with_subdiv_special_flagssupport.AFAIK I can't find any info regarding Sabah's 2018 election additional holidays - if they did in fact issued them, let me know.
Resolved #3139 .
Type of change
holidaysfunctionality in general)Checklist
make checklocally; all checks and tests passed.