Skip to content

Add Åland Islands holidays#2536

Closed
PPsyrius wants to merge 34 commits intovacanza:devfrom
PPsyrius:ax_merge_cleanup
Closed

Add Åland Islands holidays#2536
PPsyrius wants to merge 34 commits intovacanza:devfrom
PPsyrius:ax_merge_cleanup

Conversation

@PPsyrius
Copy link
Collaborator

@PPsyrius PPsyrius commented May 9, 2025

Proposed change

Add Åland Islands holidays (languages: en_US, fi, sv_FI, uk; categories: PUBLIC, UNOFFICIAL), also available as part of Finland holidays as subdivision 01.

Resolves #2424 .
Supercedes #2449 .

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

Arynelson and others added 30 commits April 8, 2025 14:35
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Signed-off-by: Ary Hauffe <41094281+Arynelson@users.noreply.github.com>
Co-authored-by: Panpakorn Siripanich <19505219+PPsyrius@users.noreply.github.com>
Signed-off-by: Ary Hauffe <41094281+Arynelson@users.noreply.github.com>
Co-authored-by: Panpakorn Siripanich <19505219+PPsyrius@users.noreply.github.com>
Signed-off-by: Ary Hauffe <41094281+Arynelson@users.noreply.github.com>
Co-authored-by: Panpakorn Siripanich <19505219+PPsyrius@users.noreply.github.com>
Signed-off-by: Ary Hauffe <41094281+Arynelson@users.noreply.github.com>
Co-authored-by: Panpakorn Siripanich <19505219+PPsyrius@users.noreply.github.com>
Signed-off-by: Ary Hauffe <41094281+Arynelson@users.noreply.github.com>
Co-authored-by: Panpakorn Siripanich <19505219+PPsyrius@users.noreply.github.com>
Signed-off-by: Ary Hauffe <41094281+Arynelson@users.noreply.github.com>
Co-authored-by: Panpakorn Siripanich <19505219+PPsyrius@users.noreply.github.com>
Signed-off-by: Ary Hauffe <41094281+Arynelson@users.noreply.github.com>
Signed-off-by: Ary Hauffe <41094281+Arynelson@users.noreply.github.com>
Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>
Signed-off-by: Ary Hauffe <41094281+Arynelson@users.noreply.github.com>
Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>
Signed-off-by: Ary Hauffe <41094281+Arynelson@users.noreply.github.com>
Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>
Signed-off-by: Ary Hauffe <41094281+Arynelson@users.noreply.github.com>
@coderabbitai
Copy link
Contributor

coderabbitai bot commented May 9, 2025

Summary by CodeRabbit

  • New Features

    • Added support for Åland Islands holidays, including Åland's Autonomy Day, with comprehensive localization in English, Finnish, Swedish, and Ukrainian.
    • Åland Islands can now be selected as a separate country or as a subdivision of Finland.
  • Documentation

    • Updated README to reflect support for Åland Islands and clarify its relationship with Finland.
  • Localization

    • Added and updated translation files for Åland Islands and Finland, including new entries for Åland's Autonomy Day in multiple languages.
  • Bug Fixes

    • Improved language fallback logic for holiday translations.
  • Tests

    • Introduced extensive tests for Åland Islands holidays and enhanced Finland holiday tests for accuracy and historical coverage.
  • Chores

    • Added a new contributor to the CONTRIBUTORS file.

Summary by CodeRabbit

  • New Features

    • Added support for Åland Islands holidays, including a new country code (AX) and localized holiday names in multiple languages.
    • Åland's Autonomy Day is now recognized as a holiday for the Åland Islands and as a regional holiday in Finland.
  • Documentation

    • Updated README to reflect new country support and clarify the relationship between Finland and Åland Islands.
  • Localization

    • Added and updated translation files for Åland Islands holidays in English, Finnish, Swedish (Finland), and Ukrainian.
    • Added localized names for Åland's Autonomy Day in supported languages.
  • Bug Fixes

    • Improved fallback logic for holiday name translations when an unsupported language is specified.
  • Tests

    • Introduced comprehensive tests for Åland Islands holidays and enhanced Finland holiday tests, including historical and regional coverage.

Walkthrough

This update introduces official support for Åland Islands holidays by adding a dedicated module, registry entry, localization files, and comprehensive tests. It extends the Finland holiday logic to handle Åland as a subdivision with specific holidays and translations. Documentation and contributor records are also updated to reflect these changes.

Changes

Files/Groups Change Summary
holidays/countries/aland_islands.py New module for Åland Islands holidays, including class HolidaysAX and aliases.
holidays/countries/init.py, holidays/registry.py Imports and registry updated to include Åland Islands.
holidays/countries/finland.py Adds Åland as subdivision, new holiday for Åland's Autonomy Day, updates aliases.
holidays/holiday_base.py Adjusts translation fallback logic for language selection.
holidays/locale/en_US/LC_MESSAGES/AX.po, holidays/locale/fi/LC_MESSAGES/AX.po, holidays/locale/sv_FI/LC_MESSAGES/AX.po, holidays/locale/uk/LC_MESSAGES/AX.po Adds new localization stub files for Åland Islands in multiple languages.
holidays/locale/en_US/LC_MESSAGES/FI.po, holidays/locale/fi/LC_MESSAGES/FI.po, holidays/locale/sv_FI/LC_MESSAGES/FI.po, holidays/locale/uk/LC_MESSAGES/FI.po Updates Finnish localization files to include Åland's Autonomy Day and metadata.
tests/countries/test_aland_islands.py New test suite for Åland Islands holidays and localization.
tests/countries/test_finland.py Adds and refines tests for Finland, including Åland's Autonomy Day and localization.
tests/common.py Streamlines language assertion logic in test helper.
README.md Documents Åland Islands as a supported country and clarifies Finland's subdivisions.
CONTRIBUTORS Adds new contributor.

Assessment against linked issues

Objective (Issue #) Addressed Explanation
Add Åland Islands holidays (#2424)

Possibly related PRs

Suggested reviewers

  • KJhellico

Tip

⚡️ Faster reviews with caching
  • CodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 16th. To opt out, configure Review - Disable Cache at either the organization or repository level. If you prefer to disable all data retention across your organization, simply turn off the Data Retention setting under your Organization Settings.

Enjoy the performance boost—your workflow just got faster.


📜 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 6dfd249 and a0945c1.

📒 Files selected for processing (9)
  • README.md (3 hunks)
  • holidays/locale/en_US/LC_MESSAGES/AX.po (1 hunks)
  • holidays/locale/en_US/LC_MESSAGES/FI.po (2 hunks)
  • holidays/locale/fi/LC_MESSAGES/AX.po (1 hunks)
  • holidays/locale/fi/LC_MESSAGES/FI.po (2 hunks)
  • holidays/locale/sv_FI/LC_MESSAGES/AX.po (1 hunks)
  • holidays/locale/sv_FI/LC_MESSAGES/FI.po (2 hunks)
  • holidays/locale/uk/LC_MESSAGES/AX.po (1 hunks)
  • holidays/locale/uk/LC_MESSAGES/FI.po (2 hunks)
🔇 Additional comments (17)
holidays/locale/en_US/LC_MESSAGES/AX.po (1)

1-28: Localization stub file is correctly structured.

This new English (en_US) localization stub file for Åland Islands holidays follows the proper format for PO files and includes all required metadata headers. The file serves as an essential placeholder for future translations of Åland Islands holidays in English.

Note that the dates in the metadata headers (lines 18-19) are set to 2025, which appears to be future-dated. This is likely intentional for the release planning but worth confirming.

holidays/locale/fi/LC_MESSAGES/AX.po (1)

1-28: Finnish localization stub is properly configured.

The Finnish (fi) localization stub for Åland Islands follows the correct PO file format with all necessary metadata headers. This stub will enable proper Finnish translations for Åland Islands holidays in future updates.

As with the English locale file, the dates in the metadata (lines 18-19) are set to 2025, which is consistent with the other localization files in this PR.

holidays/locale/en_US/LC_MESSAGES/FI.po (4)

17-17: Version number updated appropriately.

Version number has been bumped from 0.54 to 0.73, correctly reflecting the significant addition of Åland Islands support.


19-19: Revision date updated.

The PO revision date has been properly updated to reflect the current changes.


27-27: Generator version updated.

X-Generator has been updated from Poedit 3.4.2 to 3.6, reflecting the use of a newer version of the translation tool.


165-167: New holiday entry added correctly.

The addition of "Åland's Autonomy Day" (Ahvenanmaan itsehallintopäivä) is properly formatted with appropriate comments and translation. This holiday is a key part of supporting Åland Islands as a subdivision under Finland.

holidays/locale/uk/LC_MESSAGES/AX.po (1)

1-28: Ukrainian localization stub is properly structured.

The Ukrainian (uk) localization stub for Åland Islands follows the standard PO file format with all required metadata headers. This file will enable proper Ukrainian translations for Åland Islands holidays in future iterations.

Consistent with the other locale files in this PR, the dates in the metadata (lines 18-19) are set to 2025.

holidays/locale/fi/LC_MESSAGES/FI.po (2)

17-19: Metadata update approved
Project version, revision date, and generator tool have been updated correctly to reflect the new release.

Also applies to: 27-27


164-168: New Åland's Autonomy Day entry added
The Finnish translation entry for Åland's Autonomy Day has been appended. The empty msgstr is consistent with existing entries, falling back to msgid.

holidays/locale/uk/LC_MESSAGES/FI.po (2)

17-19: Metadata bumped to 0.73
Project and revision dates and generator version are correctly updated.

Also applies to: 27-27


165-168: Ukrainian translation for Åland's Autonomy Day
The localized string "День автономії Аландських островів" has been added for the new holiday entry.

holidays/locale/sv_FI/LC_MESSAGES/FI.po (2)

17-19: Metadata updated for release 0.73
The PO headers reflect the new project version and Poedit generator.

Also applies to: 27-27


165-168: Added Swedish translation for Åland's Autonomy Day
The entry Ålands självstyrelsedag has been correctly inserted.

holidays/locale/sv_FI/LC_MESSAGES/AX.po (1)

1-28: Stub localization file for Åland Islands
The new stub PO file sets up metadata for sv_FI locale; no translation entries needed at this stage.

README.md (3)

108-112: Supported countries count updated
The supported country code count has been incremented to 172, matching the new addition of Åland Islands.

🧰 Tools
🪛 LanguageTool

[typographical] ~110-~110: Consider adding a comma after this introductory phrase.
Context: ...e same used for domain names, and for a subdivision its [ISO 3166-2 code](https://en.wikipe...

(AS_A_NN_COMMA)


157-162: Aland entry correctly inserted
The table row for Åland (AX) with subdivision alias, languages, and category UNOFFICIAL is accurate and consistent with your new module.


529-533: Finland subdivisions updated
Finland's table entry now includes region 01 for Åland Islands. This aligns with the code changes.


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.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @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 generate unit testing code.
    • @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 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.

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: 6

🔭 Outside diff range comments (1)
tests/countries/test_finland.py (1)

570-573: ⚠️ Potential issue

Same Swedish typo as in Åland tests

"Självständigshetsdagen""Självständighetsdagen".

-            ("2022-12-06", "Självständigshetsdagen"),
+            ("2022-12-06", "Självständighetsdagen"),
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between a1d3b59 and 6dfd249.

📒 Files selected for processing (18)
  • CONTRIBUTORS (1 hunks)
  • README.md (3 hunks)
  • holidays/countries/__init__.py (1 hunks)
  • holidays/countries/aland_islands.py (1 hunks)
  • holidays/countries/finland.py (3 hunks)
  • holidays/holiday_base.py (1 hunks)
  • holidays/locale/en_US/LC_MESSAGES/AX.po (1 hunks)
  • holidays/locale/en_US/LC_MESSAGES/FI.po (2 hunks)
  • holidays/locale/fi/LC_MESSAGES/AX.po (1 hunks)
  • holidays/locale/fi/LC_MESSAGES/FI.po (2 hunks)
  • holidays/locale/sv_FI/LC_MESSAGES/AX.po (1 hunks)
  • holidays/locale/sv_FI/LC_MESSAGES/FI.po (2 hunks)
  • holidays/locale/uk/LC_MESSAGES/AX.po (1 hunks)
  • holidays/locale/uk/LC_MESSAGES/FI.po (2 hunks)
  • holidays/registry.py (1 hunks)
  • tests/common.py (1 hunks)
  • tests/countries/test_aland_islands.py (1 hunks)
  • tests/countries/test_finland.py (14 hunks)
🧰 Additional context used
🧠 Learnings (2)
tests/common.py (1)
Learnt from: KJhellico
PR: vacanza/holidays#2398
File: tests/countries/test_guinea.py:237-239
Timestamp: 2025-04-02T18:38:35.164Z
Learning: In the vacanza/holidays project, the method assertLocalizedHolidays in country test files should be called with positional parameters rather than named parameters to maintain consistency with the rest of the codebase.
tests/countries/test_finland.py (1)
Learnt from: PPsyrius
PR: vacanza/holidays#2416
File: tests/countries/test_turkmenistan.py:85-86
Timestamp: 2025-04-05T04:29:38.042Z
Learning: For testing holiday implementations in the vacanza/holidays repository, recommend using `from tests.common import CommonCountryTests` as the base class instead of directly using `unittest.TestCase` to maintain consistency with project conventions and leverage common test utilities.
🧬 Code Graph Analysis (3)
holidays/countries/__init__.py (1)
holidays/countries/aland_islands.py (4)
  • Aland (51-52)
  • AX (55-56)
  • ALA (59-60)
  • HolidaysAX (17-48)
holidays/countries/finland.py (2)
holidays/countries/portugal.py (1)
  • _populate_subdiv_01_public_holidays (188-190)
holidays/countries/malaysia.py (1)
  • _populate_subdiv_01_public_holidays (251-264)
tests/countries/test_finland.py (12)
holidays/countries/finland.py (2)
  • Finland (21-198)
  • FI (201-202)
tests/common.py (6)
  • TestCase (28-338)
  • setUpClass (32-53)
  • assertAliases (121-130)
  • assertNoHolidays (292-294)
  • assertHolidayName (195-199)
  • assertNoHolidayName (273-275)
tests/countries/test_aland_islands.py (2)
  • setUpClass (22-23)
  • test_alands_autonomy_day (31-34)
tests/countries/test_vietnam.py (1)
  • setUpClass (23-24)
tests/countries/test_cuba.py (2)
  • setUpClass (21-22)
  • test_no_holidays (27-28)
tests/countries/test_chile.py (2)
  • setUpClass (22-23)
  • test_no_holidays (34-35)
tests/countries/test_costa_rica.py (2)
  • setUpClass (22-23)
  • test_good_friday (46-59)
tests/countries/test_kazakhstan.py (2)
  • setUpClass (21-22)
  • test_no_holidays (27-28)
tests/countries/test_russia.py (1)
  • test_no_holidays (27-28)
tests/countries/test_uruguay.py (1)
  • test_no_holidays (30-31)
tests/countries/test_nicaragua.py (1)
  • test_good_friday (46-60)
tests/countries/test_switzerland.py (1)
  • test_good_friday (191-231)
🔇 Additional comments (23)
CONTRIBUTORS (1)

20-20: LGTM: New contributor added correctly

The new contributor "Ary Hauffe Neto" has been properly added to the CONTRIBUTORS file in alphabetical order between "Artem Tserekh" and "Bailey Thompson".

holidays/countries/__init__.py (1)

16-16: LGTM: Import added properly

Import for Åland Islands classes added in correct alphabetical order among other country imports, consistent with the project's import pattern.

holidays/registry.py (1)

24-24: LGTM: Registry entry added correctly

The Åland Islands entry has been properly added to the COUNTRIES dictionary in alphabetical order with the correct format: country name, ISO alpha-2 code, ISO alpha-3 code, and the holiday class name.

tests/common.py (1)

337-338: LGTM: Simplified method implementation

The assertLocalizedHolidays method has been simplified to directly call _assertLocalizedHolidays with the language parameter, which better matches the production code's language handling behavior. This refactoring supports the new language localization features.

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

1-28: Stub file for Åland Islands (en_US) is in place
The new AX.po contains the correct metadata template and matches the structure of other locale stubs.

holidays/locale/fi/LC_MESSAGES/FI.po (2)

17-27: Metadata updated to v0.73
Project-Id-Version, PO-Revision-Date, and X-Generator headers have been bumped appropriately.


165-168: New Finnish translation stub added
The entry for “Ahvenanmaan itsehallintopäivä” is correctly appended with an empty msgstr, consistent with existing stubs.

holidays/locale/fi/LC_MESSAGES/AX.po (1)

1-28: Stub file for Åland Islands (fi) looks correct
Metadata aligns with other locale stub files and awaits actual translations.

holidays/locale/uk/LC_MESSAGES/FI.po (2)

17-27: Headers bumped to match v0.73
Project-Id-Version, PO-Revision-Date, and X-Generator reflect the new release.


165-168: Ukrainian translation for Åland’s Autonomy Day added
The msgstr “День автономії Аландських островів” correctly maps to the new msgid.

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

17-27: Locale metadata bumped to 0.73
Headers for Project-Id-Version, PO-Revision-Date, and X-Generator have been updated consistently.


165-168: New English translation entry appended
The msgstr “Åland’s Autonomy Day” matches the new msgid and holiday naming.

holidays/locale/sv_FI/LC_MESSAGES/FI.po (4)

17-17: Updated version to match current project status.

The Project-Id-Version has been updated from 0.54 to 0.73, which aligns with the current version for all locale files in this PR.


19-19: PO-Revision-Date updated to reflect recent changes.

The revision date has been updated to May 2025, which is consistent with the timeframe of this PR implementation.


27-27: Updated X-Generator to latest Poedit version.

The generator tool version has been updated from 3.4.2 to 3.6, which is appropriate for maintaining consistent metadata across all PO files.


165-167: Correctly added new translation for Åland's Autonomy Day.

The translation for "Ahvenanmaan itsehallintopäivä" to "Ålands självstyrelsedag" is accurate and follows the library's internationalization format.

README.md (3)

108-108: Updated country count to include new Åland Islands addition.

The number of supported countries has been increased from 171 to 173, correctly reflecting the addition of Åland Islands.


157-162: Correctly added Åland Islands as a new supported region.

The new entry for Åland Islands includes:

  • Proper country code (AX)
  • Relationship to Finland as subdivision 01
  • Supported languages including sv_FI as the default
  • Appropriate categorization as UNOFFICIAL

This is consistent with the Åland Islands' status as an autonomous region.


530-530: Updated Finland entry to include Åland subdivision.

The Finland entry now correctly references the Åland Islands (01) as one of its regions, establishing the appropriate parent-child relationship between Finland and Åland.

holidays/locale/sv_FI/LC_MESSAGES/AX.po (1)

1-28: Appropriate localization stub for Åland Islands in Swedish (Finland).

This new stub file is correctly structured with all necessary metadata headers and properly identifies its purpose as an Åland Islands localization file for the Swedish (Finland) locale.

The file is set up correctly as a stub that can be populated with translations later as needed.

holidays/locale/uk/LC_MESSAGES/AX.po (1)

1-28: Properly structured Ukrainian localization stub for Åland Islands.

This new stub file contains all required metadata headers and is correctly set up as a Ukrainian localization file for Åland Islands holidays.

Like the other localization stubs, this provides the framework for adding Ukrainian translations for Åland Islands holidays in the future.

holidays/holiday_base.py (1)

789-794: Improved language fallback logic for better localization support.

The enhanced fallback logic now properly handles both cases where:

  1. The user-specified language is unsupported but valid
  2. No language is specified (None)

By falling back to self.default_language when available, this change ensures better continuity in holiday name localization.

This improvement will directly benefit the Åland Islands implementation by ensuring consistent language selection when dealing with its multilingual holiday names.

holidays/countries/finland.py (1)

195-199: Double-check localisation for Autonomy Day

_add_holiday_jun_9(tr("Ahvenanmaan itsehallintopäivä")) stores the Finnish label.
Because Finland.default_language is "fi", this is fine, but note that the default Swedish label users might expect when subdiv="01" is "Ålands självstyrelsedag".

If tr() files contain the Swedish mapping this is OK; otherwise you may need a dedicated call such as:

self._add_holiday_jun_9(
    tr("Ahvenanmaan itsehallintopäivä"),  # fi
    alt_tr={"sv_FI": "Ålands självstyrelsedag"},
)

Please verify that the translation catalogs already include the Swedish, English and Ukrainian entries.

Comment on lines +41 to +46
subdivisions: tuple[str, ...] = ("01",) # Åland Islands.
subdivisions_aliases = {
"Ahvenanmaan maakunta": "01",
"Landskapet Åland": "01",
"Åland": "01",
}
Copy link
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick (assertive)

Consider adding an English alias for discoverability

subdivisions_aliases currently lists only Finnish & Swedish names. A plain-English alias such as "Aland Islands": "01" would let callers specify the subdivision without worrying about diacritics or language. It’s a small DX win and keeps parity with many other country modules that accept English names for their subdivisions.

     subdivisions_aliases = {
         "Ahvenanmaan maakunta": "01",
         "Landskapet Åland": "01",
         "Åland": "01",
+        "Aland Islands": "01",          # English convenience alias
     }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
subdivisions: tuple[str, ...] = ("01",) # Åland Islands.
subdivisions_aliases = {
"Ahvenanmaan maakunta": "01",
"Landskapet Åland": "01",
"Åland": "01",
}
subdivisions: tuple[str, ...] = ("01",) # Åland Islands.
subdivisions_aliases = {
"Ahvenanmaan maakunta": "01",
"Landskapet Åland": "01",
"Åland": "01",
"Aland Islands": "01", # English convenience alias
}
🤖 Prompt for AI Agents (early access)
In holidays/countries/finland.py around lines 41 to 46, the subdivisions_aliases
dictionary lacks an English alias for the Åland Islands subdivision. Add an
entry "Aland Islands": "01" to subdivisions_aliases to improve discoverability
and allow users to specify the subdivision using an English name without
diacritics.

Comment on lines +33 to 35
* <https://en.wikipedia.org/wiki/Åland%27s_Autonomy_Day>
* <https://wiki.aineetonkulttuuriperinto.fi/wiki/Workers%E2%80%99_Labour_Day_on_May_1?>
"""
Copy link
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick (assertive)

Nit: broken Wikipedia URL

The new reference link for May Day ends with a trailing ?, which 404s on Wikipedia.

-        * <https://wiki.aineetonkulttuuriperinto.fi/wiki/Workers%E2%80%99_Labour_Day_on_May_1?>
+        * <https://wiki.aineetonkulttuuriperinto.fi/wiki/Workers%E2%80%99_Labour_Day_on_May_1>
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
* <https://en.wikipedia.org/wiki/Åland%27s_Autonomy_Day>
* <https://wiki.aineetonkulttuuriperinto.fi/wiki/Workers%E2%80%99_Labour_Day_on_May_1?>
"""
* <https://en.wikipedia.org/wiki/Åland%27s_Autonomy_Day>
* <https://wiki.aineetonkulttuuriperinto.fi/wiki/Workers%E2%80%99_Labour_Day_on_May_1>
"""
🤖 Prompt for AI Agents (early access)
In holidays/countries/finland.py around lines 33 to 35, the Wikipedia URL for
May Day ends with an unnecessary trailing question mark that causes a 404 error.
Remove the trailing '?' from the URL to fix the broken link.

Comment on lines +42 to +49
def _populate_unofficial_holidays(self) -> None:
self.subdiv = "01"
super()._populate_unofficial_holidays()

def _populate_public_holidays(self):
self.subdiv = "01"
super()._populate_public_holidays()

Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Be careful mutating self.subdiv inside populate methods

Overwriting self.subdiv each time _populate_* is invoked works, but it is a side-effect that can surprise future maintainers (and makes nested calls hard to reason about).
A safer pattern is to leave self.subdiv untouched and call the parent with subdiv="01" at construction, e.g.:

class HolidaysAX(Finland):
    def __init__(self, *args, **kwargs):
        kwargs.setdefault("subdiv", "01")
        super().__init__(*args, **kwargs)

Then the populate helpers need no mutation.

🤖 Prompt for AI Agents (early access)
In holidays/countries/aland_islands.py around lines 42 to 49, avoid mutating
self.subdiv inside the _populate_unofficial_holidays and
_populate_public_holidays methods as it causes side effects and complicates
nested calls. Instead, set subdiv="01" once during the class initialization by
overriding the __init__ method, passing subdiv="01" in kwargs to the superclass
constructor. Remove any assignments to self.subdiv in the populate methods so
they do not mutate state.

Comment on lines +37 to +40
subdivisions = () # Override Finland subdivisions.
subdivisions_aliases = {} # Override Finland subdivisions aliases.
# Aland Islands got its autonomy on May 7th, 1920.
start_year = 1921
Copy link
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick (assertive)

Typo in doc-string (“Aland” → “Åland”)

For consistency and searchability, prefer the dia­critical spelling in the public doc-string.

-    """Aland Islands holidays.
+    """Åland Islands holidays.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
subdivisions = () # Override Finland subdivisions.
subdivisions_aliases = {} # Override Finland subdivisions aliases.
# Aland Islands got its autonomy on May 7th, 1920.
start_year = 1921
"""Åland Islands holidays."""
subdivisions = () # Override Finland subdivisions.
subdivisions_aliases = {} # Override Finland subdivisions aliases.
# Aland Islands got its autonomy on May 7th, 1920.
start_year = 1921
🤖 Prompt for AI Agents (early access)
In holidays/countries/aland_islands.py around lines 37 to 40, the doc-string
contains a typo where "Aland" is used instead of the correct dia­critical
spelling "Åland". Update the doc-string to replace "Aland" with "Åland" to
ensure consistency and improve searchability.

Comment on lines +66 to +70
("2022-11-13", "Fars dag"),
("2022-11-20", "Barnkonventionens dag"),
("2022-12-06", "Självständigshetsdagen"),
("2022-12-08", "Sibeliusdagen, den finländska musikens dag"),
("2022-12-24", "Julafton"),
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Spelling mistake breaks Swedish localisation test

"Självständigshetsdagen" has an extra “g”. The correct spelling is "Självständighetsdagen".
Tests will fail once the Swedish PO file is compiled.

-            ("2022-12-06", "Självständigshetsdagen"),
+            ("2022-12-06", "Självständighetsdagen"),
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
("2022-11-13", "Fars dag"),
("2022-11-20", "Barnkonventionens dag"),
("2022-12-06", "Självständigshetsdagen"),
("2022-12-08", "Sibeliusdagen, den finländska musikens dag"),
("2022-12-24", "Julafton"),
("2022-11-13", "Fars dag"),
("2022-11-20", "Barnkonventionens dag"),
- ("2022-12-06", "Självständigshetsdagen"),
+ ("2022-12-06", "Självständighetsdagen"),
("2022-12-08", "Sibeliusdagen, den finländska musikens dag"),
("2022-12-24", "Julafton"),
🤖 Prompt for AI Agents (early access)
In tests/countries/test_aland_islands.py around lines 66 to 70, correct the
spelling of "Självständigshetsdagen" to "Självständighetsdagen" to fix the
Swedish localisation test failure caused by the typo.

Comment on lines +440 to 441
("2022-06-09", "Ahvenanmaan itsehallintopäivä"),
("2022-06-24", "Juhannusaatto"),
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Autonomy Day should not be in default-Finland expectations

Finland(years=2022) without subdiv="01" does not include Åland’s Autonomy Day.
This assertion will fail; remove the line or instantiate with the subdivision.

-            ("2022-06-09", "Ahvenanmaan itsehallintopäivä"),
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
("2022-06-09", "Ahvenanmaan itsehallintopäivä"),
("2022-06-24", "Juhannusaatto"),
("2022-06-24", "Juhannusaatto"),
🤖 Prompt for AI Agents (early access)
In tests/countries/test_finland.py around lines 440 to 441, the test incorrectly
expects Åland’s Autonomy Day to be present in the default Finland holidays for
2022, but it should only appear when the subdivision "01" is specified. Fix this
by either removing the line with Autonomy Day from the default Finland test or
by creating the Finland instance with subdiv="01" to include Åland’s holidays.

@PPsyrius PPsyrius force-pushed the ax_merge_cleanup branch from 6dfd249 to a0945c1 Compare May 9, 2025 05:51
@sonarqubecloud
Copy link

sonarqubecloud bot commented May 9, 2025

@codecov
Copy link

codecov bot commented May 9, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (a1d3b59) to head (a0945c1).

Additional details and impacted files
@@            Coverage Diff            @@
##               dev     #2536   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          215       216    +1     
  Lines        13665     13699   +34     
  Branches      1930      1934    +4     
=========================================
+ Hits         13665     13699   +34     

☔ 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 closed this May 9, 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.

Add Åland Islands holidays

2 participants