Skip to content

Update Norway holidays: update subdivision list as per 2024 administrative reform#2952

Merged
arkid15r merged 11 commits into
vacanza:devfrom
Exerqtor:patch-1
Sep 28, 2025
Merged

Update Norway holidays: update subdivision list as per 2024 administrative reform#2952
arkid15r merged 11 commits into
vacanza:devfrom
Exerqtor:patch-1

Conversation

@Exerqtor

@Exerqtor Exerqtor commented Sep 21, 2025

Copy link
Copy Markdown
Contributor

Proposed change

Viken county was disolved in 2024 with Østfold, Akershus & Buskerud being reinstated.

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

Viken was disolved in 2024 with Østfold, Akershus & Buskerud being reinstated.

Signed-off-by: Exerqtor <41635644+Exerqtor@users.noreply.github.com>

@PPsyrius PPsyrius left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

You'll need to do the following as well:

As far as I know, the official ISO-3166 entry for NO hasn’t been updated with the new counties list yet: https://www.iso.org/obp/ui/#iso:code:3166:NO - do you have references for these new county ISO codes?

@Exerqtor

Exerqtor commented Sep 21, 2025

Copy link
Copy Markdown
Contributor Author

Turns out it's been even more changes to the counties farther North as well, so I have to take a better look at it soon.

Regarding the ISO I have no idea, but it does look like it haven't been updated for some reason. Even though the counties have been officialy changed by the Norwegian goverment (linked site in Norwegian): https://www.regjeringen.no/no/tema/kommuner-og-regioner/kommunestruktur/nye-kommune-og-fylkesnummer-fra-1.-januar-2024/id2924701/

"Vestfold og Telemark" and "Troms og Finnmark" also got split up into four respective counties in 2024.

Signed-off-by: Exerqtor <41635644+Exerqtor@users.noreply.github.com>
Added `_deprecated_subdivisions` list.

Signed-off-by: Exerqtor <41635644+Exerqtor@users.noreply.github.com>
Added `setUp(self)` & `test_subdiv_deprecation`.

Signed-off-by: Exerqtor <41635644+Exerqtor@users.noreply.github.com>
@github-actions github-actions Bot added the test label Sep 21, 2025
Updated Norwegian counties.

Signed-off-by: Exerqtor <41635644+Exerqtor@users.noreply.github.com>
@PPsyrius PPsyrius changed the title Update to Norwegian counties Update Norway holidays: update subdivision list as per 2024 administrative reform Sep 22, 2025
Comment thread holidays/countries/norway.py Outdated
Comment thread tests/countries/test_norway.py
Signed-off-by: Panpakorn Siripanich <19505219+PPsyrius@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Sep 27, 2025

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • New Features

    • Updated Norway’s subdivisions to current counties: 31 Østfold, 32 Akershus, 33 Buskerud, 39 Vestfold, 40 Telemark, 55 Troms, 56 Finnmark. Older codes (30, 38, 54) now emit deprecation warnings to guide migration.
  • Documentation

    • Country table updated to reflect the new Norwegian subdivision list and names.
  • Tests

    • Added tests verifying deprecation behavior for retired Norwegian subdivision codes and adjusted test setup to suppress deprecation warnings.

Walkthrough

Replaced deprecated Norwegian subdivision codes 30, 38, 54 with new codes 31, 32, 33, 39, 40, 55, 56; updated subdivision names and aliases; added _deprecated_subdivisions; updated README Norway row; added tests to assert deprecation behavior and suppress warnings.

Changes

Cohort / File(s) Summary
Docs update
README.md
Norway table updated: removed 30/38/54; added 31/32/33/39/40/55/56; adjusted subdivision names and preserved language variants.
Country data: Norway
holidays/countries/norway.py
Updated subdivisions to replace Viken(30)/Vestfold og Telemark(38)/Troms og Finnmark(54) with 31 (Østfold), 32 (Akershus), 33 (Buskerud), 39 (Vestfold), 40 (Telemark), 55 (Troms/Romssa variants), 56 (Finnmark/Finnmárkku variants); updated subdivisions_aliases; added _deprecated_subdivisions = ["30","38","54"].
Tests
tests/countries/test_norway.py
Imported warnings; added setUp to ignore DeprecationWarning; added test_subdiv_deprecation asserting deprecation messages for retired subdivision codes.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Suggested reviewers

  • KJhellico
  • PPsyrius

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title Check ✅ Passed The title succinctly identifies that the pull request updates the Norway holiday subdivision list in accordance with the 2024 administrative reform, directly reflecting the main purpose of the changeset. It is clear, specific, and provides enough context for a reviewer to understand the primary focus without extraneous detail.
Description Check ✅ Passed The description clearly explains that Viken county was dissolved in 2024 and replaced by Østfold, Akershus, and Buskerud, which aligns directly with the subdivision list updates implemented in the pull request. It is on-topic and provides relevant context for the changes.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • 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 8f2e80b and f293a9a.

📒 Files selected for processing (2)
  • README.md (1 hunks)
  • holidays/countries/norway.py (2 hunks)
🧰 Additional context used
🧠 Learnings (15)
📓 Common learnings
Learnt from: PPsyrius
PR: vacanza/holidays#2638
File: holidays/countries/svalbard_and_jan_mayen.py:26-32
Timestamp: 2025-06-16T11:46:35.303Z
Learning: In the holidays library, Norwegian subdivisions all yield the same holiday results regardless of the subdivision code used. This is similar to how Åland is implemented as a simple alias of Finland holidays with just a country code override.
Learnt from: PPsyrius
PR: vacanza/holidays#2638
File: holidays/countries/svalbard_and_jan_mayen.py:26-32
Timestamp: 2025-06-16T11:46:35.303Z
Learning: In the holidays library, Norwegian subdivisions all yield the same holiday results regardless of the subdivision code used. This is similar to how Åland is implemented as a simple alias of Finland holidays with just a country code override.
Learnt from: PPsyrius
PR: vacanza/holidays#2638
File: holidays/countries/svalbard_and_jan_mayen.py:26-32
Timestamp: 2025-06-16T11:46:35.303Z
Learning: In the holidays library, Norwegian subdivisions all yield the same holiday results regardless of the subdivision code used. This is similar to how Åland is implemented as a simple alias of Finland holidays with just a country code override.
Learnt from: PPsyrius
PR: vacanza/holidays#2952
File: tests/countries/test_norway.py:25-27
Timestamp: 2025-09-27T05:11:09.451Z
Learning: In the vacanza/holidays project, the standard pattern for handling deprecation warnings in country test files is to use `warnings.simplefilter("ignore", category=DeprecationWarning)` in the setUp() method. This pattern is consistently used across multiple major country test files (USA, UK, Germany, France, Portugal, New Zealand, Norway) that have deprecated subdivisions and test them using `self.assertDeprecatedSubdivisions()`.
Learnt from: PPsyrius
PR: vacanza/holidays#2642
File: tests/countries/test_france.py:70-73
Timestamp: 2025-06-18T10:38:45.677Z
Learning: In the holidays library, the `assertDeprecatedSubdivisions` method uses a generic hard-coded message ("This subdivision is deprecated and will be removed") for all deprecated subdivision tests. This is the library-wide standard pattern, not specific to individual countries.
Learnt from: PPsyrius
PR: vacanza/holidays#2638
File: holidays/countries/svalbard_and_jan_mayen.py:26-32
Timestamp: 2025-06-16T11:46:35.303Z
Learning: When creating country holiday aliases that inherit from parent countries (like Svalbard and Jan Mayen from Norway, or Åland from Finland), it's standard practice to hardcode a specific subdivision code in the _populate methods since the subdivision codes for the parent country yield identical results. The Åland Islands implementation serves as the reference pattern for this approach.
📚 Learning: 2025-07-12T20:54:28.749Z
Learnt from: KJhellico
PR: vacanza/holidays#2719
File: README.md:108-108
Timestamp: 2025-07-12T20:54:28.749Z
Learning: In PR #2719 adding Faroe Islands, KJhellico confirmed that the country count in README.md should be updated from 213 to 214, making 214 the accurate total after this addition.

Applied to files:

  • README.md
📚 Learning: 2025-06-16T11:46:35.303Z
Learnt from: PPsyrius
PR: vacanza/holidays#2638
File: holidays/countries/svalbard_and_jan_mayen.py:26-32
Timestamp: 2025-06-16T11:46:35.303Z
Learning: In the holidays library, Norwegian subdivisions all yield the same holiday results regardless of the subdivision code used. This is similar to how Åland is implemented as a simple alias of Finland holidays with just a country code override.

Applied to files:

  • README.md
  • holidays/countries/norway.py
📚 Learning: 2025-06-16T11:46:35.303Z
Learnt from: PPsyrius
PR: vacanza/holidays#2638
File: holidays/countries/svalbard_and_jan_mayen.py:26-32
Timestamp: 2025-06-16T11:46:35.303Z
Learning: When creating country holiday aliases that inherit from parent countries (like Svalbard and Jan Mayen from Norway, or Åland from Finland), it's common and acceptable to hardcode a specific subdivision code since the subdivision codes for the parent country yield identical results.

Applied to files:

  • README.md
  • holidays/countries/norway.py
📚 Learning: 2025-06-18T10:18:59.447Z
Learnt from: PPsyrius
PR: vacanza/holidays#2642
File: holidays/countries/france.py:178-182
Timestamp: 2025-06-18T10:18:59.447Z
Learning: In the France holidays implementation, deprecated subdivision names like "Alsace-Moselle" and "Saint-Barthélémy" are handled through explicit conditionals in _populate_public_holidays() that map them to their corresponding new subdivision-specific holiday population methods, providing backward compatibility while users transition to the new ISO codes.

Applied to files:

  • holidays/countries/norway.py
📚 Learning: 2025-06-16T11:46:35.303Z
Learnt from: PPsyrius
PR: vacanza/holidays#2638
File: holidays/countries/svalbard_and_jan_mayen.py:26-32
Timestamp: 2025-06-16T11:46:35.303Z
Learning: When creating country holiday aliases that inherit from parent countries (like Svalbard and Jan Mayen from Norway, or Åland from Finland), it's standard practice to hardcode a specific subdivision code in the _populate methods since the subdivision codes for the parent country yield identical results. The Åland Islands implementation serves as the reference pattern for this approach.

Applied to files:

  • holidays/countries/norway.py
📚 Learning: 2025-06-18T10:07:58.780Z
Learnt from: PPsyrius
PR: vacanza/holidays#2642
File: holidays/countries/french_southern_territories.py:41-44
Timestamp: 2025-06-18T10:07:58.780Z
Learning: Territorial holiday classes that inherit from parent countries (like HolidaysAX from Finland, HolidaysSJ from Norway, HolidaysTF from France) follow a standard pattern of silently overriding self.subdiv in their _populate_public_holidays() method without validation, as this ensures they always use the correct subdivision code for their territory regardless of user input.

Applied to files:

  • holidays/countries/norway.py
📚 Learning: 2025-06-18T10:12:57.419Z
Learnt from: PPsyrius
PR: vacanza/holidays#2642
File: holidays/countries/france.py:178-182
Timestamp: 2025-06-18T10:12:57.419Z
Learning: In the France holidays implementation, subdivisions like "GES" and "Metropole" that covered multiple departments with different holiday rules are completely deprecated rather than aliased, because aliasing them to a subset (like Alsace-Moselle) would provide incomplete or incorrect holiday data for the other covered regions. Complete deprecation is preferred over partial/incorrect data coverage.

Applied to files:

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

Applied to files:

  • holidays/countries/norway.py
📚 Learning: 2025-04-06T17:44:24.598Z
Learnt from: PPsyrius
PR: vacanza/holidays#2439
File: holidays/calendars/thai.py:0-0
Timestamp: 2025-04-06T17:44:24.598Z
Learning: When making code suggestions, only include the specific lines that need to be changed in the committable suggestion part, without surrounding unrelated code.

Applied to files:

  • holidays/countries/norway.py
📚 Learning: 2025-06-05T18:24:26.712Z
Learnt from: PPsyrius
PR: vacanza/holidays#2600
File: holidays/countries/philippines.py:56-56
Timestamp: 2025-06-05T18:24:26.712Z
Learning: In the holidays repository, if code passes `make pre-commit` checks, then it's allowed regardless of individual static analysis tool warnings like Pylint line length violations. The pre-commit hooks are the definitive source of truth for their coding standards.

Applied to files:

  • holidays/countries/norway.py
📚 Learning: 2025-06-05T09:31:22.753Z
Learnt from: PPsyrius
PR: vacanza/holidays#2599
File: holidays/countries/__init__.py:193-193
Timestamp: 2025-06-05T09:31:22.753Z
Learning: For the holidays Python library, when encountering line length or formatting issues, suggest contributors run `make pre-commit` to auto-format their files instead of providing specific manual formatting fixes like line splitting or noqa comments.

Applied to files:

  • holidays/countries/norway.py
📚 Learning: 2025-06-04T11:06:21.179Z
Learnt from: PPsyrius
PR: vacanza/holidays#2594
File: holidays/countries/micronesia.py:25-30
Timestamp: 2025-06-04T11:06:21.179Z
Learning: In the holidays repository, line length formatting should defer to pre-commit formatting checks rather than manual suggestions. If pre-commit allows it, the formatting is acceptable per project policy.

Applied to files:

  • holidays/countries/norway.py
📚 Learning: 2025-06-16T15:48:33.931Z
Learnt from: PPsyrius
PR: vacanza/holidays#2615
File: tests/countries/test_anguilla.py:20-24
Timestamp: 2025-06-16T15:48:33.931Z
Learning: The holidays project uses `make pre-commit` test which includes `ruff` as the primary linter. If `ruff` passes, then Pylint warnings that don't appear in `ruff` are considered acceptable and can be ignored.

Applied to files:

  • holidays/countries/norway.py
📚 Learning: 2025-09-27T05:11:09.451Z
Learnt from: PPsyrius
PR: vacanza/holidays#2952
File: tests/countries/test_norway.py:25-27
Timestamp: 2025-09-27T05:11:09.451Z
Learning: In the vacanza/holidays project, the standard pattern for handling deprecation warnings in country test files is to use `warnings.simplefilter("ignore", category=DeprecationWarning)` in the setUp() method. This pattern is consistently used across multiple major country test files (USA, UK, Germany, France, Portugal, New Zealand, Norway) that have deprecated subdivisions and test them using `self.assertDeprecatedSubdivisions()`.

Applied to files:

  • holidays/countries/norway.py
🔇 Additional comments (1)
holidays/countries/norway.py (1)

63-78: Keep legacy county aliases routing to deprecated codes

We still have callers using Norway(subdiv="Viken") (and the combined Troms og Finnmark names). Dropping these aliases now makes them crash instead of flowing through the new _deprecated_subdivisions warning path. Let’s wire the legacy names back to their historical codes so they trigger the deprecation warning rather than an exception.

         "Svalbard": "21",
         "Jan Mayen": "22",
+        "Viken": "30",
         "Østfold": "31",
         "Akershus": "32",
         "Buskerud": "33",
         "Innlandet": "34",
+        "Vestfold og Telemark": "38",
         "Vestfold": "39",
         "Telemark": "40",
         "Agder": "42",
         "Vestland": "46",
         "Trööndelage": "50",
         "Trøndelag": "50",
+        "Troms og Finnmark": "54",
+        "Romssa ja Finnmárkku": "54",
         "Romssa": "55",
         "Troms": "55",
         "Tromssan": "55",
         "Finmarkun": "56",
         "Finnmark": "56",
         "Finnmárkku": "56",

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 Ruff (0.13.1)
holidays/countries/norway.py

�[1;31mruff failed�[0m
�[1mCause:�[0m Failed to load configuration /ruff.toml
�[1mCause:�[0m Failed to parse /ruff.toml
�[1mCause:�[0m TOML parse error at line 26, column 3
|
26 | "RSE100", # Use of assert detected
| ^^^^^^^^
Unknown rule selector: RSE100


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.

Signed-off-by: Panpakorn Siripanich <19505219+PPsyrius@users.noreply.github.com>
Signed-off-by: Panpakorn Siripanich <19505219+PPsyrius@users.noreply.github.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 3

📜 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 d891f60 and 2c46bac.

📒 Files selected for processing (3)
  • README.md (1 hunks)
  • holidays/countries/norway.py (2 hunks)
  • tests/countries/test_norway.py (2 hunks)
🧰 Additional context used
🧠 Learnings (19)
📓 Common learnings
Learnt from: PPsyrius
PR: vacanza/holidays#2638
File: holidays/countries/svalbard_and_jan_mayen.py:26-32
Timestamp: 2025-06-16T11:46:35.303Z
Learning: In the holidays library, Norwegian subdivisions all yield the same holiday results regardless of the subdivision code used. This is similar to how Åland is implemented as a simple alias of Finland holidays with just a country code override.
Learnt from: PPsyrius
PR: vacanza/holidays#2638
File: holidays/countries/svalbard_and_jan_mayen.py:26-32
Timestamp: 2025-06-16T11:46:35.303Z
Learning: In the holidays library, Norwegian subdivisions all yield the same holiday results regardless of the subdivision code used. This is similar to how Åland is implemented as a simple alias of Finland holidays with just a country code override.
Learnt from: PPsyrius
PR: vacanza/holidays#2638
File: holidays/countries/svalbard_and_jan_mayen.py:26-32
Timestamp: 2025-06-16T11:46:35.303Z
Learning: In the holidays library, Norwegian subdivisions all yield the same holiday results regardless of the subdivision code used. This is similar to how Åland is implemented as a simple alias of Finland holidays with just a country code override.
Learnt from: PPsyrius
PR: vacanza/holidays#2638
File: holidays/countries/svalbard_and_jan_mayen.py:26-32
Timestamp: 2025-06-16T11:46:35.303Z
Learning: When creating country holiday aliases that inherit from parent countries (like Svalbard and Jan Mayen from Norway, or Åland from Finland), it's standard practice to hardcode a specific subdivision code in the _populate methods since the subdivision codes for the parent country yield identical results. The Åland Islands implementation serves as the reference pattern for this approach.
Learnt from: PPsyrius
PR: vacanza/holidays#2638
File: holidays/countries/svalbard_and_jan_mayen.py:26-32
Timestamp: 2025-06-16T11:46:35.303Z
Learning: When creating country holiday aliases that inherit from parent countries (like Svalbard and Jan Mayen from Norway, or Åland from Finland), it's common and acceptable to hardcode a specific subdivision code since the subdivision codes for the parent country yield identical results.
Learnt from: PPsyrius
PR: vacanza/holidays#2638
File: holidays/countries/svalbard_and_jan_mayen.py:26-32
Timestamp: 2025-06-16T11:46:35.303Z
Learning: When creating country holiday aliases that inherit from parent countries (like Svalbard and Jan Mayen from Norway, or Åland from Finland), it's common and acceptable to hardcode a specific subdivision code since the subdivision codes for the parent country yield identical results.
📚 Learning: 2025-06-16T11:46:35.303Z
Learnt from: PPsyrius
PR: vacanza/holidays#2638
File: holidays/countries/svalbard_and_jan_mayen.py:26-32
Timestamp: 2025-06-16T11:46:35.303Z
Learning: In the holidays library, Norwegian subdivisions all yield the same holiday results regardless of the subdivision code used. This is similar to how Åland is implemented as a simple alias of Finland holidays with just a country code override.

Applied to files:

  • README.md
  • holidays/countries/norway.py
📚 Learning: 2025-06-16T11:46:35.303Z
Learnt from: PPsyrius
PR: vacanza/holidays#2638
File: holidays/countries/svalbard_and_jan_mayen.py:26-32
Timestamp: 2025-06-16T11:46:35.303Z
Learning: When creating country holiday aliases that inherit from parent countries (like Svalbard and Jan Mayen from Norway, or Åland from Finland), it's common and acceptable to hardcode a specific subdivision code since the subdivision codes for the parent country yield identical results.

Applied to files:

  • README.md
  • holidays/countries/norway.py
📚 Learning: 2025-06-18T10:18:59.447Z
Learnt from: PPsyrius
PR: vacanza/holidays#2642
File: holidays/countries/france.py:178-182
Timestamp: 2025-06-18T10:18:59.447Z
Learning: In the France holidays implementation, deprecated subdivision names like "Alsace-Moselle" and "Saint-Barthélémy" are handled through explicit conditionals in _populate_public_holidays() that map them to their corresponding new subdivision-specific holiday population methods, providing backward compatibility while users transition to the new ISO codes.

Applied to files:

  • holidays/countries/norway.py
📚 Learning: 2025-06-18T10:07:58.780Z
Learnt from: PPsyrius
PR: vacanza/holidays#2642
File: holidays/countries/french_southern_territories.py:41-44
Timestamp: 2025-06-18T10:07:58.780Z
Learning: Territorial holiday classes that inherit from parent countries (like HolidaysAX from Finland, HolidaysSJ from Norway, HolidaysTF from France) follow a standard pattern of silently overriding self.subdiv in their _populate_public_holidays() method without validation, as this ensures they always use the correct subdivision code for their territory regardless of user input.

Applied to files:

  • holidays/countries/norway.py
📚 Learning: 2025-06-16T11:46:35.303Z
Learnt from: PPsyrius
PR: vacanza/holidays#2638
File: holidays/countries/svalbard_and_jan_mayen.py:26-32
Timestamp: 2025-06-16T11:46:35.303Z
Learning: When creating country holiday aliases that inherit from parent countries (like Svalbard and Jan Mayen from Norway, or Åland from Finland), it's standard practice to hardcode a specific subdivision code in the _populate methods since the subdivision codes for the parent country yield identical results. The Åland Islands implementation serves as the reference pattern for this approach.

Applied to files:

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

Applied to files:

  • holidays/countries/norway.py
📚 Learning: 2025-04-06T17:44:24.598Z
Learnt from: PPsyrius
PR: vacanza/holidays#2439
File: holidays/calendars/thai.py:0-0
Timestamp: 2025-04-06T17:44:24.598Z
Learning: When making code suggestions, only include the specific lines that need to be changed in the committable suggestion part, without surrounding unrelated code.

Applied to files:

  • holidays/countries/norway.py
📚 Learning: 2025-06-05T18:24:26.712Z
Learnt from: PPsyrius
PR: vacanza/holidays#2600
File: holidays/countries/philippines.py:56-56
Timestamp: 2025-06-05T18:24:26.712Z
Learning: In the holidays repository, if code passes `make pre-commit` checks, then it's allowed regardless of individual static analysis tool warnings like Pylint line length violations. The pre-commit hooks are the definitive source of truth for their coding standards.

Applied to files:

  • holidays/countries/norway.py
📚 Learning: 2025-06-05T09:31:22.753Z
Learnt from: PPsyrius
PR: vacanza/holidays#2599
File: holidays/countries/__init__.py:193-193
Timestamp: 2025-06-05T09:31:22.753Z
Learning: For the holidays Python library, when encountering line length or formatting issues, suggest contributors run `make pre-commit` to auto-format their files instead of providing specific manual formatting fixes like line splitting or noqa comments.

Applied to files:

  • holidays/countries/norway.py
📚 Learning: 2025-06-04T11:06:21.179Z
Learnt from: PPsyrius
PR: vacanza/holidays#2594
File: holidays/countries/micronesia.py:25-30
Timestamp: 2025-06-04T11:06:21.179Z
Learning: In the holidays repository, line length formatting should defer to pre-commit formatting checks rather than manual suggestions. If pre-commit allows it, the formatting is acceptable per project policy.

Applied to files:

  • holidays/countries/norway.py
📚 Learning: 2025-06-16T15:48:33.931Z
Learnt from: PPsyrius
PR: vacanza/holidays#2615
File: tests/countries/test_anguilla.py:20-24
Timestamp: 2025-06-16T15:48:33.931Z
Learning: The holidays project uses `make pre-commit` test which includes `ruff` as the primary linter. If `ruff` passes, then Pylint warnings that don't appear in `ruff` are considered acceptable and can be ignored.

Applied to files:

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

Applied to files:

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

Applied to files:

  • tests/countries/test_norway.py
📚 Learning: 2025-08-09T18:31:23.218Z
Learnt from: KJhellico
PR: vacanza/holidays#2778
File: tests/countries/test_kiribati.py:15-15
Timestamp: 2025-08-09T18:31:23.218Z
Learning: In the holidays project test files, the standard import pattern is `from holidays.countries.<country> import Country, CODE1, CODE2` (used in ~97% of test files), not `from holidays.countries import Country, CODE1, CODE2`. Only a few exceptions (Suriname, Sierra Leone, Mauritius, Mali, Ivory Coast, Guyana) use the aggregated import pattern.

Applied to files:

  • tests/countries/test_norway.py
📚 Learning: 2025-06-18T17:01:58.067Z
Learnt from: PPsyrius
PR: vacanza/holidays#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_norway.py
📚 Learning: 2025-08-20T19:46:15.625Z
Learnt from: KJhellico
PR: vacanza/holidays#2833
File: tests/countries/test_uganda.py:15-0
Timestamp: 2025-08-20T19:46:15.625Z
Learning: In the holidays project, the standard import pattern for country test files is `from holidays.countries.<country> import Country, CODE1, CODE2` (direct module import), used by ~75% of country test files. Only a minority (~25%) use the aggregated public API import `from holidays.countries import Country, CODE1, CODE2`. The direct module import pattern should be used for new country test files to follow the established convention.

Applied to files:

  • tests/countries/test_norway.py
📚 Learning: 2025-04-05T04:33:53.254Z
Learnt from: PPsyrius
PR: vacanza/holidays#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_norway.py
📚 Learning: 2025-06-16T15:48:48.680Z
Learnt from: PPsyrius
PR: vacanza/holidays#2615
File: tests/countries/test_anguilla.py:1-12
Timestamp: 2025-06-16T15:48:48.680Z
Learning: Test files in the holidays repository follow a standardized structure without module or class docstrings. All country test files use the same pattern: license header, imports, and class definition (`class Test{Country}(CommonCountryTests, TestCase):`) without docstrings. This is an established codebase convention that should be maintained for consistency.

Applied to files:

  • tests/countries/test_norway.py
🧬 Code graph analysis (1)
tests/countries/test_norway.py (1)
tests/common.py (2)
  • setUp (58-68)
  • assertDeprecatedSubdivisions (135-142)

Comment thread holidays/countries/norway.py
Comment thread README.md Outdated
Comment thread tests/countries/test_norway.py
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Signed-off-by: Panpakorn Siripanich <19505219+PPsyrius@users.noreply.github.com>
@codecov

codecov Bot commented Sep 27, 2025

Copy link
Copy Markdown

Codecov Report

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

Additional details and impacted files
@@            Coverage Diff            @@
##               dev     #2952   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          301       301           
  Lines        17978     17979    +1     
  Branches      2328      2328           
=========================================
+ Hits         17978     17979    +1     

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

@KJhellico

Copy link
Copy Markdown
Collaborator

The code is LGTM, but I am concerned about the absence of these changes in ISO.

@Exerqtor

Exerqtor commented Sep 27, 2025

Copy link
Copy Markdown
Contributor Author

I haven't had time to do the changes during the work week, but @PPsyrius beat me to it and fixed it. Thx!

Regarding the ISO it ain't much I can do obviously, and I haven't got an answer for why it haven't been updated.

Regardless "ISO 3166-2:NO" is in this point of time "outdated" / wrong when compared to the state/government enforced changes which where put in effect 1 January 2024.

KJhellico
KJhellico previously approved these changes Sep 27, 2025

@KJhellico KJhellico left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM.

@sonarqubecloud

Copy link
Copy Markdown

@arkid15r arkid15r enabled auto-merge September 28, 2025 18:34
@arkid15r arkid15r added this pull request to the merge queue Sep 28, 2025
Merged via the queue into vacanza:dev with commit 734a645 Sep 28, 2025
36 checks passed
@arkid15r arkid15r mentioned this pull request Oct 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants