Skip to content

Update Thailand holidays: add 2026 Royal Ploughing Ceremony#3044

Merged
arkid15r merged 1 commit intovacanza:devfrom
PPsyrius:th_royal_ploughing_day_2026
Nov 9, 2025
Merged

Update Thailand holidays: add 2026 Royal Ploughing Ceremony#3044
arkid15r merged 1 commit intovacanza:devfrom
PPsyrius:th_royal_ploughing_day_2026

Conversation

@PPsyrius
Copy link
Copy Markdown
Collaborator

@PPsyrius PPsyrius commented Nov 8, 2025

Proposed change

  • Add 2026's Royal Ploughing Ceremony date (the source for this is already included, but I'm adding additional observance change references here should we manage to backtrack how they calculate this later for pre-1959 observances)
  • Refactor Thailand's test case for futureproofing (should make the eventual refactor post- TestCase Syntactic Sugar Support #2881 easier)

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

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Nov 8, 2025

Summary by CodeRabbit

  • New Features

    • Extended Thailand holiday calendar through 2026 with Royal Ploughing Ceremony date added.
  • Updates

    • Updated holiday naming conventions and categorization for improved consistency.

Walkthrough

This PR extends Thai holiday calendar data through 2026 by adding Royal Ploughing Ceremony dates and updates the observed-year constraint. The test suite undergoes significant refactoring to introduce per-category holiday calendars and reorganizes test methods with expanded coverage for additional holidays.

Changes

Cohort / File(s) Summary
Core holiday data
holidays/countries/thailand.py
Extended Royal Ploughing Ceremony (raeknakhwan_dates) with 2026 data, updated observed-year range from 1960–2025 to 1960–2026, and added contextual doc comment.
Holiday snapshot
snapshots/countries/TH_COMMON.json
Added new entry mapping 2026-05-13 to "Royal Ploughing Ceremony" holiday.
Test refactoring
tests/countries/test_thailand.py
Restructured test setup with per-class full_range attribute (1914–2050) and per-category Thailand instances (armed_forces_holidays, bank_holidays, government_holidays, school_holidays, workday_holidays). Reorganized and renamed numerous test methods to align with category-based approach. Expanded coverage for Thai Veterans Day, National Science Day, National Artist Day, International Women's Day, National Forest Conservation Day, Royal Ploughing Ceremony, National Aviation Day, Loy Krathong, and royal memorial days. Updated existing test methods to use asterisk unpacking for range composition.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Verification of test method renames and alignment with new naming conventions
  • Validation of per-category calendar initialization and correct years assignment
  • Spot-check new holiday test cases for date accuracy and expected assertions
  • Confirmation that existing test semantics remain consistent despite structural changes

Suggested labels

snapshot, test

Suggested reviewers

  • arkid15r
  • KJhellico

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately reflects the main change: adding Thailand's 2026 Royal Ploughing Ceremony date. It's concise and directly describes the primary purpose of the PR.
Description check ✅ Passed The description clearly relates to the changeset, detailing the addition of 2026 Royal Ploughing Ceremony date and test refactoring for futureproofing, with references to supporting documentation and issue tracking.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8283fdc and 712cf2d.

📒 Files selected for processing (3)
  • holidays/countries/thailand.py (3 hunks)
  • snapshots/countries/TH_COMMON.json (1 hunks)
  • tests/countries/test_thailand.py (17 hunks)
🧰 Additional context used
🧠 Learnings (50)
📓 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: 2951
File: tests/calendars/test_thai.py:0-0
Timestamp: 2025-09-21T05:16:38.578Z
Learning: In holidays/calendars/thai.py, the `buddhist_sabbath_dates` method in `_ThaiLunisolar` is independent of calendar type (THAI_CALENDAR vs KHMER_CALENDAR) and calculates Buddhist Sabbath dates consistently regardless of which calendar is being used.
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2881
File: tests/countries/test_french_polynesia.py:19-22
Timestamp: 2025-11-08T05:09:56.141Z
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: 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: 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
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.
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.
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2642
File: tests/countries/test_france.py:24-27
Timestamp: 2025-06-18T10:10:46.158Z
Learning: The holidays library prioritizes full test coverage over performance in test suites. Modern library-wide standards favor comprehensive testing across all subdivisions and wide year ranges (e.g., 1803-2050 for France) to ensure thorough validation, even if it creates many test objects.
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.
📚 Learning: 2025-04-03T05:59:57.480Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 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/countries/TH_COMMON.json
📚 Learning: 2025-09-21T05:16:38.578Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2951
File: tests/calendars/test_thai.py:0-0
Timestamp: 2025-09-21T05:16:38.578Z
Learning: In the Thailand holidays system, the difference between Thai and Khmer calendars is that certain holidays are observed one month later in Athikamat (Extra-Month) years for Thailand, not that the fundamental Buddhist Sabbath date calculations differ between calendar types.

Applied to files:

  • snapshots/countries/TH_COMMON.json
📚 Learning: 2025-06-24T17:26:17.728Z
Learnt from: KJhellico
Repo: vacanza/holidays PR: 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/countries/TH_COMMON.json
📚 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:

  • snapshots/countries/TH_COMMON.json
  • holidays/countries/thailand.py
  • tests/countries/test_thailand.py
📚 Learning: 2025-09-25T10:05:04.107Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2959
File: tests/countries/test_myanmar.py:398-434
Timestamp: 2025-09-25T10:05:04.107Z
Learning: In the holidays library Thai localizations, there are two distinct patterns: 1) "%s (observed)" holidays use "ชดเชย%s" format, and 2) "Day off (substituted from %s)" holidays use "วันหยุด (แทน %s)" format. These serve different purposes and should not be confused - substituted holidays are not the same as observed holidays.

Applied to files:

  • snapshots/countries/TH_COMMON.json
  • holidays/countries/thailand.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:

  • snapshots/countries/TH_COMMON.json
  • holidays/countries/thailand.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/thailand.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/thailand.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/thailand.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:

  • holidays/countries/thailand.py
  • tests/countries/test_thailand.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:

  • holidays/countries/thailand.py
  • tests/countries/test_thailand.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 comments for year-restricted holidays in Uganda and similar country modules, include specific legal or historical context such as the actual laws, parliamentary acts, or government decisions that established the holidays, rather than just generic "since YEAR" information. For example, reference the specific Parliament act, decree, or historical event that created the holiday.

Applied to files:

  • holidays/countries/thailand.py
📚 Learning: 2025-09-20T12:21:50.877Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2881
File: tests/countries/test_belgium.py:28-30
Timestamp: 2025-09-20T12:21:50.877Z
Learning: Belgium holidays implementation currently lacks a start_year attribute. In tests/countries/test_belgium.py, do not suggest adding test_no_holidays methods that rely on start_year until the start_year attribute is introduced to Belgium's holiday implementation.

Applied to files:

  • holidays/countries/thailand.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/thailand.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:

  • holidays/countries/thailand.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:

  • holidays/countries/thailand.py
  • tests/countries/test_thailand.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/thailand.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/thailand.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/thailand.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/thailand.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/thailand.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/thailand.py
📚 Learning: 2025-11-08T05:09:56.141Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2881
File: tests/countries/test_french_polynesia.py:19-22
Timestamp: 2025-11-08T05:09:56.141Z
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_thailand.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_thailand.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_thailand.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_thailand.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_thailand.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_thailand.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_thailand.py
📚 Learning: 2025-08-12T17:16:54.497Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 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/countries/test_thailand.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_thailand.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/countries/test_thailand.py
📚 Learning: 2025-04-05T04:29:38.042Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 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/countries/test_thailand.py
📚 Learning: 2025-04-05T04:33:53.254Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2416
File: tests/countries/test_turkmenistan.py:52-64
Timestamp: 2025-04-05T04:33:53.254Z
Learning: For Turkmenistan holiday tests, recommend using CommonCountryTests as the base class rather than unittest.TestCase to follow project conventions, be consistent with other country test files, and gain access to common test utilities.

Applied to files:

  • tests/countries/test_thailand.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/countries/test_thailand.py
📚 Learning: 2025-09-14T06:39:32.896Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2881
File: tests/countries/test_switzerland.py:22-23
Timestamp: 2025-09-14T06:39:32.896Z
Learning: In tests/countries/test_switzerland.py, the cls.full_range = range(1970, 2050) is intentionally hard-coded rather than using CH.start_year until a proper test case refactor is completed for Switzerland's implementation.

Applied to files:

  • tests/countries/test_thailand.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)` where HolidayClass is passed as the first argument. This is the correct signature used across all country test files.

Applied to files:

  • tests/countries/test_thailand.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_thailand.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_thailand.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_thailand.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_thailand.py
📚 Learning: 2025-07-09T21:16:35.145Z
Learnt from: KJhellico
Repo: vacanza/holidays PR: 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/countries/test_thailand.py
📚 Learning: 2025-07-24T15:21:31.632Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 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/countries/test_thailand.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_thailand.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: The method assertNonObservedHoliday(dt) is a valid assertion method in the holidays test framework that verifies holidays occur on their original (non-observed) dates, which is different from assertNoNonObservedHoliday that checks for absence of non-observed holidays. It's used to test that certain holidays stay on fixed dates regardless of observed holiday rules.

Applied to files:

  • tests/countries/test_thailand.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_thailand.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_thailand.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_thailand.py
📚 Learning: 2025-09-03T18:29:09.398Z
Learnt from: KJhellico
Repo: vacanza/holidays PR: 2820
File: tests/countries/test_saint_helena_ascension_and_tristan_da_cunha.py:76-76
Timestamp: 2025-09-03T18:29:09.398Z
Learning: The assertNoNonObservedHoliday method in tests/common.py accepts a holidays object as its first parameter, followed by the dates to check. Usage like assertNoNonObservedHoliday(self.government_holidays_non_observed, obs_dt) is correct and intended behavior.

Applied to files:

  • tests/countries/test_thailand.py
🧬 Code graph analysis (1)
tests/countries/test_thailand.py (5)
tests/countries/test_slovakia.py (1)
  • setUpClass (22-25)
tests/countries/test_switzerland.py (1)
  • setUpClass (22-42)
tests/countries/test_canada.py (1)
  • setUpClass (22-44)
holidays/countries/thailand.py (1)
  • Thailand (46-983)
tests/common.py (2)
  • assertHolidayName (198-202)
  • assertNoNonObservedHoliday (280-282)
⏰ 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). (2)
  • GitHub Check: Test docs build
  • GitHub Check: Build distribution
🔇 Additional comments (1)
tests/countries/test_thailand.py (1)

613-689: Great coverage on the Royal Ploughing Ceremony.

Appreciate the way this test now anchors the full historical series while explicitly asserting the 2026 expansion and future guardrail. This makes the annual update work much safer.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Nov 8, 2025

@codecov
Copy link
Copy Markdown

codecov bot commented Nov 8, 2025

Codecov Report

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

Additional details and impacted files
@@            Coverage Diff            @@
##               dev     #3044   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          306       306           
  Lines        17991     17991           
  Branches      2276      2276           
=========================================
  Hits         17991     17991           

☔ 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
Copy Markdown
Collaborator

@KJhellico KJhellico left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Copy Markdown
Collaborator

@arkid15r arkid15r left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@arkid15r arkid15r added this pull request to the merge queue Nov 9, 2025
Merged via the queue into vacanza:dev with commit f77b146 Nov 9, 2025
33 checks passed
@PPsyrius PPsyrius deleted the th_royal_ploughing_day_2026 branch November 9, 2025 23:23
@KJhellico KJhellico mentioned this pull request Nov 17, 2025
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.

3 participants