Skip to content

Conversation

@PPsyrius
Copy link
Collaborator

@PPsyrius PPsyrius commented Jun 25, 2025

Proposed change

  • Update Aruba, Curaçao, and the Netherlands observance code for King's/Queen's Day based on Add Sint Maarten holidays #2631 approach.
  • Update Aruba and Curaçao codebase and test case to modern library-wide standard (start year, reference sources, ...)

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
Contributor

coderabbitai bot commented Jun 25, 2025

Summary by CodeRabbit

  • New Features

    • Improved handling of observed holidays for Aruba, Curacao, and the Netherlands, including automatic shifting of holidays that fall on Sundays.
    • Added new holidays for Curacao: Whit Sunday and Kingdom Day.
    • Updated holiday date ranges and observance rules to reflect historical accuracy.
  • Localization

    • Enhanced and standardized translations for Aruba and Curacao holidays across English, Dutch, Papiamento, and Ukrainian.
    • Updated translations for new and existing holidays, including improved naming consistency.
  • Bug Fixes

    • Corrected holiday dates and observance logic for Labor Day and King's/Queen's Day.
    • Fixed and clarified year ranges for various holidays.
  • Tests

    • Expanded and refined test coverage for Aruba and Curacao holidays, including new tests for specific holidays and improved year range checks.
  • Chores

    • Updated holiday data snapshots to reflect changes in holiday dates and additions.

Summary by CodeRabbit

  • New Features

    • Improved handling of observed holidays for Aruba, Curacao, and the Netherlands, ensuring holidays falling on Sundays are automatically moved according to local rules.
    • Added new holidays for Curacao: Whit Sunday and Kingdom Day, with corresponding localizations.
    • Updated translations for Aruba and Curacao holidays in English, Dutch, Papiamento, and Ukrainian, including refined names and added holidays.
  • Bug Fixes

    • Corrected holiday start years for Aruba and Curacao to reflect historical accuracy.
    • Adjusted holiday dates and observance rules, especially for Labor Day and King's/Queen's Day.
  • Tests

    • Expanded and refined test coverage for Aruba and Curacao holidays, including more precise year ranges and new holiday assertions.
  • Documentation

    • Standardized holiday descriptions and improved reference links in comments and translations.

Walkthrough

The changes refactor Aruba, Curacao, and Netherlands holiday classes to use ObservedHolidayBase for standardized observed holiday handling, update start years, and revise holiday logic for Labor Day and King's/Queen's Day. Localization files were updated for consistency and completeness, and test suites for Aruba and Curacao were expanded and refined to cover new and adjusted holiday rules.

Changes

Files/Groups Change Summary
holidays/countries/aruba.py, holidays/countries/curacao.py, holidays/countries/netherlands.py Refactored classes to inherit from ObservedHolidayBase with default observed_rule set. Updated start years (Aruba: 1947→1955, Curacao: 1954→1955). Holiday logic for Labor Day and King's/Queen's Day refactored to use _move_holiday and helper methods replacing manual date adjustments. Comments and references standardized; unused imports removed.
holidays/locale/en_US/LC_MESSAGES/AW.po, holidays/locale/nl/LC_MESSAGES/AW.po, holidays/locale/pap_AW/LC_MESSAGES/AW.po, holidays/locale/uk/LC_MESSAGES/AW.po Aruba holiday localizations updated: metadata versions bumped, holiday comment lines standardized with trailing periods, "Labor Day" entry added or repositioned, Dutch translation for "Christmas Day" refined. No changes to exported code entities.
holidays/locale/en_US/LC_MESSAGES/CW.po, holidays/locale/nl/LC_MESSAGES/CW.po, holidays/locale/pap_CW/LC_MESSAGES/CW.po, holidays/locale/uk/LC_MESSAGES/CW.po Curacao holiday localizations updated: metadata refreshed, comments standardized, new entries for "Whit Sunday" and "Kingdom Day" added, "Labor Day" repositioned, Dutch translation for "Christmas Day" refined. No changes to exported code entities.
snapshots/countries/AW_COMMON.json Adjusted "Labor Day" date from May 1 to May 2 for most years (1955–2050); split from combined "Queen's Day" where previously merged. No new holidays added or removed; JSON structure unchanged.
snapshots/countries/CW_COMMON.json Removed all 1954 entries and "New Year's Eve" from years after 2009. Added "Whit Sunday" (1955–2009) and "Kingdom Day" (2008–2009). Adjusted holiday combinations for some years. No code changes.
tests/countries/test_aruba.py Expanded test coverage: added tests for New Year's Day, Good Friday, Easter Monday, Labor Day, Ascension Day, Christmas. Refined year ranges for holiday presence and absence. Clarified holiday assertions and updated Dutch localization test for Christmas name.
tests/countries/test_curacao.py Expanded test coverage: added tests for New Year's Day, Carnival Monday, Good Friday, Easter Sunday, Easter Monday, Ascension Day, Whit Sunday, Christmas, New Year's Eve. Separated half-day and public holiday tests. Clarified year ranges for holiday presence and absence. Updated Dutch localization test.

Suggested reviewers

  • KJhellico

📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between f302491 and 594a5c4.

📒 Files selected for processing (1)
  • tests/countries/test_aruba.py (7 hunks)
🧰 Additional context used
🧠 Learnings (1)
tests/countries/test_aruba.py (1)
Learnt from: PPsyrius
PR: vacanza/holidays#2416
File: tests/countries/test_turkmenistan.py:52-64
Timestamp: 2025-04-05T04:47:27.213Z
Learning: For holiday tests in the vacanza/holidays project, structure tests by individual holidays rather than by years. Each test method should focus on a specific holiday and test it across multiple years (from start_year through 2050) using helper methods like `assertHolidayName`. For fixed holidays, use generators like `(f"{year}-01-01" for year in range(1991, 2051))`. For movable holidays, specify individual dates for specific years followed by a range check.
🧬 Code Graph Analysis (1)
tests/countries/test_aruba.py (2)
tests/common.py (6)
  • setUpClass (32-53)
  • assertAliases (121-130)
  • assertNoHolidays (292-294)
  • assertHolidayName (195-199)
  • assertNoHolidayName (273-275)
  • assertNoHoliday (244-246)
holidays/countries/aruba.py (3)
  • Aruba (24-151)
  • AW (154-155)
  • ABW (158-159)
🪛 Pylint (3.3.7)
tests/countries/test_aruba.py

[convention] 24-24: Missing function or method docstring

(C0116)


[convention] 27-27: Missing function or method docstring

(C0116)


[convention] 46-46: Missing function or method docstring

(C0116)


[convention] 49-49: Missing function or method docstring

(C0116)


[convention] 79-79: Missing function or method docstring

(C0116)


[convention] 84-84: Missing function or method docstring

(C0116)


[convention] 97-97: Missing function or method docstring

(C0116)


[convention] 139-139: Missing function or method docstring

(C0116)


[convention] 172-172: Missing function or method docstring

(C0116)


[convention] 192-192: Missing function or method docstring

(C0116)


[convention] 205-205: Missing function or method docstring

(C0116)

⏰ Context from checks skipped due to timeout of 300000ms (5)
  • GitHub Check: Test Python 3.10 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.9 on windows-latest
  • GitHub Check: Test Python 3.13 on windows-latest
🔇 Additional comments (8)
tests/countries/test_aruba.py (8)

22-22: Good alignment with updated start year.

The year range change from 1947 to 1955 correctly aligns with the updated start_year in the Aruba holiday class.


28-28: Proper test for no holidays before start year.

Testing 1954 (one year before the start_year of 1955) is the correct approach to verify no holidays exist before the defined start year.


46-48: Well-structured individual holiday test.

The new test method follows the preferred pattern from the retrieved learnings, focusing on a specific holiday and testing it across the full year range.


68-77: Comprehensive carnival monday name transition testing.

The test properly handles the name change from "Dialuna despues di Carnaval Grandi" to "Dialuna prome cu diaranson di shinish" in 2023, with correct year range assertions for both names.


79-83: Proper testing of holiday start year.

The test correctly validates that National Anthem and Flag Day starts from 1976 and doesn't exist before that year.


84-96: Excellent individual holiday test coverage.

The new test methods for Good Friday, Easter Monday, Labor Day, and Ascension Day follow best practices by testing specific dates and full year ranges, providing comprehensive coverage for these holidays.

Also applies to: 97-108, 172-191, 192-204


125-126: Correct mutual exclusivity for Queen's and King's Day.

The updated year ranges properly reflect the transition from Queen's Day (1955-2013) to King's Day (2014+), ensuring no overlap between the two holidays.

Also applies to: 137-137, 169-170


256-256: Updated Christmas Day translation.

The change to "Eerste Kerstdag" aligns with the localization updates in the main codebase.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate Unit Tests
  • Create PR with Unit Tests
  • Post Copyable Unit Tests in Comment

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

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

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

Support

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

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai auto-generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

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

Documentation and Community

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

@codecov
Copy link

codecov bot commented Jun 25, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (29372bd) to head (594a5c4).
Report is 1 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff            @@
##               dev     #2677   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          251       251           
  Lines        15286     15272   -14     
  Branches      2095      2092    -3     
=========================================
- Hits         15286     15272   -14     

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

@PPsyrius PPsyrius marked this pull request as ready for review June 25, 2025 10:10
PPsyrius and others added 3 commits June 26, 2025 09:26
Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>
Signed-off-by: Panpakorn Siripanich <19505219+PPsyrius@users.noreply.github.com>
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 2e7ffbe and f302491.

📒 Files selected for processing (4)
  • holidays/locale/nl/LC_MESSAGES/AW.po (3 hunks)
  • holidays/locale/uk/LC_MESSAGES/CW.po (2 hunks)
  • tests/countries/test_aruba.py (7 hunks)
  • tests/countries/test_curacao.py (7 hunks)
🧰 Additional context used
🧠 Learnings (4)
holidays/locale/uk/LC_MESSAGES/CW.po (1)
Learnt from: KJhellico
PR: vacanza/holidays#2651
File: holidays/locale/pap_BQ/LC_MESSAGES/BQ.po:70-72
Timestamp: 2025-06-25T14:08:09.313Z
Learning: The Papiamento translation "Di dos dia di Pasku" for "Tweede Kerstdag" (Boxing Day) in holidays/locale/pap_BQ/LC_MESSAGES/BQ.po comes from an authoritative source, despite the literal meaning potentially seeming to refer to Easter rather than Christmas.
holidays/locale/nl/LC_MESSAGES/AW.po (1)
Learnt from: KJhellico
PR: vacanza/holidays#2651
File: holidays/locale/pap_BQ/LC_MESSAGES/BQ.po:70-72
Timestamp: 2025-06-25T14:08:09.313Z
Learning: The Papiamento translation "Di dos dia di Pasku" for "Tweede Kerstdag" (Boxing Day) in holidays/locale/pap_BQ/LC_MESSAGES/BQ.po comes from an authoritative source, despite the literal meaning potentially seeming to refer to Easter rather than Christmas.
tests/countries/test_curacao.py (2)
Learnt from: PPsyrius
PR: vacanza/holidays#2416
File: tests/countries/test_turkmenistan.py:31-49
Timestamp: 2025-04-05T04:50:40.752Z
Learning: For Turkmenistan holiday tests, use this class structure: `class TestTurkmenistan(CommonCountryTests, TestCase)` with imports `from unittest import TestCase`, `from holidays.countries import Turkmenistan, TM, TKM`, and `from tests.common import CommonCountryTests`. Ensure to call `super().setUp()` in the setUp method.
Learnt from: PPsyrius
PR: vacanza/holidays#2416
File: tests/countries/test_turkmenistan.py:52-64
Timestamp: 2025-04-05T04:47:27.213Z
Learning: For holiday tests in the vacanza/holidays project, structure tests by individual holidays rather than by years. Each test method should focus on a specific holiday and test it across multiple years (from start_year through 2050) using helper methods like `assertHolidayName`. For fixed holidays, use generators like `(f"{year}-01-01" for year in range(1991, 2051))`. For movable holidays, specify individual dates for specific years followed by a range check.
tests/countries/test_aruba.py (1)
Learnt from: PPsyrius
PR: vacanza/holidays#2416
File: tests/countries/test_turkmenistan.py:52-64
Timestamp: 2025-04-05T04:47:27.213Z
Learning: For holiday tests in the vacanza/holidays project, structure tests by individual holidays rather than by years. Each test method should focus on a specific holiday and test it across multiple years (from start_year through 2050) using helper methods like `assertHolidayName`. For fixed holidays, use generators like `(f"{year}-01-01" for year in range(1991, 2051))`. For movable holidays, specify individual dates for specific years followed by a range check.
🧬 Code Graph Analysis (2)
tests/countries/test_curacao.py (2)
holidays/countries/curacao.py (2)
  • Curacao (25-166)
  • CW (169-170)
tests/common.py (3)
  • assertAliases (121-130)
  • assertHolidayName (195-199)
  • assertNoHolidayName (273-275)
tests/countries/test_aruba.py (2)
tests/common.py (6)
  • setUpClass (32-53)
  • assertAliases (121-130)
  • assertNoHolidays (292-294)
  • assertHolidayName (195-199)
  • assertNoHolidayName (273-275)
  • assertNoHoliday (244-246)
holidays/countries/aruba.py (3)
  • Aruba (24-151)
  • AW (154-155)
  • ABW (158-159)
🪛 Pylint (3.3.7)
tests/countries/test_curacao.py

[convention] 26-26: Missing function or method docstring

(C0116)


[convention] 29-29: Missing function or method docstring

(C0116)


[convention] 33-33: Missing function or method docstring

(C0116)


[convention] 56-56: Missing function or method docstring

(C0116)


[convention] 59-59: Missing function or method docstring

(C0116)


[convention] 71-71: Missing function or method docstring

(C0116)


[convention] 84-84: Missing function or method docstring

(C0116)


[convention] 97-97: Missing function or method docstring

(C0116)


[convention] 166-166: Missing function or method docstring

(C0116)


[convention] 186-186: Missing function or method docstring

(C0116)


[convention] 199-199: Missing function or method docstring

(C0116)


[convention] 212-212: Missing function or method docstring

(C0116)


[convention] 217-217: Missing function or method docstring

(C0116)


[convention] 222-222: Missing function or method docstring

(C0116)


[convention] 230-230: Missing function or method docstring

(C0116)

tests/countries/test_aruba.py

[convention] 24-24: Missing function or method docstring

(C0116)


[convention] 27-27: Missing function or method docstring

(C0116)


[convention] 46-46: Missing function or method docstring

(C0116)


[convention] 49-49: Missing function or method docstring

(C0116)


[convention] 79-79: Missing function or method docstring

(C0116)


[convention] 84-84: Missing function or method docstring

(C0116)


[convention] 97-97: Missing function or method docstring

(C0116)


[convention] 139-139: Missing function or method docstring

(C0116)


[convention] 172-172: Missing function or method docstring

(C0116)


[convention] 192-192: Missing function or method docstring

(C0116)


[convention] 205-205: Missing function or method docstring

(C0116)

🪛 GitHub Actions: CI/CD
tests/countries/test_aruba.py

[error] 245-245: Unit test failure in TestAruba.test_l10n_nl: AssertionError due to mismatch in holiday name capitalization ('Dag van de Arbeid' vs 'Dag van de arbeid'). Please ensure all holiday names are properly localized.

🔇 Additional comments (14)
holidays/locale/uk/LC_MESSAGES/CW.po (2)

17-27: Well-executed localization metadata updates.

The version bump to 0.76 and metadata refresh (revision date, translator, Poedit version) maintain proper localization hygiene.


30-92: Excellent standardization and new holiday additions.

Good work on:

  • Adding trailing periods to all comments for consistency
  • Including the new "Whit Sunday" and "Kingdom Day" holidays with proper Ukrainian translations
  • The "Kingdom Day" translation aligns with previous feedback

These changes properly support the holiday class refactoring.

tests/countries/test_curacao.py (4)

23-24: Proper test setup alignment with holiday class changes.

The start year update to 1955 and addition of half-day holidays instance correctly reflect the refactored Curacao class structure.


30-31: Smart separation of no-holidays assertions.

Splitting the test into separate PUBLIC and HALF_DAY category assertions properly validates the conditional holiday logic.


56-237: Comprehensive individual holiday test coverage.

Excellent work implementing thorough tests for each holiday:

  • Follows the recommended pattern of specific dates followed by range assertions
  • Properly tests conditional holidays (Whit Sunday until 2010, Kingdom Day 2008-2009)
  • Correctly validates half-day New Year's Eve from 2010 onward
  • Year ranges align perfectly with the holiday class implementation

The test structure matches the learned best practices for this codebase.


286-286: Localization test correction applied.

Good catch updating the Dutch Christmas Day translation from "Kerst" to "Eerste Kerstdag" for consistency.

holidays/locale/nl/LC_MESSAGES/AW.po (4)

17-17: Version updates look good.

Project version and generator updates are appropriate for the refactoring effort.

Also applies to: 27-27


30-30: Comment standardization is consistent.

Adding periods to all holiday comments improves consistency across the localization file.

Also applies to: 34-34, 38-38, 42-42, 46-46, 50-50, 54-54, 58-58, 62-62, 74-74, 78-78, 82-82


58-61: Labor Day translation follows previous feedback.

The translation "Dag van de Arbeid" aligns with the past review suggestion for proper capitalization.


80-80: Christmas Day translation is more specific.

Changing from "Kerst" to "Eerste Kerstdag" better distinguishes the first day of Christmas from the general Christmas term.

tests/countries/test_aruba.py (4)

22-22: Year range aligns with Aruba class start_year.

The updated range 1955-2049 matches the start_year in the Aruba holiday class.


46-48: Comprehensive individual holiday tests are well-structured.

The new test methods follow the project pattern of testing individual holidays across multiple years and align with the Aruba class implementation.

Also applies to: 51-52, 79-83, 84-96, 97-108, 172-191, 192-204, 205-211


68-77: Holiday transition tests handle year boundaries correctly.

The mutual exclusivity tests for carnival/ash monday and queen's/king's day properly validate the holiday logic changes.

Also applies to: 125-126, 137-137, 144-145, 162-162, 169-171


256-256: Christmas Day translation update is consistent.

The test correctly reflects the updated Dutch translation "Eerste Kerstdag" from the localization file.

@sonarqubecloud
Copy link

@PPsyrius PPsyrius requested a review from KJhellico June 26, 2025 02:41
Copy link
Collaborator

@KJhellico KJhellico left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Collaborator

@arkid15r arkid15r left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@arkid15r arkid15r added this pull request to the merge queue Jun 26, 2025
Merged via the queue into vacanza:dev with commit 23c351e Jun 26, 2025
33 checks passed
@PPsyrius PPsyrius deleted the nl_refactor branch June 26, 2025 15:30
@KJhellico KJhellico mentioned this pull request Jul 7, 2025
@jovana
Copy link
Contributor

jovana commented Jul 9, 2025

Hi, it seems this version has a breaking change (at least for the Netherlands).

Working code on version 0.75:

nl_holidays = []
for year in range(int(datetime.datetime.now(datetime.UTC).year), int(datetime.datetime.now(datetime.UTC).year) + 2):
      for ptr in holidays.NL(year, language="nl").items():
          nl_holidays.append({"date": ptr[0].isoformat(), "name": ptr[1]})

Running on version 0.76:
Rrror:

  File "/Users/jovana/.pyenv/versions/3.12.9/envs/smartrental-api/lib/python3.12/site-packages/holidays/countries/netherlands.py", line 39, in __init__
    super().__init__(*args, **kwargs)
TypeError: ObservedHolidayBase.__init__() got multiple values for argument 'observed_rule'

This will fix this error on version 0.75:

holidays.NL(years=year, language="nl")

@arkid15r
Copy link
Collaborator

arkid15r commented Jul 9, 2025

@jovana check out the docs here or here (the years param). Using it as holidays.NL(year, language="nl") doesn't seem right.

Please next time file a new issue instead of commenting on a closed PR.

Thanks for using holidays!

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.

4 participants