-
-
Notifications
You must be signed in to change notification settings - Fork 561
Update Spain holidays in 2008-2009, 2026 #3026
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
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... 📒 Files selected for processing (18)
Summary by CodeRabbit
WalkthroughUnified Spain holiday handling: added Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes
Possibly related PRs
Suggested reviewers
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
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. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #3026 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 306 306
Lines 18027 17991 -36
Branches 2331 2276 -55
=========================================
- Hits 18027 17991 -36 ☔ 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
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (3)
snapshots/countries/ES_CE.json (1)
199-210: Add Saint Anthony's Day (June 13, 2026) to Ceuta holidays.File verification confirms the entry is missing. Ceuta Assembly approved Romería de San Antonio as an official holiday for June 13, 2026. Insert the entry between Eid al-Adha and Santa Maria of Africa.
"2026-05-27": "Eid al-Adha", + "2026-06-13": "Saint Anthony's Day", "2026-08-05": "Santa Maria of Africa",holidays/countries/spain.py (2)
494-518: Add Melilla's missing local holidays for 2026 (Sep 8, Sep 17).Melilla's official holidays include Virgen de la Victoria (Sep 8) and Día de Melilla (Sep 17), currently absent from the code. Add both with observed-to-next-Monday handling for 2026.
def _populate_subdiv_ml_public_holidays(self): @@ -510,6 +510,10 @@ class Spain(HolidayBase): else: self._add_eid_al_adha_day(name) + if self._year == 2026: + # Virgin of Victory. + self._move_holiday(self._add_holiday_sep_8(tr("Virgen de la Victoria"))) + # Melilla Day. + self._move_holiday(self._add_holiday_sep_17(tr("Día de Melilla")))
323-344: Add Ceuta’s Saint Anthony’s Day (Jun 13, 2026) — observed-to-MonCE 2026 snapshot and code omit San Antonio; add it to _populate_subdiv_ce_public_holidays using the existing observed-to-Mon pattern.
File: holidays/countries/spain.py — def _populate_subdiv_ce_public_holidays()
def _populate_subdiv_ce_public_holidays(self): @@ else: self._add_eid_al_adha_day(name) + + if self._year == 2026: + # Saint Anthony's Day. + self._move_holiday(self._add_holiday_jun_13(tr("San Antonio")))
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (20)
holidays/countries/spain.py(13 hunks)snapshots/countries/ES_AN.json(20 hunks)snapshots/countries/ES_AR.json(19 hunks)snapshots/countries/ES_AS.json(17 hunks)snapshots/countries/ES_CB.json(7 hunks)snapshots/countries/ES_CE.json(6 hunks)snapshots/countries/ES_CL.json(19 hunks)snapshots/countries/ES_CM.json(7 hunks)snapshots/countries/ES_CN.json(15 hunks)snapshots/countries/ES_COMMON.json(1 hunks)snapshots/countries/ES_CT.json(0 hunks)snapshots/countries/ES_EX.json(16 hunks)snapshots/countries/ES_GA.json(2 hunks)snapshots/countries/ES_IB.json(5 hunks)snapshots/countries/ES_MC.json(11 hunks)snapshots/countries/ES_MD.json(11 hunks)snapshots/countries/ES_ML.json(14 hunks)snapshots/countries/ES_NC.json(10 hunks)snapshots/countries/ES_PV.json(2 hunks)snapshots/countries/ES_RI.json(7 hunks)
💤 Files with no reviewable changes (1)
- snapshots/countries/ES_CT.json
🧰 Additional context used
🧠 Learnings (8)
📚 Learning: 2025-04-03T05:59:57.480Z
Learnt from: PPsyrius
PR: vacanza/holidays#2407
File: snapshots/countries/TL_COMMON.json:7-7
Timestamp: 2025-04-03T05:59:57.480Z
Learning: In the holidays project, snapshot files (like snapshots/countries/TL_COMMON.json) are auto-generated when running `make snapshot` and should not be manually edited. Semicolons (;) in holiday entries are used as separators when multiple holidays occur on the same date.
Applied to files:
snapshots/countries/ES_RI.jsonsnapshots/countries/ES_COMMON.json
📚 Learning: 2025-03-19T16:54:58.657Z
Learnt from: PPsyrius
PR: vacanza/holidays#2354
File: holidays/countries/fiji.py:146-159
Timestamp: 2025-03-19T16:54:58.657Z
Learning: In the holidays library implementation, explicit holiday dates (like Diwali in Fiji) are only defined for historical years with official sources (2016-2025). Future dates beyond the explicitly defined range are automatically calculated by methods like `_add_diwali`, which provide approximations when official dates aren't yet available.
Applied to files:
holidays/countries/spain.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/spain.py
📚 Learning: 2025-06-18T10:26:50.180Z
Learnt from: PPsyrius
PR: vacanza/holidays#2642
File: holidays/countries/france.py:178-180
Timestamp: 2025-06-18T10:26:50.180Z
Learning: In the France holidays implementation, the _populate_subdiv_57_public_holidays() (Moselle) and _populate_subdiv_6ae_public_holidays() (Alsace) methods are functionally identical, both adding Good Friday (≥1893) and Saint Stephen's Day (≥1892) with the same legal references from August 16th, 1892. Therefore, for the deprecated "Alsace-Moselle" subdivision, calling either method produces the same result.
Applied to files:
holidays/countries/spain.py
📚 Learning: 2025-06-18T10:58:28.058Z
Learnt from: PPsyrius
PR: vacanza/holidays#2642
File: holidays/countries/france.py:184-206
Timestamp: 2025-06-18T10:58:28.058Z
Learning: In the holidays library France implementation, creating shared private methods between subdivision-specific holiday population methods (like _populate_subdiv_57_public_holidays and _populate_subdiv_6ae_public_holidays) is not supported by the current framework architecture, so duplicate code between functionally identical subdivision methods should be left as-is.
Applied to files:
holidays/countries/spain.py
📚 Learning: 2025-03-30T20:18:46.006Z
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.
Applied to files:
holidays/countries/spain.py
📚 Learning: 2025-04-13T19:10:31.502Z
Learnt from: KJhellico
PR: vacanza/holidays#2465
File: holidays/countries/suriname.py:219-251
Timestamp: 2025-04-13T19:10:31.502Z
Learning: The `_CustomIslamicHolidays` classes in this project contain only exact verified holiday dates from reliable sources, rather than calculated or estimated future dates. This is by design to ensure accuracy, particularly for religious holidays that may follow lunar calendars or depend on local observations.
Applied to files:
holidays/countries/spain.py
📚 Learning: 2025-10-03T17:46:23.800Z
Learnt from: KJhellico
PR: vacanza/holidays#2981
File: holidays/calendars/islamic.py:3987-4003
Timestamp: 2025-10-03T17:46:23.800Z
Learning: In the holidays library Islamic calendar implementation with calendar_shift feature, CONFIRMED_YEARS represents years where the base Umm al-Qura calculation plus the calendar_shift has been verified as correct, while confirmed_dates contains explicit dates that should not be shifted. Years within CONFIRMED_YEARS but not in the explicit date dictionaries will use the base Umm al-Qura algorithm with the calendar_shift applied and be marked as "confirmed" rather than "estimated".
Applied to files:
holidays/countries/spain.py
🧬 Code graph analysis (1)
holidays/countries/spain.py (1)
holidays/observed_holiday_base.py (4)
ObservedHolidayBase(102-258)_add_observed(144-198)_populate_subdiv_holidays(245-258)_move_holiday(200-213)
🪛 Ruff (0.14.2)
holidays/countries/spain.py
189-189: Missing return type annotation for private function _populate_subdiv_holidays
Add return type annotation: None
(ANN202)
281-281: Missing return type annotation for private function _populate_subdiv_an_public_holidays
Add return type annotation: None
(ANN202)
288-288: Missing return type annotation for private function _populate_subdiv_ar_public_holidays
Add return type annotation: None
(ANN202)
295-295: Missing return type annotation for private function _populate_subdiv_as_public_holidays
Add return type annotation: None
(ANN202)
302-302: Missing return type annotation for private function _populate_subdiv_cb_public_holidays
Add return type annotation: None
(ANN202)
344-344: Missing return type annotation for private function _populate_subdiv_cl_public_holidays
Add return type annotation: None
(ANN202)
360-360: Missing return type annotation for private function _populate_subdiv_cm_public_holidays
Add return type annotation: None
(ANN202)
380-380: Missing return type annotation for private function _populate_subdiv_cn_public_holidays
Add return type annotation: None
(ANN202)
388-388: Missing return type annotation for private function _populate_subdiv_ct_public_holidays
Add return type annotation: None
(ANN202)
424-424: Missing return type annotation for private function _populate_subdiv_ga_public_holidays
Add return type annotation: None
(ANN202)
444-444: Missing return type annotation for private function _populate_subdiv_ib_public_holidays
Add return type annotation: None
(ANN202)
462-462: Missing return type annotation for private function _populate_subdiv_mc_public_holidays
Add return type annotation: None
(ANN202)
474-474: Missing return type annotation for private function _populate_subdiv_md_public_holidays
Add return type annotation: None
(ANN202)
494-494: Missing return type annotation for private function _populate_subdiv_ml_public_holidays
Add return type annotation: None
(ANN202)
519-519: Missing return type annotation for private function _populate_subdiv_nc_public_holidays
Add return type annotation: None
(ANN202)
537-537: Missing return type annotation for private function _populate_subdiv_pv_public_holidays
Add return type annotation: None
(ANN202)
575-575: Missing return type annotation for private function _populate_subdiv_vc_public_holidays
Add return type annotation: None
(ANN202)
⏰ Context from checks skipped due to timeout of 300000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: Build distribution
- GitHub Check: Test docs build
🔇 Additional comments (24)
snapshots/countries/ES_COMMON.json (1)
1-356: Snapshot file detected—verify auto-generation integrity.This is an auto-generated snapshot file. Per the learnings, snapshots should only be modified by running
make snapshotand never manually edited. If changes appear here beyond whatmake snapshotproduces, they may indicate manual intervention or incomplete generation.Confirm that these snapshot changes were produced only by the
make snapshotcommand and not manually modified. If manual edits are present, they should be undone to preserve the auto-generation contract.snapshots/countries/ES_AS.json (1)
202-203: 2026 Andalusia/Asturias holidays correctly updated for observed dates.Lines 202–203 implement the Monday-following observance for All Saints' Day and Constitution Day when they fall on Sunday in 2026. This aligns with PR objective #3024 for regional holidays.
Verify: November 1, 2026 is a Sunday (✓ Nov 2 observed), and December 6, 2026 is a Sunday (✓ Dec 7 observed).
snapshots/countries/ES_RI.json (1)
203-203: Monday-following pattern consistently applied across La Rioja snapshots.The 2026 Constitution Day entry (line 203) correctly observes Monday Dec 7. Regional holiday "La Rioja Day" (June 9) is preserved without change, which is appropriate.
Also applies to: 290-290, 336-337, 362-362, 407-408, 421-421, 467-468, 493-493
snapshots/countries/ES_AN.json (1)
202-203: Andalusia 2026 holidays correctly implement PR objective #3024.Lines 202–203 apply the required Monday-following observances for All Saints' Day (Nov 2) and Constitution Day (Dec 7), matching the official resolution references cited in the PR description.
snapshots/countries/ES_GA.json (1)
198-198: Galicia 2026 entries correctly add required Saint Joseph's Day.Lines 198 and 202 add Saint Joseph's Day (March 19) and Saint John the Baptist (June 24) for 2026, satisfying PR objective #3024 requirement for Saint Joseph's Day in eligible regions.
Also applies to: 202-202
snapshots/countries/ES_EX.json (1)
202-203: Extremadura 2026 entries correctly apply Monday-following observances.Lines 202–203 implement the required Monday-following dates for All Saints' Day and Constitution Day when they fall on Sunday, consistent with Andalusia and other regions in the PR.
snapshots/countries/ES_CL.json (1)
202-203: Castile and León 2026 entries correctly apply Monday-following observances.Lines 202–203 match the pattern in other regions: All Saints' Day (Nov 2) and Constitution Day (Dec 7) when they fall on Sunday.
snapshots/countries/ES_CB.json (1)
205-205: Cantabria 2026 Constitution Day correctly observes Monday date.Line 205 implements Monday Dec 7 for Constitution Day 2026. Notably, All Saints' Day Monday-following is not present for Cantabria—verify this aligns with official Cantabrian holiday policy if different from other regions.
Confirm that Cantabria's 2026 holidays (specifically the absence of Monday-following for All Saints' Day vs. Constitution Day observance) match the official Cantabrian resolution or governing holiday policy.
holidays/countries/spain.py (2)
445-461: IB: Monday-following for Balearic Islands Day in 2026 looks good.Using _move_holiday on Mar 1 when year == 2026 matches the Monday observance rule.
Please confirm tests assert 2026-03-02 for IB.
604-621: Islamic “confirmed years” extended to 2026: good.Extending EID_AL_ADHA and EID_AL_FITR confirmed ranges to include 2026 aligns with the BOE alignment effort.
Ensure test expectations for ML in 2026 match the confirmed algorithm date for Eid al-Fitr.
snapshots/countries/ES_NC.json (1)
212-212: Navarra 2026 entries look right.St Joseph (Mar 19) and Monday after All Saints (Nov 2) match objectives.
Also applies to: 219-219
snapshots/countries/ES_CM.json (1)
199-206: Castilla‑La Mancha 2026 entries LGTM.Easter Monday and Monday after All Saints are correctly included.
Also applies to: 204-205
snapshots/countries/ES_MC.json (1)
197-206: Murcia 2026 additions are correct.St Joseph’s Day and Monday after Constitution Day present as requested.
Also applies to: 204-205
snapshots/countries/ES_CN.json (2)
187-187: 2026-11-02 Monday observance for All Saints' Day is correct.November 1 (All Saints' Day) falls on a Sunday in 2026, so the Monday following observance on 11/02 is the expected behavior. This aligns with the PR objective to update 2026 regional holidays.
Also applies to: 187-187
196-196: Extensive Monday-following conversions extend beyond 2026 scope—verify alignment with PR intent.While 2026 entries appear sound, lines 196–461 show widespread Monday-following substitutions across decades (2027–2050). These changes are systematic (e.g., Epiphany on line 227, Assumption on line 254), but they go well beyond the stated PR objective of updating 2026 holidays. Confirm whether this broad year-range refactor aligns with the contributing intent, or if earlier years should retain fixed dates. Based on learnings—stability in historical data snapshots is preferred unless there's explicit reason to retrofit prior years.
Also applies to: 461-461
snapshots/countries/ES_IB.json (1)
197-197: 2026 Balearic Islands holidays correctly reflect Sunday observances and Boxing Day addition.Line 197 properly moves Day of the Balearic Islands (Mar 1, a Sunday in 2026) to Monday 03/02. Line 206 adds Saint Stephen's Day on 12/26, which aligns with the PR objective to include "Boxing Day (Balearic Islands)" for 2026-12-26 per the linked issue. Both changes are consistent with regional holiday conventions.
Also applies to: 206-206
snapshots/countries/ES_PV.json (2)
196-196: Saint Joseph's Day (2026-03-19) correctly added for Basque Country, aligning with PR objectives.The entry matches the stated requirement in issue #3024 to add Saint Joseph's Day for certain regions in 2026. Basque Country (ES_PV) inclusion is appropriate and the date is correct. Confirm that Murcia (ES_MC.json) and Valencia (ES_VC.json) snapshots also reflect this addition where applicable.
Also applies to: 196-196
486-486: Last entry missing trailing comma in JSON structure.Line 486 ends with
"Immaculate Conception"but the closing brace on line 487 indicates this is the final key-value pair. JSON structure appears correct (no trailing comma needed on final entry). ✓Also applies to: 486-486
snapshots/countries/ES_ML.json (2)
196-196: 2026 Melilla holidays correctly reflect Islamic calendar and Constitution Day observance.Line 196 (Eid al-Fitr on 03/20, Friday) and line 200 (Eid al-Adha on 05/27, Wednesday) align with the PR objective to extend Islamic holiday coverage through 2026 for Melilla. Line 203 correctly shifts Constitution Day to Monday 12/07 because Dec 6 falls on Sunday in 2026. Melilla's regional specificity (including Islamic holidays) is properly preserved.
Verify that Eid dates (03-20 and 05-27) are astronomically consistent with the Islamic calendar for 2026, or confirm they are reasonable estimates per your data sources.
Also applies to: 205-205
242-242: 2030 Monday observances added: Verify scope aligns with PR intent.Lines 242 and 251 add Monday-following variants for Epiphany (01/07) and Immaculate Conception (12/09) in 2030. While these follow the same pattern as 2026 updates, confirm whether extending the Monday-following logic to 2030 and beyond is intentional or inadvertently broadens the PR scope beyond 2026 focus.
Also applies to: 251-251
snapshots/countries/ES_AR.json (2)
202-203: 2026 Aragon Monday observances correctly implemented.Lines 202–203 properly shift All Saints' Day and Constitution Day to Monday observances (11/02 and 12/07) for 2026, consistent with the regional pattern. Aragon's distinctive Saint George's Day (04/23) is maintained at its fixed date. Changes align with PR objectives for 2026.
Also applies to: 202-203
341-341: Composite holiday entry on 2038-04-23 requires verification.Line 341 shows
"2038-04-23": "Good Friday; Saint George's Day"as a combined label. Confirm this is intentional when both holidays coincide (Good Friday and Saint George's Day on same date in 2038). If these should be separate entries, split them. If intentional, document the combining rule.Also applies to: 341-341
snapshots/countries/ES_MD.json (2)
201-202: 2026 Madrid holidays correctly apply Sunday observance rules.Lines 201–202 properly convert All Saints' Day (Nov 1) and Constitution Day (Dec 6) to Monday observances (11/02 and 12/07) for 2026, consistent with regional pattern. Madrid Day (05/02) is retained as fixed date. Changes align with PR objectives for 2026.
Also applies to: 201-202
241-241: Broad Monday-following retrofits across 2030–2050 warrant scope clarification.Similar to other snapshot files, ES_MD.json contains numerous Monday-following conversions spanning decades (lines 241, 308, 326, 364, 365, 374, 393, 407, 432, 450, 451). While the pattern is systematic and internally consistent, these changes substantially exceed the stated PR objective of "Update Spain holidays for 2026." Confirm whether:
- This retroactive refactoring of multi-decade data is intentional
- Historical years (pre-2026) should remain unchanged for stability
- Future years (post-2026) merit wholesale restructuring
As per established practices, snapshot data typically remains stable for years prior to the update target unless compelling reason exists to retrofit.
Also applies to: 475-475
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.
Great refactoring! 👍 Now Spain seems easier to understand.
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! 🚀
|
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.
Great work 👏
Proposed change
ChristianHolidays::_add_saint_anthonys_daymethod (used by Italy, Spain, and Portugal).th) l10n for Spain's holidays.References:
Resolves #3024 .
Type of change
holidaysfunctionality in general)Checklist
make checklocally; all checks and tests passed.