-
-
Notifications
You must be signed in to change notification settings - Fork 554
Add Solomon Islands holidays #2632
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Summary by CodeRabbit
Summary by CodeRabbit
WalkthroughSupport for Solomon Islands holidays was added. This included updates to documentation, new country-specific holiday definitions and logic, registration of the country in the registry, corresponding import statements, and a full suite of unit tests covering national and subdivision holidays. Changes
Assessment against linked issues
Assessment against linked issues: Out-of-scope changesNo out-of-scope changes detected. Suggested reviewers
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (14)
🧰 Additional context used🧠 Learnings (11)📓 Common learnings
snapshots/countries/SB_WE.json (1)
snapshots/countries/SB_TE.json (1)
snapshots/countries/SB_CH.json (1)
snapshots/countries/SB_RB.json (1)
snapshots/countries/SB_CE.json (1)
snapshots/countries/SB_IS.json (1)
snapshots/countries/SB_COMMON.json (1)
snapshots/countries/SB_MK.json (1)
snapshots/countries/SB_ML.json (1)
snapshots/countries/SB_CT.json (1)
🧬 Code Graph Analysis (1)holidays/countries/__init__.py (1)
🔇 Additional comments (15)
✨ Finishing Touches
🧪 Generate Unit Tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed 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)
Other keywords and placeholders
Documentation and Community
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #2632 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 234 235 +1
Lines 14806 14869 +63
Branches 2060 2063 +3
=========================================
+ Hits 14806 14869 +63 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
🔭 Outside diff range comments (1)
holidays/countries/solomon_islands.py (1)
170-187
:⚠️ Potential issueIncomplete line at the end of file.
Line 187 appears to be truncated or incomplete. Consider removing it or completing the definition if something is missing.
- special_gu_public_holidays = {2020: (NOV, 18, "Public Holiday")} - + special_gu_public_holidays = {2020: (NOV, 18, "Public Holiday")}🧰 Tools
🪛 Pylint (3.3.7)
[convention] 174-174: Line too long (162/100)
(C0301)
[convention] 175-175: Line too long (164/100)
(C0301)
[convention] 176-176: Line too long (172/100)
(C0301)
[refactor] 170-170: Too few public methods (0/2)
(R0903)
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (5)
README.md
(2 hunks)holidays/countries/__init__.py
(1 hunks)holidays/countries/solomon_islands.py
(1 hunks)holidays/registry.py
(1 hunks)tests/countries/test_solomon_islands.py
(1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
holidays/countries/__init__.py (1)
holidays/countries/solomon_islands.py (3)
SolomonIslands
(23-159)SB
(162-163)SLB
(166-167)
🪛 Pylint (3.3.7)
tests/countries/test_solomon_islands.py
[convention] 1-1: Missing module docstring
(C0114)
[convention] 20-20: Missing class docstring
(C0115)
[warning] 22-22: Number of parameters was 4 in 'TestCase.setUpClass' and is now 1 in overriding 'TestSolomonIslands.setUpClass' method
(W0221)
[convention] 33-33: Missing function or method docstring
(C0116)
[convention] 36-36: Missing function or method docstring
(C0116)
[convention] 39-39: Missing function or method docstring
(C0116)
[convention] 51-51: Missing function or method docstring
(C0116)
[convention] 62-62: Missing function or method docstring
(C0116)
[convention] 76-76: Missing function or method docstring
(C0116)
[convention] 90-90: Missing function or method docstring
(C0116)
[convention] 104-104: Missing function or method docstring
(C0116)
[convention] 118-118: Missing function or method docstring
(C0116)
[convention] 145-145: Missing function or method docstring
(C0116)
[convention] 156-156: Missing function or method docstring
(C0116)
[convention] 169-169: Missing function or method docstring
(C0116)
[convention] 198-198: Missing function or method docstring
(C0116)
[convention] 207-207: Missing function or method docstring
(C0116)
[convention] 214-214: Missing function or method docstring
(C0116)
[convention] 221-221: Missing function or method docstring
(C0116)
[convention] 228-228: Missing function or method docstring
(C0116)
[convention] 235-235: Missing function or method docstring
(C0116)
[convention] 242-242: Missing function or method docstring
(C0116)
[convention] 249-249: Missing function or method docstring
(C0116)
[convention] 256-256: Missing function or method docstring
(C0116)
[convention] 263-263: Missing function or method docstring
(C0116)
[refactor] 20-20: Too many public methods (23/20)
(R0904)
holidays/countries/solomon_islands.py
[convention] 29-29: Line too long (134/100)
(C0301)
[convention] 40-40: Line too long (173/100)
(C0301)
[convention] 41-41: Line too long (175/100)
(C0301)
[convention] 47-47: Line too long (147/100)
(C0301)
[convention] 48-48: Line too long (122/100)
(C0301)
[convention] 174-174: Line too long (162/100)
(C0301)
[convention] 175-175: Line too long (164/100)
(C0301)
[convention] 176-176: Line too long (172/100)
(C0301)
[convention] 1-1: Missing module docstring
(C0114)
[convention] 162-162: Missing class docstring
(C0115)
[convention] 166-166: Missing class docstring
(C0115)
[refactor] 170-170: Too few public methods (0/2)
(R0903)
⏰ Context from checks skipped due to timeout of 300000ms (2)
- GitHub Check: Test docs build
- GitHub Check: Build distribution
🔇 Additional comments (7)
holidays/countries/solomon_islands.py (3)
23-87
: Well-structured holiday class implementation.The class properly inherits from all necessary base classes and defines subdivisions comprehensively. The documentation with official references is thorough.
🧰 Tools
🪛 Pylint (3.3.7)
[convention] 29-29: Line too long (134/100)
(C0301)
[convention] 40-40: Line too long (173/100)
(C0301)
[convention] 41-41: Line too long (175/100)
(C0301)
[convention] 47-47: Line too long (147/100)
(C0301)
[convention] 48-48: Line too long (122/100)
(C0301)
88-133
: Holiday implementation correctly handles royal transition and observance rules.The Queen's/King's Birthday logic properly accounts for the 2023 transition and documented exceptions. Different observance rules for Christmas holidays follow the official gazette patterns.
134-160
: Clean implementation of province-specific holidays.The dictionary-based approach for province days is efficient and maintainable.
holidays/registry.py (1)
178-178
: Registry entry correctly added.The Solomon Islands entry follows the standard format and maintains alphabetical ordering.
holidays/countries/__init__.py (1)
175-175
: Import statement properly added.The import follows the standard pattern and maintains alphabetical ordering.
README.md (1)
108-108
: Documentation properly updated.The country count is correctly incremented and the Solomon Islands entry includes all subdivisions with accurate information.
Also applies to: 1235-1240
tests/countries/test_solomon_islands.py (1)
20-276
: Comprehensive test coverage for Solomon Islands holidays.The tests thoroughly cover all holiday types, observance rules, and province-specific holidays with both positive and negative test cases.
🧰 Tools
🪛 Pylint (3.3.7)
[convention] 20-20: Missing class docstring
(C0115)
[warning] 22-22: Number of parameters was 4 in 'TestCase.setUpClass' and is now 1 in overriding 'TestSolomonIslands.setUpClass' method
(W0221)
[convention] 33-33: Missing function or method docstring
(C0116)
[convention] 36-36: Missing function or method docstring
(C0116)
[convention] 39-39: Missing function or method docstring
(C0116)
[convention] 51-51: Missing function or method docstring
(C0116)
[convention] 62-62: Missing function or method docstring
(C0116)
[convention] 76-76: Missing function or method docstring
(C0116)
[convention] 90-90: Missing function or method docstring
(C0116)
[convention] 104-104: Missing function or method docstring
(C0116)
[convention] 118-118: Missing function or method docstring
(C0116)
[convention] 145-145: Missing function or method docstring
(C0116)
[convention] 156-156: Missing function or method docstring
(C0116)
[convention] 169-169: Missing function or method docstring
(C0116)
[convention] 198-198: Missing function or method docstring
(C0116)
[convention] 207-207: Missing function or method docstring
(C0116)
[convention] 214-214: Missing function or method docstring
(C0116)
[convention] 221-221: Missing function or method docstring
(C0116)
[convention] 228-228: Missing function or method docstring
(C0116)
[convention] 235-235: Missing function or method docstring
(C0116)
[convention] 242-242: Missing function or method docstring
(C0116)
[convention] 249-249: Missing function or method docstring
(C0116)
[convention] 256-256: Missing function or method docstring
(C0116)
[convention] 263-263: Missing function or method docstring
(C0116)
[refactor] 20-20: Too many public methods (23/20)
(R0904)
Co-authored-by: Panpakorn Siripanich <19505219+PPsyrius@users.noreply.github.com> Signed-off-by: Kriti Birda <164247895+kritibirda26@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I took a look at CanadaTests to try fix this but it seems to be defining subdiv_holidays in a similar way without mypy complaining there. How do I fix this error properly?
This seems to work with mypy
, but I'm not so sure with doing them that way - I think the current # type: ignore
looks better 😔 - what do you think? @KJhellico @arkid15r
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
🔭 Outside diff range comments (1)
holidays/countries/solomon_islands.py (1)
170-188
: 🛠️ Refactor suggestionStatic-holiday dicts look good but lack subdivision routing
special_ch_public_holidays
&special_gu_public_holidays
will be ignored unlessStaticHolidays
is patched to route onsubdiv
. That support exists upstream only for keys named<subdiv>_special_public_holidays
.
Rename the dicts accordingly to ensure they load:- special_ch_public_holidays = {2020: (NOV, 18, name)} - special_gu_public_holidays = {2020: (NOV, 18, name)} + ch_special_public_holidays = {2020: (NOV, 18, name)} + gu_special_public_holidays = {2020: (NOV, 18, name)}🧰 Tools
🪛 Pylint (3.3.7)
[convention] 174-174: Line too long (162/100)
(C0301)
[convention] 175-175: Line too long (164/100)
(C0301)
[convention] 176-176: Line too long (172/100)
(C0301)
[refactor] 170-170: Too few public methods (0/2)
(R0903)
🪛 GitHub Actions: CI/CD
[error] 175-175: Ruff format hook failed: file was reformatted by the hook. Run 'ruff --fix' or 'pre-commit run --all-files' locally to fix formatting issues.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (2)
README.md
(2 hunks)holidays/countries/solomon_islands.py
(1 hunks)
🧰 Additional context used
🪛 Pylint (3.3.7)
holidays/countries/solomon_islands.py
[convention] 29-29: Line too long (134/100)
(C0301)
[convention] 40-40: Line too long (173/100)
(C0301)
[convention] 41-41: Line too long (175/100)
(C0301)
[convention] 47-47: Line too long (147/100)
(C0301)
[convention] 48-48: Line too long (122/100)
(C0301)
[convention] 174-174: Line too long (162/100)
(C0301)
[convention] 175-175: Line too long (164/100)
(C0301)
[convention] 176-176: Line too long (172/100)
(C0301)
[convention] 1-1: Missing module docstring
(C0114)
[convention] 162-162: Missing class docstring
(C0115)
[convention] 166-166: Missing class docstring
(C0115)
[refactor] 170-170: Too few public methods (0/2)
(R0903)
🪛 GitHub Actions: CI/CD
holidays/countries/solomon_islands.py
[error] 175-175: Ruff format hook failed: file was reformatted by the hook. Run 'ruff --fix' or 'pre-commit run --all-files' locally to fix formatting issues.
🔇 Additional comments (3)
README.md (2)
108-117
: Country count hard-coded—consider deriving it automaticallyThe total country count stating “189” will drift the next time a country is added (or removed) unless someone remembers to update the number again. It’s easy to forget and CI didn’t catch it here.
A tiny helper in the docs-build step (e.g. parsing the registry and injecting the value) keeps the README self-healing and avoids future off-by-one edits.Would you like a quick snippet that counts the entries in
holidays/registry.py
and replaces the figure during the docs build?🧰 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)
[uncategorized] ~114-~114: You might be missing the article “the” here.
Context: ...utput. A default language is defined bydefault_language
(optional) attribute f...(AI_EN_LECTOR_MISSING_DETERMINER_THE)
1235-1240
: 👍 Row inserted in correct alphabetical orderSolomon Islands is slotted between Slovenia and South Africa, as expected. Subdivision codes match those in the implementation file.
holidays/countries/solomon_islands.py (1)
90-91
: New Year’s Day: Saturday case silently ignoredYou override the default rule and pass
rule=SUN_TO_NEXT_MON
, so if 1 Jan falls on a Saturday the prior-Friday shift defined inobserved_rule
is lost. Was that intentional?
If not, drop the explicitrule
so the combined SAT/SUN rule from__init__
applies:- self._add_observed(self._add_new_years_day("New Year's Day"), rule=SUN_TO_NEXT_MON) + self._add_observed(self._add_new_years_day("New Year's Day"))
Co-authored-by: Panpakorn Siripanich <19505219+PPsyrius@users.noreply.github.com> Signed-off-by: Kriti Birda <164247895+kritibirda26@users.noreply.github.com>
There was a problem hiding this 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
♻️ Duplicate comments (2)
holidays/countries/solomon_islands.py (2)
29-48
: CI still fails on line-length / formattingSeveral lines exceed 100 chars, and the module docstring is missing – the same issues flagged earlier.
Runruff format
(orpre-commit run --all-files
) to satisfy the style gate before the pipeline runs again.🧰 Tools
🪛 Pylint (3.3.7)
[convention] 29-29: Line too long (134/100)
(C0301)
[convention] 40-40: Line too long (173/100)
(C0301)
[convention] 41-41: Line too long (175/100)
(C0301)
[convention] 47-47: Line too long (147/100)
(C0301)
[convention] 48-48: Line too long (122/100)
(C0301)
111-118
: 🛠️ Refactor suggestionDuplicate Saturday + Friday entry for Sovereign’s Birthday
_add_observed(self._add_holiday_2nd_sat_of_jun(name))
keeps the original Saturday holiday and then adds an “(observed)” Friday, so two public-holiday keys are produced for pre-2023 years. The gazette lists only the Friday.- self._add_observed(self._add_holiday_2nd_sat_of_jun(name)) + # Move the Saturday holiday to the previous Friday and drop the original. + self._move_holiday(self._add_holiday_2nd_sat_of_jun(name))
_move_holiday()
removes the Saturday entry, leaving a single Friday record with the observed label.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (1)
holidays/countries/solomon_islands.py
(1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
holidays/countries/solomon_islands.py (5)
holidays/groups/christian.py (6)
_add_good_friday
(308-317)_add_holy_saturday
(319-326)_add_easter_monday
(259-268)_add_whit_monday
(432-441)_add_christmas_day
(208-216)_add_christmas_day_two
(218-226)holidays/groups/international.py (1)
_add_new_years_day
(126-134)holidays/groups/custom.py (1)
StaticHolidays
(18-47)holidays/observed_holiday_base.py (1)
ObservedHolidayBase
(101-243)holidays/holiday_base.py (1)
_add_holiday
(819-831)
🪛 Pylint (3.3.7)
holidays/countries/solomon_islands.py
[convention] 29-29: Line too long (134/100)
(C0301)
[convention] 40-40: Line too long (173/100)
(C0301)
[convention] 41-41: Line too long (175/100)
(C0301)
[convention] 47-47: Line too long (147/100)
(C0301)
[convention] 48-48: Line too long (122/100)
(C0301)
[convention] 174-174: Line too long (162/100)
(C0301)
[convention] 175-175: Line too long (164/100)
(C0301)
[convention] 176-176: Line too long (172/100)
(C0301)
[convention] 1-1: Missing module docstring
(C0114)
[convention] 162-162: Missing class docstring
(C0115)
[convention] 166-166: Missing class docstring
(C0115)
[refactor] 170-170: Too few public methods (0/2)
(R0903)
⏰ Context from checks skipped due to timeout of 300000ms (2)
- GitHub Check: Test docs build
- GitHub Check: Build distribution
🔇 Additional comments (2)
holidays/countries/solomon_islands.py (2)
128-132
: Observed-rule asymmetry for Christmas & Boxing DayUsing
SAT_SUN_TO_NEXT_MON_TUE
means a Saturday Christmas moves forward to Monday, whereas other fixed-date holidays (e.g. Independence Day) move back to Friday. Confirm this mirrors gazette practice; if not, adopt the default combined rule.
85-91
:❓ Verification inconclusive
Check New Year’s Day Saturday handling
Here you override the rule with
SUN_TO_NEXT_MON
, so 1 Jan 2028 (a Saturday) would not shift to Friday, even though the Act’s Saturday-to-Friday convention is applied elsewhere. Was this intentional?
🏁 Script executed:
#!/bin/bash # Show how New Year's Day is stored for 2028 python - <<'PY' import holidays, datetime as dt print(holidays.country_holidays("SB", years=[2028])[dt.date(2028, 1, 1):dt.date(2028, 1, 3)]) PYLength of output: 38
Review New Year’s Day observed logic
The New Year’s Day override only applies
SUN_TO_NEXT_MON
, so 2028-01-01 (Saturday) doesn’t shift to Friday. The output for 2028 shows:{datetime.date(2028, 1, 1)}
Should we include
SAT_TO_PREV_FRI
here as well?• File: holidays/countries/solomon_islands.py (lines 85–91)
• Current snippet:kwargs.setdefault("observed_rule", SUN_TO_NEXT_MON + SAT_TO_PREV_FRI) … self._add_observed( self._add_new_years_day("New Year's Day"), rule=SUN_TO_NEXT_MON )
Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com> Signed-off-by: Kriti Birda <164247895+kritibirda26@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (2)
holidays/countries/solomon_islands.py
(1 hunks)tests/countries/test_solomon_islands.py
(1 hunks)
🧰 Additional context used
🧠 Learnings (1)
holidays/countries/solomon_islands.py (2)
Learnt from: PPsyrius
PR: vacanza/holidays#2632
File: holidays/countries/solomon_islands.py:137-156
Timestamp: 2025-06-15T08:29:43.208Z
Learning: In Solomon Islands holidays implementation, Capital Territory (CT/Honiara) does not observe any provincial day holiday, including Guadalcanal's Province Day, despite being geographically located on Guadalcanal island. CT was split from Guadalcanal Province in 1983 to become a separate self-governing territory and does not have or observe provincial day holidays.
Learnt from: KJhellico
PR: vacanza/holidays#2386
File: holidays/countries/nepal.py:24-26
Timestamp: 2025-03-30T20:18:46.006Z
Learning: In the holidays library, country classes do not directly implement `_populate()`. Instead, they implement specialized methods like `_populate_public_holidays()`, and the base class `HolidayBase` handles the orchestration by calling these specialized methods.
🧬 Code Graph Analysis (2)
tests/countries/test_solomon_islands.py (2)
tests/common.py (9)
CommonCountryTests
(356-374)assertAliases
(121-130)assertNoHolidays
(292-294)assertHolidayName
(195-199)assertNoHoliday
(244-246)assertNoNonObservedHoliday
(248-250)assertNoNonObservedHolidayName
(277-279)assertNoHolidayName
(273-275)assertHolidays
(228-230)holidays/countries/solomon_islands.py (3)
SolomonIslands
(23-167)SB
(170-171)SLB
(174-175)
holidays/countries/solomon_islands.py (5)
holidays/groups/christian.py (6)
_add_good_friday
(308-317)_add_holy_saturday
(319-326)_add_easter_monday
(259-268)_add_whit_monday
(432-441)_add_christmas_day
(208-216)_add_christmas_day_two
(218-226)holidays/groups/international.py (1)
_add_new_years_day
(126-134)holidays/groups/custom.py (1)
StaticHolidays
(18-47)holidays/observed_holiday_base.py (1)
ObservedHolidayBase
(101-243)holidays/holiday_base.py (1)
_add_holiday
(819-831)
🪛 Pylint (3.3.7)
tests/countries/test_solomon_islands.py
[convention] 1-1: Missing module docstring
(C0114)
[convention] 20-20: Missing class docstring
(C0115)
[warning] 22-22: Number of parameters was 4 in 'TestCase.setUpClass' and is now 1 in overriding 'TestSolomonIslands.setUpClass' method
(W0221)
[convention] 34-34: Missing function or method docstring
(C0116)
[convention] 37-37: Missing function or method docstring
(C0116)
[convention] 40-40: Missing function or method docstring
(C0116)
[convention] 52-52: Missing function or method docstring
(C0116)
[convention] 63-63: Missing function or method docstring
(C0116)
[convention] 77-77: Missing function or method docstring
(C0116)
[convention] 91-91: Missing function or method docstring
(C0116)
[convention] 105-105: Missing function or method docstring
(C0116)
[convention] 119-119: Missing function or method docstring
(C0116)
[convention] 146-146: Missing function or method docstring
(C0116)
[convention] 157-157: Missing function or method docstring
(C0116)
[convention] 170-170: Missing function or method docstring
(C0116)
[convention] 201-201: Missing function or method docstring
(C0116)
[convention] 211-211: Missing function or method docstring
(C0116)
[convention] 218-218: Missing function or method docstring
(C0116)
[convention] 225-225: Missing function or method docstring
(C0116)
[convention] 232-232: Missing function or method docstring
(C0116)
[convention] 239-239: Missing function or method docstring
(C0116)
[convention] 246-246: Missing function or method docstring
(C0116)
[convention] 253-253: Missing function or method docstring
(C0116)
[convention] 260-260: Missing function or method docstring
(C0116)
[convention] 267-267: Missing function or method docstring
(C0116)
[refactor] 20-20: Too many public methods (23/20)
(R0904)
holidays/countries/solomon_islands.py
[convention] 29-29: Line too long (134/100)
(C0301)
[convention] 30-30: Line too long (128/100)
(C0301)
[convention] 31-31: Line too long (158/100)
(C0301)
[convention] 32-32: Line too long (153/100)
(C0301)
[convention] 45-45: Line too long (165/100)
(C0301)
[convention] 46-46: Line too long (167/100)
(C0301)
[convention] 182-182: Line too long (162/100)
(C0301)
[convention] 183-183: Line too long (164/100)
(C0301)
[convention] 184-184: Line too long (172/100)
(C0301)
[convention] 1-1: Missing module docstring
(C0114)
[convention] 170-170: Missing class docstring
(C0115)
[convention] 174-174: Missing class docstring
(C0115)
[refactor] 178-178: Too few public methods (0/2)
(R0903)
🪛 GitHub Actions: CI/CD
tests/countries/test_solomon_islands.py
[error] 216-216: Test failure in TestSolomonIslands.test_choiseul_province_day due to dateutil.parser.ParserError: Unknown string format with invalid date string containing a list instead of a single date.
[error] 223-223: Test failure in TestSolomonIslands.test_guadalcanal_province_day due to dateutil.parser.ParserError: Unknown string format with invalid date string containing a list instead of a single date.
[error] 230-230: Test failure in TestSolomonIslands.test_isabel_province_day due to dateutil.parser.ParserError: Unknown string format with invalid date string containing a list instead of a single date.
[error] 237-237: Test failure in TestSolomonIslands.test_makira_ulawa_province_day due to dateutil.parser.ParserError: Unknown string format with invalid date string containing a list instead of a single date.
[error] 244-244: Test failure in TestSolomonIslands.test_malaita_province_day due to dateutil.parser.ParserError: Unknown string format with invalid date string containing a list instead of a single date.
[error] 251-251: Test failure in TestSolomonIslands.test_rennell_and_bellona_province_day due to dateutil.parser.ParserError: Unknown string format with invalid date string containing a list instead of a single date.
[error] 258-258: Test failure in TestSolomonIslands.test_temotu_province_day due to dateutil.parser.ParserError: Unknown string format with invalid date string containing a list instead of a single date.
[error] 265-265: Test failure in TestSolomonIslands.test_western_province_day due to dateutil.parser.ParserError: Unknown string format with invalid date string containing a list instead of a single date.
🔇 Additional comments (2)
holidays/countries/solomon_islands.py (2)
86-92
: Default observed rule wired in correctly – nice touch
setdefault("observed_rule", SUN_TO_NEXT_MON + SAT_TO_PREV_FRI)
makes the instance honour both Sunday-to-Monday and Saturday-to-Friday shifts while still allowing a caller to override. Clean and future-proof.
109-126
: Birthday logic reads clearly and handles the outliersThe ternary for the King/Queen label + the
sovereign_birthday_dates
override table together cover the rule-change (2023→) and the 2022 / 2025 exceptions. Implementation mirrors the gazette exactly—LGTM.
There was a problem hiding this 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
♻️ Duplicate comments (1)
tests/countries/test_solomon_islands.py (1)
191-199
: 🛠️ Refactor suggestionAvoid in-loop mutation of
name
– it breaks subsequent assertions
name
is reassigned to its “ (observed)” variant while thefor
loop is still iterating.
All iterations after the matching subdivision now see the mutated value, so theelse
branch no longer checks for the original holiday name in the remaining subdivisions
(coverage gap + potential false positives).- name = f"{name} (observed)" - self.assertHolidayName(name, holidays, observed_dts) + observed_name = f"{name} (observed)" + self.assertHolidayName(observed_name, holidays, observed_dts) ... - self.assertNoHolidayName(name, holidays, range(1979, 2050)) + self.assertNoHolidayName(name, holidays, range(1979, 2050)) + self.assertNoHolidayName(observed_name, holidays, range(1979, 2050))Same issue was raised earlier but remains unfixed.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (2)
holidays/countries/solomon_islands.py
(1 hunks)tests/countries/test_solomon_islands.py
(1 hunks)
🧰 Additional context used
🧠 Learnings (1)
holidays/countries/solomon_islands.py (2)
Learnt from: PPsyrius
PR: vacanza/holidays#2632
File: holidays/countries/solomon_islands.py:137-156
Timestamp: 2025-06-15T08:29:43.208Z
Learning: In Solomon Islands holidays implementation, Capital Territory (CT/Honiara) does not observe any provincial day holiday, including Guadalcanal's Province Day, despite being geographically located on Guadalcanal island. CT was split from Guadalcanal Province in 1983 to become a separate self-governing territory and does not have or observe provincial day holidays.
Learnt from: KJhellico
PR: vacanza/holidays#2386
File: holidays/countries/nepal.py:24-26
Timestamp: 2025-03-30T20:18:46.006Z
Learning: In the holidays library, country classes do not directly implement `_populate()`. Instead, they implement specialized methods like `_populate_public_holidays()`, and the base class `HolidayBase` handles the orchestration by calling these specialized methods.
🪛 Pylint (3.3.7)
tests/countries/test_solomon_islands.py
[convention] 1-1: Missing module docstring
(C0114)
[convention] 20-20: Missing class docstring
(C0115)
[warning] 22-22: Number of parameters was 4 in 'TestCase.setUpClass' and is now 1 in overriding 'TestSolomonIslands.setUpClass' method
(W0221)
[convention] 34-34: Missing function or method docstring
(C0116)
[convention] 37-37: Missing function or method docstring
(C0116)
[convention] 40-40: Missing function or method docstring
(C0116)
[convention] 52-52: Missing function or method docstring
(C0116)
[convention] 63-63: Missing function or method docstring
(C0116)
[convention] 77-77: Missing function or method docstring
(C0116)
[convention] 91-91: Missing function or method docstring
(C0116)
[convention] 105-105: Missing function or method docstring
(C0116)
[convention] 119-119: Missing function or method docstring
(C0116)
[convention] 146-146: Missing function or method docstring
(C0116)
[convention] 157-157: Missing function or method docstring
(C0116)
[convention] 170-170: Missing function or method docstring
(C0116)
[convention] 201-201: Missing function or method docstring
(C0116)
[convention] 211-211: Missing function or method docstring
(C0116)
[convention] 215-215: Missing function or method docstring
(C0116)
[convention] 219-219: Missing function or method docstring
(C0116)
[convention] 223-223: Missing function or method docstring
(C0116)
[convention] 227-227: Missing function or method docstring
(C0116)
[convention] 231-231: Missing function or method docstring
(C0116)
[convention] 237-237: Missing function or method docstring
(C0116)
[convention] 241-241: Missing function or method docstring
(C0116)
[convention] 245-245: Missing function or method docstring
(C0116)
[refactor] 20-20: Too many public methods (23/20)
(R0904)
holidays/countries/solomon_islands.py
[convention] 29-29: Line too long (134/100)
(C0301)
[convention] 30-30: Line too long (128/100)
(C0301)
[convention] 31-31: Line too long (158/100)
(C0301)
[convention] 32-32: Line too long (153/100)
(C0301)
[convention] 45-45: Line too long (165/100)
(C0301)
[convention] 46-46: Line too long (167/100)
(C0301)
[convention] 191-191: Line too long (162/100)
(C0301)
[convention] 192-192: Line too long (164/100)
(C0301)
[convention] 193-193: Line too long (172/100)
(C0301)
[convention] 1-1: Missing module docstring
(C0114)
[convention] 179-179: Missing class docstring
(C0115)
[convention] 183-183: Missing class docstring
(C0115)
[refactor] 187-187: Too few public methods (0/2)
(R0903)
⏰ Context from checks skipped due to timeout of 300000ms (2)
- GitHub Check: Build distribution
- GitHub Check: Test docs build
🔇 Additional comments (2)
holidays/countries/solomon_islands.py (2)
90-96
: Confirm compositeobserved_rule
is still honoured for New Year’s Day
_add_observed(..., rule=SUN_TO_NEXT_MON)
intentionally suppresses
the default Saturday-to-Friday shift you configured in
__init__
.
If that is policy (only Sundays observed for New Year), perfect.
If Saturdays should also shift, drop the explicitrule=
argument so
the combinedSUN_TO_NEXT_MON + SAT_TO_PREV_FRI
applies.No change required if the single-rule behaviour is correct.
116-125
: Edge cases covered – nice!The bespoke mapping for 2022 & 2025 plus the fallback logic cleanly
handles the Sovereign’s Birthday transition.
Implementation is clear and matches gazette data.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! 👍
# Conflicts: # README.md
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! 👍
Proposed change
Add Solomon Islands holidays.
Resolves #1269.
Type of change
holidays
functionality in general)Checklist
make check
, all checks and tests are green