Update Sweden holidays: add categories support#3096
Conversation
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings. WalkthroughAdds BANK and OPTIONAL categories to Sweden; refactors holiday generation into common/bank/optional population methods; adds many eve/day-before/time-labeled holidays and historical-rule adjustments; updates locale .po files, tests, and README supported categories. Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes
Suggested reviewers
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro 📒 Files selected for processing (2)
🧰 Additional context used🧠 Learnings (59)📓 Common learnings📚 Learning: 2025-11-08T05:09:56.159ZApplied to files:
📚 Learning: 2025-05-06T21:07:11.577ZApplied to files:
📚 Learning: 2025-05-09T18:36:09.607ZApplied to files:
📚 Learning: 2025-09-03T16:49:35.246ZApplied to files:
📚 Learning: 2025-04-05T04:47:27.213ZApplied to files:
📚 Learning: 2025-09-10T14:35:54.603ZApplied to files:
📚 Learning: 2025-04-03T16:58:27.175ZApplied to files:
📚 Learning: 2025-09-18T03:19:23.722ZApplied to files:
📚 Learning: 2025-09-10T16:17:30.428ZApplied to files:
📚 Learning: 2025-07-24T15:21:31.632ZApplied to files:
📚 Learning: 2025-06-26T13:20:10.172ZApplied to files:
📚 Learning: 2025-09-25T10:05:04.107ZApplied to files:
📚 Learning: 2025-08-11T10:14:28.517ZApplied to files:
📚 Learning: 2025-09-14T06:39:08.485ZApplied to files:
📚 Learning: 2025-09-26T13:58:49.363ZApplied to files:
📚 Learning: 2025-08-28T02:34:11.657ZApplied to files:
📚 Learning: 2025-09-21T05:16:38.578ZApplied to files:
📚 Learning: 2025-06-10T05:08:07.939ZApplied to files:
📚 Learning: 2025-09-26T13:44:12.652ZApplied to files:
📚 Learning: 2025-09-28T05:42:12.777ZApplied to files:
📚 Learning: 2025-04-05T04:29:38.042ZApplied to files:
📚 Learning: 2025-04-05T04:50:40.752ZApplied to files:
📚 Learning: 2025-04-05T04:33:53.254ZApplied to files:
📚 Learning: 2025-09-10T21:12:39.614ZApplied to files:
📚 Learning: 2025-06-16T15:48:48.680ZApplied to files:
📚 Learning: 2025-06-18T17:01:58.067ZApplied to files:
📚 Learning: 2025-09-17T09:07:56.459ZApplied to files:
📚 Learning: 2025-04-05T06:49:06.217ZApplied to files:
📚 Learning: 2025-09-17T09:07:56.459ZApplied to files:
📚 Learning: 2025-11-28T02:24:17.418ZApplied to files:
📚 Learning: 2025-07-09T21:16:35.145ZApplied to files:
📚 Learning: 2025-09-14T16:23:46.707ZApplied to files:
📚 Learning: 2025-09-17T15:16:16.192ZApplied to files:
📚 Learning: 2025-06-28T10:39:19.185ZApplied to files:
📚 Learning: 2025-06-26T15:34:35.476ZApplied to files:
📚 Learning: 2025-06-11T18:32:25.595ZApplied to files:
📚 Learning: 2025-03-30T18:25:07.087ZApplied to files:
📚 Learning: 2025-06-29T09:37:35.283ZApplied to files:
📚 Learning: 2025-09-17T15:53:16.940ZApplied to files:
📚 Learning: 2025-05-06T15:25:44.333ZApplied to files:
📚 Learning: 2025-06-10T12:17:58.880ZApplied to files:
📚 Learning: 2025-06-25T20:55:00.642ZApplied to files:
📚 Learning: 2025-03-04T10:06:57.171ZApplied to files:
📚 Learning: 2025-08-21T04:56:03.780ZApplied to files:
📚 Learning: 2025-08-11T10:14:14.399ZApplied to files:
📚 Learning: 2025-04-02T18:38:35.164ZApplied to files:
📚 Learning: 2025-10-28T17:26:45.090ZApplied to files:
📚 Learning: 2025-05-10T04:32:15.760ZApplied to files:
📚 Learning: 2025-09-14T07:26:25.431ZApplied to files:
📚 Learning: 2025-08-19T21:22:13.125ZApplied to files:
📚 Learning: 2025-05-10T04:02:13.815ZApplied to files:
📚 Learning: 2025-08-21T04:56:03.780ZApplied to files:
📚 Learning: 2025-08-25T22:19:01.342ZApplied to files:
📚 Learning: 2025-03-05T17:51:00.633ZApplied to files:
📚 Learning: 2025-06-25T10:09:29.029ZApplied to files:
📚 Learning: 2025-04-17T17:08:48.082ZApplied to files:
📚 Learning: 2025-03-30T13:33:31.598ZApplied to files:
📚 Learning: 2025-07-04T03:26:56.759ZApplied to files:
🧬 Code graph analysis (1)tests/countries/test_sweden.py (1)
🪛 Ruff (0.14.6)tests/countries/test_sweden.py691-691: String contains ambiguous (RUF001) 691-691: String contains ambiguous (RUF001) 695-695: String contains ambiguous (RUF001) 695-695: String contains ambiguous (RUF001) 717-717: String contains ambiguous (RUF001) 717-717: String contains ambiguous (RUF001) 717-717: String contains ambiguous (RUF001) 717-717: String contains ambiguous (RUF001) 718-718: String contains ambiguous (RUF001) 718-718: String contains ambiguous (RUF001) 718-718: String contains ambiguous (RUF001) 718-718: String contains ambiguous (RUF001) 732-732: String contains ambiguous (RUF001) 732-732: String contains ambiguous (RUF001) ⏰ 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). (5)
🔇 Additional comments (6)
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 #3096 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 306 306
Lines 18085 18105 +20
Branches 2311 2309 -2
=========================================
+ Hits 18085 18105 +20 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (7)
README.md(1 hunks)holidays/countries/sweden.py(5 hunks)holidays/locale/en_US/LC_MESSAGES/SE.po(4 hunks)holidays/locale/sv/LC_MESSAGES/SE.po(4 hunks)holidays/locale/th/LC_MESSAGES/SE.po(5 hunks)holidays/locale/uk/LC_MESSAGES/SE.po(4 hunks)tests/countries/test_sweden.py(4 hunks)
🧰 Additional context used
🧠 Learnings (84)
📓 Common learnings
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2881
File: tests/countries/test_brazil.py:28-30
Timestamp: 2025-09-10T14:35:54.603Z
Learning: In the holidays project, the test_no_holidays method should test ALL supported_categories (via categories=CountryClass.supported_categories) rather than just the default PUBLIC category, to ensure comprehensive validation that no holidays exist before start_year across any supported category including OPTIONAL and subdivision categories.
Learnt from: KJhellico
Repo: vacanza/holidays PR: 2783
File: tests/countries/test_eritrea.py:130-147
Timestamp: 2025-08-18T13:06:16.919Z
Learning: The `assertLocalizedHolidays` method in the vacanza/holidays project requires a complete list of all holidays from all categories (PUBLIC, GOVERNMENT, etc.), not just the holidays from the default category. This is a framework requirement for comprehensive localization testing.
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2881
File: tests/countries/test_french_polynesia.py:19-22
Timestamp: 2025-11-08T05:09:56.159Z
Learning: In the vacanza/holidays project's test framework (PR #2881 onwards), the base class CommonCountryTests provides a default test_no_holidays implementation that automatically tests years=start_year - 1 for standard PUBLIC category cases. Individual country test files should only override test_no_holidays when the country supports additional non-PUBLIC categories (GOVERNMENT, WORKDAY, OPTIONAL, etc.) with different start years requiring separate validation.
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2881
File: tests/countries/test_curacao.py:29-29
Timestamp: 2025-09-20T12:24:28.864Z
Learning: For Curacao in the holidays library, PUBLIC and HALF_DAY categories have different start years - PUBLIC holidays begin at the country's start_year while HALF_DAY holidays begin in 2010. When testing no_holidays methods, each category should be tested separately with appropriate pre-start years rather than using a unified supported_categories approach.
Learnt from: KJhellico
Repo: vacanza/holidays PR: 2854
File: tests/countries/test_sudan.py:29-31
Timestamp: 2025-09-12T21:37:10.710Z
Learning: For countries in the holidays library that only use the default PUBLIC category (like Sudan), there's no need to specify `categories=Sudan.supported_categories` in test_no_holidays methods, as it would be equivalent to the default behavior.
Learnt from: KJhellico
Repo: vacanza/holidays PR: 2854
File: tests/countries/test_sudan.py:29-31
Timestamp: 2025-09-12T21:37:10.710Z
Learning: For countries in the holidays library that only use the default PUBLIC category (like Sudan), there's no need to specify `categories=Sudan.supported_categories` in test_no_holidays methods, as it would be equivalent to the default behavior.
Learnt from: KJhellico
Repo: vacanza/holidays PR: 2854
File: tests/countries/test_sudan.py:29-31
Timestamp: 2025-09-12T21:37:10.710Z
Learning: For countries in the holidays library that only use the default PUBLIC category (like Sudan), there's no need to specify `categories=Sudan.supported_categories` in test_no_holidays methods, as it would be equivalent to the default behavior.
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2881
File: tests/countries/test_brunei.py:27-29
Timestamp: 2025-09-29T08:09:54.436Z
Learning: For Brunei in the holidays library, only the default PUBLIC category is used, so there's no need to specify `categories=Brunei.supported_categories` in test_no_holidays methods, as it would be equivalent to the default behavior and Brunei doesn't define supported_categories.
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2881
File: tests/countries/test_djibouti.py:27-29
Timestamp: 2025-09-14T16:10:02.766Z
Learning: For Djibouti in the holidays library, only the default PUBLIC category is used, so there's no need to specify `categories=Djibouti.supported_categories` in test_no_holidays methods, as it would be equivalent to the default behavior and Djibouti doesn't define supported_categories.
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2881
File: tests/countries/test_djibouti.py:27-29
Timestamp: 2025-09-14T16:10:02.766Z
Learning: For Djibouti in the holidays library, only the default PUBLIC category is used, so there's no need to specify `categories=Djibouti.supported_categories` in test_no_holidays methods, as it would be equivalent to the default behavior and Djibouti doesn't define supported_categories.
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2323
File: holidays/countries/macau.py:284-366
Timestamp: 2025-03-04T11:41:56.389Z
Learning: For Macau holidays implementation, maintaining separate methods for each holiday category (PUBLIC, MANDATORY, GOVERNMENT) is preferred because these categories are based on different sets of laws and have distinct historical evolution.
Learnt from: KJhellico
Repo: vacanza/holidays PR: 2851
File: docs/holiday_categories.md:272-282
Timestamp: 2025-08-26T14:43:53.605Z
Learning: In the holidays library documentation, it's strongly advisable to recommend the use of constants from holidays.constants (e.g., PUBLIC, CATHOLIC) instead of direct string values when specifying holiday categories, as constants provide better type safety, IDE support, and prevent typos.
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2323
File: holidays/countries/macau.py:407-461
Timestamp: 2025-03-04T11:32:45.095Z
Learning: In the holidays library, the standard approach for organizing static holidays is to use separate dictionaries for different categories (`government`, `mandatory`, and `public`), which are utilized by syntactic sugar methods.
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2323
File: holidays/countries/macau.py:278-377
Timestamp: 2025-03-05T02:35:03.298Z
Learning: For Macau holiday implementations, it's preferable to maintain separate methods for different holiday categories (MANDATORY, GOVERNMENT, PUBLIC) as they are based on different sets of laws, making the code easier to maintain despite having multiple year-based conditionals.
Learnt from: KJhellico
Repo: vacanza/holidays PR: 2831
File: holidays/countries/south_sudan.py:84-88
Timestamp: 2025-08-19T20:36:15.300Z
Learning: In South Sudan holidays implementation, Eid al-Fitr and Eid al-Adha holidays should use the ISLAMIC category system. The first day of each Eid is a national public holiday (appears in both PUBLIC and ISLAMIC categories), while additional days are typically Muslim-specific and should only appear in the ISLAMIC category through the _populate_islamic_holidays() method.
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2706
File: holidays/countries/cayman_islands.py:80-97
Timestamp: 2025-07-10T03:36:16.461Z
Learning: In the holidays library, date dictionaries that map years to specific dates (like queens_birthday_dates, spring_bank_dates, thanksgiving_day_dates, etc.) are typically defined within the _populate_public_holidays method rather than as module-level constants. This is the established library-wide pattern seen across multiple country implementations including United Kingdom, United States, Sri Lanka, and others.
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2323
File: holidays/countries/macau.py:407-461
Timestamp: 2025-03-04T11:32:45.095Z
Learning: In the holidays library, the standard approach for organizing static holidays is to use separate dictionaries for different categories (like `special_government_holidays`, `special_mandatory_holidays`, and `special_public_holidays`), which are utilized by syntactic sugar methods to pick up the appropriate holidays based on the selected category.
Learnt from: KJhellico
Repo: vacanza/holidays PR: 2653
File: holidays/locale/th/LC_MESSAGES/TW.po:17-21
Timestamp: 2025-06-21T18:06:50.027Z
Learning: KJhellico's username includes a tilde character (~) as part of their nickname (appears as "~Jhellico" in Last-Translator headers), which is intentional formatting and not an error.
📚 Learning: 2025-06-28T10:39:19.185Z
Learnt from: KJhellico
Repo: vacanza/holidays PR: 2684
File: holidays/locale/it/LC_MESSAGES/SM.po:13-13
Timestamp: 2025-06-28T10:39:19.185Z
Learning: In the holidays project, .po file header comments use the format "# [Country] holidays." for default language files (without trailing hash) and "# [Country] holidays [locale] localization." for non-default language files (also without trailing hash).
Applied to files:
holidays/locale/en_US/LC_MESSAGES/SE.poholidays/locale/sv/LC_MESSAGES/SE.poholidays/locale/th/LC_MESSAGES/SE.poholidays/locale/uk/LC_MESSAGES/SE.po
📚 Learning: 2025-06-26T15:34:35.476Z
Learnt from: KJhellico
Repo: vacanza/holidays PR: 2676
File: holidays/locale/en_US/LC_MESSAGES/TN.po:17-28
Timestamp: 2025-06-26T15:34:35.476Z
Learning: In the holidays project, .po file header metadata updates (version numbers, revision dates, translator information) are legitimate changes when part of localization work and don't require `make l10n` regeneration. The `make l10n` command is primarily for formatting fixes and missing translator comments, not for intentional metadata updates.
Applied to files:
holidays/locale/en_US/LC_MESSAGES/SE.poholidays/locale/sv/LC_MESSAGES/SE.poholidays/locale/th/LC_MESSAGES/SE.poholidays/locale/uk/LC_MESSAGES/SE.po
📚 Learning: 2025-09-26T13:58:49.363Z
Learnt from: KJhellico
Repo: vacanza/holidays PR: 2960
File: holidays/locale/ca/LC_MESSAGES/ES.po:148-151
Timestamp: 2025-09-26T13:58:49.363Z
Learning: In the holidays project, when translating holiday names in .po files, the msgstr should be a faithful translation of the original msgid (in the country's default language), not influenced by English commentary or common en_US names. For example, "Día de la Pascua Granada" (Spanish) correctly translates to "Dia de la Pasqua Granada" (Catalan), even though the English comment refers to it as "Whit Monday".
Applied to files:
holidays/locale/en_US/LC_MESSAGES/SE.poholidays/locale/sv/LC_MESSAGES/SE.poholidays/locale/th/LC_MESSAGES/SE.poholidays/locale/uk/LC_MESSAGES/SE.po
📚 Learning: 2025-06-29T09:37:35.283Z
Learnt from: KJhellico
Repo: vacanza/holidays PR: 2687
File: holidays/locale/en_US/LC_MESSAGES/CF.po:13-28
Timestamp: 2025-06-29T09:37:35.283Z
Learning: In the holidays project, .po files follow a standard formatting convention where there is always a blank line after the metadata header section (after the "X-Source-Language" line). This blank line separates the header from the actual translation content and should not be removed.
Applied to files:
holidays/locale/en_US/LC_MESSAGES/SE.poholidays/locale/th/LC_MESSAGES/SE.poholidays/locale/uk/LC_MESSAGES/SE.po
📚 Learning: 2025-05-06T15:25:44.333Z
Learnt from: KJhellico
Repo: vacanza/holidays PR: 2530
File: holidays/locale/ca/LC_MESSAGES/AD.po:31-40
Timestamp: 2025-05-06T15:25:44.333Z
Learning: In the Holidays project, msgid fields in localization files contain strings in the entity's default language (as defined by default_language attribute), not English source strings as in standard gettext implementations.
Applied to files:
holidays/locale/en_US/LC_MESSAGES/SE.poholidays/locale/sv/LC_MESSAGES/SE.poholidays/locale/th/LC_MESSAGES/SE.poholidays/locale/uk/LC_MESSAGES/SE.po
📚 Learning: 2025-03-30T18:25:07.087Z
Learnt from: KJhellico
Repo: vacanza/holidays PR: 2388
File: holidays/locale/en_CI/LC_MESSAGES/CI.po:88-88
Timestamp: 2025-03-30T18:25:07.087Z
Learning: In the holidays library, localization files have a specific structure: message comments are in standard English (en_US) describing the holiday, while actual translations (msgstr) should use the locale-specific terminology (e.g., en_CI for Ivory Coast English). For example, "Night of Power" in standard English is translated as "Lailatou-Kadr" in Ivory Coast English.
Applied to files:
holidays/locale/en_US/LC_MESSAGES/SE.poholidays/locale/sv/LC_MESSAGES/SE.poholidays/locale/th/LC_MESSAGES/SE.poholidays/locale/uk/LC_MESSAGES/SE.po
📚 Learning: 2025-06-11T18:32:25.595Z
Learnt from: ankushhKapoor
Repo: vacanza/holidays PR: 2601
File: holidays/locale/en_MN/LC_MESSAGES/MN.po:13-14
Timestamp: 2025-06-11T18:32:25.595Z
Learning: For non-default locale `.po` files, the header comment format is:
`# <Country> holidays <locale> localization.` (no trailing hash).
Applied to files:
holidays/locale/en_US/LC_MESSAGES/SE.poholidays/locale/th/LC_MESSAGES/SE.po
📚 Learning: 2025-06-10T12:17:58.880Z
Learnt from: KJhellico
Repo: vacanza/holidays PR: 2608
File: holidays/locale/en_VC/LC_MESSAGES/VC.po:1-14
Timestamp: 2025-06-10T12:17:58.880Z
Learning: In the holidays project, .po files should use the full multi-line header format including the project description, authors, website, and license information, rather than a single-line comment format.
Applied to files:
holidays/locale/en_US/LC_MESSAGES/SE.poholidays/locale/th/LC_MESSAGES/SE.po
📚 Learning: 2025-09-26T13:44:12.652Z
Learnt from: KJhellico
Repo: vacanza/holidays PR: 2960
File: holidays/locale/ca/LC_MESSAGES/ES.po:97-100
Timestamp: 2025-09-26T13:44:12.652Z
Learning: When fixing localization issues in the holidays project, corrections should be made in both the Python source code comments and the en_US .po file msgstr entries, then all other language .po files should be regenerated to pick up the corrected en_US comments.
Applied to files:
holidays/locale/en_US/LC_MESSAGES/SE.poholidays/locale/sv/LC_MESSAGES/SE.poholidays/locale/uk/LC_MESSAGES/SE.po
📚 Learning: 2025-03-26T08:50:03.504Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2362
File: holidays/ical.py:176-180
Timestamp: 2025-03-26T08:50:03.504Z
Learning: The "EN" in the PRODID line of the iCalendar export (f"PRODID:-//Vacanza//Open World Holidays Framework v{self.holidays_version}//EN") should be kept as a fixed identifier by design, as agreed upon by the team, even though the actual holiday language may be different.
Applied to files:
holidays/locale/en_US/LC_MESSAGES/SE.po
📚 Learning: 2025-06-25T10:09:29.029Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2676
File: holidays/locale/ar/LC_MESSAGES/EG.po:0-0
Timestamp: 2025-06-25T10:09:29.029Z
Learning: In the holidays library, msgstr fields can be left empty for source/default_language files when using Lingva, the localization tool used by the project.
Applied to files:
holidays/locale/en_US/LC_MESSAGES/SE.poholidays/locale/sv/LC_MESSAGES/SE.poholidays/locale/th/LC_MESSAGES/SE.poholidays/locale/uk/LC_MESSAGES/SE.po
📚 Learning: 2025-03-05T17:51:00.633Z
Learnt from: KJhellico
Repo: vacanza/holidays PR: 2259
File: holidays/locale/en_IN/LC_MESSAGES/IN.po:30-299
Timestamp: 2025-03-05T17:51:00.633Z
Learning: In the Holidays project, .po files for a country's default locale use empty msgstr fields as a standard convention.
Applied to files:
holidays/locale/en_US/LC_MESSAGES/SE.poholidays/locale/sv/LC_MESSAGES/SE.poholidays/locale/th/LC_MESSAGES/SE.poholidays/locale/uk/LC_MESSAGES/SE.po
📚 Learning: 2025-03-08T11:28:48.652Z
Learnt from: KJhellico
Repo: vacanza/holidays PR: 2259
File: holidays/locale/en_IN/LC_MESSAGES/IN.po:285-299
Timestamp: 2025-03-08T11:28:48.652Z
Learning: In the holidays project, message IDs (msgids) in locale files use region-specific naming conventions (e.g., "Muharram", "Id-ul-Fitr" in en_IN locale for India), while translator comments use internationally recognized names from the project's default locale (en_US) such as "Ashura", "Eid al-Fitr". This difference is intentional for proper localization.
Applied to files:
holidays/locale/en_US/LC_MESSAGES/SE.poholidays/locale/sv/LC_MESSAGES/SE.poholidays/locale/uk/LC_MESSAGES/SE.po
📚 Learning: 2025-05-10T04:02:13.815Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2537
File: holidays/countries/finland.py:249-253
Timestamp: 2025-05-10T04:02:13.815Z
Learning: Holiday name comments directly above tr() function calls in the holidays package should only contain the holiday name itself (e.g., "# Independence Day.") without any additional context, dates, or historical information.
Applied to files:
holidays/locale/en_US/LC_MESSAGES/SE.poholidays/countries/sweden.py
📚 Learning: 2025-07-04T03:26:56.759Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2651
File: holidays/locale/en_US/LC_MESSAGES/BQ.po:61-63
Timestamp: 2025-07-04T03:26:56.759Z
Learning: In the holidays library, "Eerste Pinksterdag" (Dutch for Pentecost Sunday) is consistently translated as "Whit Sunday" across all Dutch-speaking territories' en_US locale files, rather than "Pentecost", to maintain consistency within the codebase.
Applied to files:
holidays/locale/en_US/LC_MESSAGES/SE.poholidays/locale/sv/LC_MESSAGES/SE.poholidays/locale/th/LC_MESSAGES/SE.poholidays/locale/uk/LC_MESSAGES/SE.po
📚 Learning: 2025-09-29T08:09:54.436Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2881
File: tests/countries/test_brunei.py:27-29
Timestamp: 2025-09-29T08:09:54.436Z
Learning: For Brunei in the holidays library, only the default PUBLIC category is used, so there's no need to specify `categories=Brunei.supported_categories` in test_no_holidays methods, as it would be equivalent to the default behavior and Brunei doesn't define supported_categories.
Applied to files:
README.md
📚 Learning: 2025-08-25T22:13:30.310Z
Learnt from: KJhellico
Repo: vacanza/holidays PR: 2854
File: README.md:1557-1562
Timestamp: 2025-08-25T22:13:30.310Z
Learning: Sudan holidays implementation inherits from IslamicHolidays but does not expose an ISLAMIC category in its supported_categories attribute. The Supported Categories column in README.md should remain blank for Sudan.
Applied to files:
README.md
📚 Learning: 2025-09-12T21:37:10.710Z
Learnt from: KJhellico
Repo: vacanza/holidays PR: 2854
File: tests/countries/test_sudan.py:29-31
Timestamp: 2025-09-12T21:37:10.710Z
Learning: For countries in the holidays library that only use the default PUBLIC category (like Sudan), there's no need to specify `categories=Sudan.supported_categories` in test_no_holidays methods, as it would be equivalent to the default behavior.
Applied to files:
README.md
📚 Learning: 2025-06-25T20:55:00.642Z
Learnt from: KJhellico
Repo: vacanza/holidays PR: 2651
File: holidays/locale/nl/LC_MESSAGES/BQ.po:29-95
Timestamp: 2025-06-25T20:55:00.642Z
Learning: In the holidays library, Dutch locale files (.po) with `X-Source-Language: nl` should have empty msgstr entries when the target language is also Dutch. The library uses fallback=True with gettext, which returns the original msgid when msgstr is empty. This is the correct pattern for native language files and does not cause blank holiday names.
Applied to files:
holidays/locale/sv/LC_MESSAGES/SE.poholidays/locale/uk/LC_MESSAGES/SE.po
📚 Learning: 2025-09-25T10:05:04.107Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2959
File: tests/countries/test_myanmar.py:398-434
Timestamp: 2025-09-25T10:05:04.107Z
Learning: In the holidays library Thai localizations, there are two distinct patterns: 1) "%s (observed)" holidays use "ชดเชย%s" format, and 2) "Day off (substituted from %s)" holidays use "วันหยุด (แทน %s)" format. These serve different purposes and should not be confused - substituted holidays are not the same as observed holidays.
Applied to files:
holidays/locale/th/LC_MESSAGES/SE.po
📚 Learning: 2025-08-21T04:56:03.780Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2843
File: holidays/countries/burundi.py:63-101
Timestamp: 2025-08-21T04:56:03.780Z
Learning: In the holidays library, countries with localization support consistently use tr() wrappers around holiday names when calling _add_* methods (e.g., self._add_new_years_day(tr("Holiday Name"))). This is the established pattern across United States, Thailand, and other l10n-enabled countries, contrary to any suggestion that translation is handled internally by _add_* methods.
Applied to files:
holidays/locale/th/LC_MESSAGES/SE.poholidays/countries/sweden.py
📚 Learning: 2025-08-28T02:34:11.657Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2860
File: holidays/groups/eastern.py:36-36
Timestamp: 2025-08-28T02:34:11.657Z
Learning: The default estimated_label change from "%s (estimated)" to "%s" in holidays/groups/eastern.py is intentional to remove English-only fallback text from localized holiday names. Countries that need estimated labels should define them properly with localization support rather than relying on the English fallback.
Applied to files:
holidays/locale/th/LC_MESSAGES/SE.poholidays/locale/uk/LC_MESSAGES/SE.po
📚 Learning: 2025-06-26T13:20:10.172Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2678
File: holidays/locale/th/LC_MESSAGES/US.po:30-34
Timestamp: 2025-06-26T13:20:10.172Z
Learning: In the holidays library Thai localizations, the "observed" format consistently uses "ชดเชย%s" without spaces between the Thai word and placeholder across all .po files in the codebase.
Applied to files:
holidays/locale/th/LC_MESSAGES/SE.po
📚 Learning: 2025-04-17T17:08:48.082Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2438
File: holidays/locale/ar_IQ/LC_MESSAGES/IQ.po:35-81
Timestamp: 2025-04-17T17:08:48.082Z
Learning: In holiday PO files, when the file represents the default language of an entity (e.g., ar_IQ for Iraq), no translations in `msgstr` are required as the `msgid` values are already in the target language.
Applied to files:
holidays/locale/th/LC_MESSAGES/SE.po
📚 Learning: 2025-03-30T13:33:31.598Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2388
File: holidays/locale/fr/LC_MESSAGES/CI.po:28-101
Timestamp: 2025-03-30T13:33:31.598Z
Learning: In the holidays library, for localization files of the default language (like French for Ivory Coast in fr/LC_MESSAGES/CI.po), the best practice is to leave the message strings (msgstr) empty to avoid possible typos, since the message IDs (msgid) are already in the target language.
Applied to files:
holidays/locale/th/LC_MESSAGES/SE.po
📚 Learning: 2025-04-03T16:58:27.175Z
Learnt from: Wasif-Shahzad
Repo: vacanza/holidays PR: 2409
File: holidays/countries/qatar.py:27-46
Timestamp: 2025-04-03T16:58:27.175Z
Learning: In the holidays library, method names like `_add_holiday_2nd_tue_of_feb()` and `_add_holiday_1st_sun_of_mar()` use calendar constants internally through parent class implementations even when these constants don't appear directly in the file. Removing imports that seem unused based on a simple text search could break functionality.
Applied to files:
holidays/countries/sweden.pytests/countries/test_sweden.py
📚 Learning: 2025-11-08T05:09:56.159Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2881
File: tests/countries/test_french_polynesia.py:19-22
Timestamp: 2025-11-08T05:09:56.159Z
Learning: In the vacanza/holidays project's test framework (PR #2881 onwards), the base class CommonCountryTests provides a default test_no_holidays implementation that automatically tests years=start_year - 1 for standard PUBLIC category cases. Individual country test files should only override test_no_holidays when the country supports additional non-PUBLIC categories (GOVERNMENT, WORKDAY, OPTIONAL, etc.) with different start years requiring separate validation.
Applied to files:
holidays/countries/sweden.pytests/countries/test_sweden.py
📚 Learning: 2025-10-28T17:26:45.090Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 3026
File: holidays/countries/spain.py:189-189
Timestamp: 2025-10-28T17:26:45.090Z
Learning: In the vacanza/holidays codebase, `_populate` methods (such as `_populate_public_holidays`, `_populate_subdiv_holidays`, and subdivision-specific methods like `_populate_subdiv_XX_public_holidays`) intentionally do not include return type annotations like `-> None`. This is a consistent pattern across country implementations (e.g., Germany, United States, Spain) and should not be changed even when static analysis tools like Ruff suggest adding them.
<!-- </add_learning>
Applied to files:
holidays/countries/sweden.py
📚 Learning: 2025-06-16T12:28:31.641Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2632
File: holidays/countries/solomon_islands.py:95-98
Timestamp: 2025-06-16T12:28:31.641Z
Learning: Library-wide holiday patterns and their optimizations should be handled at the base class level (like InternationalHolidays) rather than documenting workarounds in individual country modules. This maintains separation of concerns and avoids documentation duplication.
Applied to files:
holidays/countries/sweden.py
📚 Learning: 2025-06-16T11:42:28.293Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2638
File: holidays/countries/svalbard_and_jan_mayen.py:1-12
Timestamp: 2025-06-16T11:42:28.293Z
Learning: In the holidays library codebase, country implementation files in holidays/countries/ follow a standard convention of NOT having module-level docstrings. They start with the license header comment block, followed by imports, then class definitions. This is consistent across all country implementations like austria.py, belgium.py, canada.py, etc.
Applied to files:
holidays/countries/sweden.py
📚 Learning: 2025-08-08T14:37:03.045Z
Learnt from: KJhellico
Repo: vacanza/holidays PR: 2774
File: tests/countries/test_liberia.py:15-16
Timestamp: 2025-08-08T14:37:03.045Z
Learning: In holidays/countries/__init__.py, re-export country classes using absolute imports (e.g., 'from holidays.countries.liberia import Liberia, LR, LBR') and keep alphabetical ordering (e.g., Lesotho, Liberia, Libya). Avoid relative imports in this file.
Applied to files:
holidays/countries/sweden.py
📚 Learning: 2025-09-20T12:24:28.864Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2881
File: tests/countries/test_curacao.py:29-29
Timestamp: 2025-09-20T12:24:28.864Z
Learning: For Curacao in the holidays library, PUBLIC and HALF_DAY categories have different start years - PUBLIC holidays begin at the country's start_year while HALF_DAY holidays begin in 2010. When testing no_holidays methods, each category should be tested separately with appropriate pre-start years rather than using a unified supported_categories approach.
Applied to files:
holidays/countries/sweden.py
📚 Learning: 2025-04-03T16:58:27.175Z
Learnt from: Wasif-Shahzad
Repo: vacanza/holidays PR: 2409
File: holidays/countries/qatar.py:27-46
Timestamp: 2025-04-03T16:58:27.175Z
Learning: In the holidays library, method names like `_add_holiday_2nd_tue_of_feb()` and `_add_holiday_1st_sun_of_mar()` use calendar constants like FEB, TUE, MAR, and SUN internally through parent class implementations even when these constants don't appear directly in the file.
Applied to files:
holidays/countries/sweden.py
📚 Learning: 2025-08-28T02:42:52.755Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2863
File: tests/countries/test_georgia.py:31-36
Timestamp: 2025-08-28T02:42:52.755Z
Learning: In the holidays framework, when no categories parameter is specified in a country class instantiation (e.g., `Georgia(years=2025)`), the PUBLIC category is used by default. There's no need to explicitly specify `categories=PUBLIC` or import the PUBLIC constant for such test cases.
Applied to files:
holidays/countries/sweden.py
📚 Learning: 2025-07-10T03:36:16.461Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2706
File: holidays/countries/cayman_islands.py:80-97
Timestamp: 2025-07-10T03:36:16.461Z
Learning: In the holidays library, date dictionaries that map years to specific dates (like queens_birthday_dates, spring_bank_dates, thanksgiving_day_dates, etc.) are typically defined within the _populate_public_holidays method rather than as module-level constants. This is the established library-wide pattern seen across multiple country implementations including United Kingdom, United States, Sri Lanka, and others.
Applied to files:
holidays/countries/sweden.py
📚 Learning: 2025-08-21T05:56:33.276Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2843
File: holidays/countries/burundi.py:15-16
Timestamp: 2025-08-21T05:56:33.276Z
Learning: In the holidays library, when importing Gregorian month constants from holidays.calendars.gregorian, only import the months that are actually used in the date data. For example, if Islamic holiday dates only reference JUN, JUL, SEP, OCT, then only import those specific constants rather than importing additional unused months.
Applied to files:
holidays/countries/sweden.py
📚 Learning: 2025-03-04T11:32:45.095Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2323
File: holidays/countries/macau.py:407-461
Timestamp: 2025-03-04T11:32:45.095Z
Learning: In the holidays library, the standard approach for organizing static holidays is to use separate dictionaries for different categories (`government`, `mandatory`, and `public`), which are utilized by syntactic sugar methods.
Applied to files:
holidays/countries/sweden.py
📚 Learning: 2025-03-04T11:32:45.095Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2323
File: holidays/countries/macau.py:407-461
Timestamp: 2025-03-04T11:32:45.095Z
Learning: In the holidays library, the standard approach for organizing static holidays is to use separate dictionaries for different categories (like `special_government_holidays`, `special_mandatory_holidays`, and `special_public_holidays`), which are utilized by syntactic sugar methods to pick up the appropriate holidays based on the selected category.
Applied to files:
holidays/countries/sweden.py
📚 Learning: 2025-10-27T21:23:12.690Z
Learnt from: KJhellico
Repo: vacanza/holidays PR: 3008
File: holidays/financial/_sifma.py:146-150
Timestamp: 2025-10-27T21:23:12.690Z
Learning: In the holidays library, `_christmas_day` is a property defined in the `ChristianHolidays` mixin class and is always available to any class that inherits from `ChristianHolidays`, regardless of whether `_populate_public_holidays` is called or which categories are requested. It does not depend on populating public holidays.
Applied to files:
holidays/countries/sweden.py
📚 Learning: 2025-08-26T21:24:41.827Z
Learnt from: KJhellico
Repo: vacanza/holidays PR: 2860
File: holidays/countries/burkina_faso.py:27-30
Timestamp: 2025-08-26T21:24:41.827Z
Learning: Countries in the holidays library that don't have localization support yet should use plain English strings for labels (e.g., `estimated_label = "%s (estimated)"`), while only countries with existing .po translation files should use `tr()` wrapping. Check for the presence of .po files in holidays/locale to determine if a country has localization support.
Applied to files:
holidays/countries/sweden.py
📚 Learning: 2025-04-13T20:42:13.152Z
Learnt from: KJhellico
Repo: vacanza/holidays PR: 2386
File: holidays/countries/nepal.py:52-60
Timestamp: 2025-04-13T20:42:13.152Z
Learning: In the holidays library, country classes follow a consistent initialization pattern: first explicitly initializing each parent holiday group class with their specific parameters, then calling `super().__init__(*args, **kwargs)` at the end to properly initialize the base `HolidayBase` class.
Applied to files:
holidays/countries/sweden.py
📚 Learning: 2025-06-13T12:18:03.539Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2614
File: holidays/countries/guyana.py:78-90
Timestamp: 2025-06-13T12:18:03.539Z
Learning: The holidays codebase now uses the constructor signature pattern `__init__(self, *args, islamic_show_estimated: bool = True, **kwargs)` across country classes.
Applied to files:
holidays/countries/sweden.py
📚 Learning: 2025-07-14T20:23:48.198Z
Learnt from: KJhellico
Repo: vacanza/holidays PR: 2654
File: holidays/countries/cabo_verde.py:133-141
Timestamp: 2025-07-14T20:23:48.198Z
Learning: The holidays library provides helper methods `_add_holiday_2nd_sun_of_may()` and `_add_holiday_3rd_sun_of_jun()` for adding holidays on the 2nd Sunday of May and 3rd Sunday of June respectively. These methods are used across multiple country implementations including Latvia, Finland, Belarus, Malaysia, Madagascar, and Cape Verde.
Applied to files:
holidays/countries/sweden.py
📚 Learning: 2025-03-19T16:54:58.657Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 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/sweden.py
📚 Learning: 2025-09-18T07:01:12.236Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2942
File: holidays/countries/south_africa.py:91-98
Timestamp: 2025-09-18T07:01:12.236Z
Learning: In the holidays library South Africa implementation, inline ternary operators for holiday name selection (like "Republic Day" if self._year >= 1961 else "Union Day") are intentionally kept inline rather than extracted to separate variables, as this structure is designed in preparation for future localization (l10n) support where the contextual relationship between conditions and translatable strings needs to be preserved.
Applied to files:
holidays/countries/sweden.py
📚 Learning: 2025-11-08T04:56:18.070Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2881
File: tests/countries/test_argentina.py:228-229
Timestamp: 2025-11-08T04:56:18.070Z
Learning: Argentina: Good Friday ("Viernes Santo") is established from 1977 by Law 21329. In tests/countries/test_argentina.py, assert presence for range(1977, self.end_year) and absence for range(self.start_year, 1977); do not assert over self.full_range.
Applied to files:
holidays/countries/sweden.py
📚 Learning: 2025-07-09T20:27:37.760Z
Learnt from: KJhellico
Repo: vacanza/holidays PR: 2623
File: holidays/countries/christmas_island.py:110-112
Timestamp: 2025-07-09T20:27:37.760Z
Learning: In Christmas Island, ANZAC Day (April 25) follows the same observed holiday rules as other holidays, using the SAT_SUN_TO_NEXT_MON rule to move to Monday when it falls on a weekend. The implementation correctly uses `_add_observed` wrapper around `_add_anzac_day`.
Applied to files:
holidays/countries/sweden.py
📚 Learning: 2025-08-12T18:40:16.160Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2794
File: holidays/countries/ethiopia.py:63-63
Timestamp: 2025-08-12T18:40:16.160Z
Learning: Ethiopian Epiphany (Timkat) date calculation correctly uses `is_ethiopian_leap_year(self._year - 1)` in the `_add_epiphany_day` helper in `holidays/groups/christian.py`. Since Epiphany occurs in January and belongs to the Ethiopian year that started in the previous Gregorian year, it checks Ethiopian leap year rules for `self._year - 1`. This is the proper approach, not using Gregorian leap year rules.
Applied to files:
holidays/countries/sweden.py
📚 Learning: 2025-06-18T10:26:50.180Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 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/sweden.py
📚 Learning: 2025-07-08T10:20:04.069Z
Learnt from: KJhellico
Repo: vacanza/holidays PR: 2701
File: holidays/countries/palestine.py:131-131
Timestamp: 2025-07-08T10:20:04.069Z
Learning: In Palestine, both the first and second days of Christmas (Orthodox and Catholic) are holidays. The first day is a nationwide public holiday, while the second day is a holiday for the relevant religious groups (Catholic or Orthodox) with the same name. The implementation correctly uses `_add_christmas_day` for nationwide holidays and `_add_christmas_day_two` for group-specific second days.
Applied to files:
holidays/countries/sweden.py
📚 Learning: 2025-08-21T04:56:03.780Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2843
File: holidays/countries/burundi.py:63-101
Timestamp: 2025-08-21T04:56:03.780Z
Learning: In the holidays library, countries with localization support DO use tr() wrappers around holiday names when calling _add_* methods. This is the correct pattern for l10n-enabled country implementations, contrary to previous learning about translation being handled internally by _add_* methods.
Applied to files:
holidays/countries/sweden.py
📚 Learning: 2025-06-16T14:08:09.492Z
Learnt from: KJhellico
Repo: vacanza/holidays PR: 2635
File: holidays/countries/bhutan.py:13-16
Timestamp: 2025-06-16T14:08:09.492Z
Learning: In the holidays library, translation is performed in the `_add_holiday` methods, not at the string level. Holiday strings passed to `_add_holiday_*` methods are processed through the translation machinery within those methods, so using `tr()` or `self.tr()` wrappers is unnecessary.
Applied to files:
holidays/countries/sweden.py
📚 Learning: 2025-05-10T04:32:15.760Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2537
File: holidays/countries/finland.py:0-0
Timestamp: 2025-05-10T04:32:15.760Z
Learning: In the holidays package, detailed historical context and additional information should be added as comments at the method level or above conditional blocks, while comments directly above tr() function calls should only contain the holiday name itself (e.g., "# Independence Day.").
Applied to files:
holidays/countries/sweden.py
📚 Learning: 2025-06-18T10:07:58.780Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 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/sweden.py
📚 Learning: 2025-03-30T20:18:46.006Z
Learnt from: KJhellico
Repo: vacanza/holidays PR: 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/sweden.py
📚 Learning: 2025-06-14T11:04:31.180Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2609
File: holidays/countries/nauru.py:57-60
Timestamp: 2025-06-14T11:04:31.180Z
Learning: In the holidays library, the base `HolidayBase._populate()` method already includes a guard clause that prevents holiday population methods like `_populate_public_holidays()` from being called when the year is before `start_year` or after `end_year`. Therefore, individual country implementations do not need to add their own guard clauses for years before independence or other start dates.
Applied to files:
holidays/countries/sweden.py
📚 Learning: 2025-07-10T03:36:16.461Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2706
File: holidays/countries/cayman_islands.py:80-97
Timestamp: 2025-07-10T03:36:16.461Z
Learning: In the holidays library, date dictionaries that map years to specific dates (like queens_birthday_dates, special holiday dates, etc.) are typically defined within the _populate_public_holidays method rather than as module-level constants. This is the established library-wide pattern and should be maintained for consistency.
Applied to files:
holidays/countries/sweden.py
📚 Learning: 2025-06-16T11:46:35.303Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 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/sweden.py
📚 Learning: 2025-05-06T21:07:11.577Z
Learnt from: KJhellico
Repo: vacanza/holidays PR: 2530
File: tests/countries/test_andorra.py:23-28
Timestamp: 2025-05-06T21:07:11.577Z
Learning: In the holidays project, test methods for country holidays follow a standard form where year ranges are explicitly recreated in each test method rather than being stored as class variables, to maintain consistency across all country tests.
Applied to files:
tests/countries/test_sweden.py
📚 Learning: 2025-04-05T04:47:27.213Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2416
File: tests/countries/test_turkmenistan.py:52-64
Timestamp: 2025-04-05T04:47:27.213Z
Learning: For holiday tests in the vacanza/holidays project, structure tests by individual holidays rather than by years. Each test method should focus on a specific holiday and test it across multiple years (from start_year through 2050) using helper methods like `assertHolidayName`. For fixed holidays, use generators like `(f"{year}-01-01" for year in range(1991, 2051))`. For movable holidays, specify individual dates for specific years followed by a range check.
Applied to files:
tests/countries/test_sweden.py
📚 Learning: 2025-05-09T18:36:09.607Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2537
File: tests/countries/test_finland.py:23-26
Timestamp: 2025-05-09T18:36:09.607Z
Learning: The holidays project prioritizes complete historical coverage in tests, verifying holidays from their first year of observance (e.g., 1853 for Finland) through future projections, rather than using shorter sliding windows.
Applied to files:
tests/countries/test_sweden.py
📚 Learning: 2025-09-03T16:49:35.246Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2881
File: tests/countries/test_argentina.py:375-375
Timestamp: 2025-09-03T16:49:35.246Z
Learning: In the holidays library, national holiday tests use self.full_range (or similar comprehensive year ranges) even when explicit test dates only show modern observance. This is intentional for correctness and comprehensive coverage, unlike subdivision-specific holidays which have explicit year boundaries based on known start dates.
Applied to files:
tests/countries/test_sweden.py
📚 Learning: 2025-09-18T03:19:23.722Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2881
File: tests/countries/test_algeria.py:28-30
Timestamp: 2025-09-18T03:19:23.722Z
Learning: In the vacanza/holidays project, tests now use self.start_year and self.end_year from the TestCase class instead of country-specific aliases (like DZ.start_year) for start_year and end_year references. This approach provides the test framework with better control over test year ranges rather than being tied to specific country start years.
Applied to files:
tests/countries/test_sweden.py
📚 Learning: 2025-04-05T06:49:06.217Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2386
File: tests/countries/test_nepal.py:499-536
Timestamp: 2025-04-05T06:49:06.217Z
Learning: In the holidays project, test files follow a dual testing approach: individual methods test specific holidays across multiple years, while comprehensive year-specific tests (e.g., `test_2025`) verify all holidays for a specific year in a single assertion. Both approaches serve different testing purposes and complement each other.
Applied to files:
tests/countries/test_sweden.py
📚 Learning: 2025-11-08T05:36:32.788Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2881
File: tests/countries/test_faroe_islands.py:16-16
Timestamp: 2025-11-08T05:36:32.788Z
Learning: In PR #2881 onwards, the vacanza/holidays project moved to centralized alias testing via the `check_aliases` method in `tests/common.py`. Individual country test files no longer need to import country code aliases (e.g., FO, FRO for Faroe Islands) or define `test_country_aliases` methods. The common test framework automatically validates all aliases by dynamically importing them from the registry and calling `assertAliases`.
Applied to files:
tests/countries/test_sweden.py
📚 Learning: 2025-09-14T16:03:13.558Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2881
File: tests/countries/test_barbados.py:21-23
Timestamp: 2025-09-14T16:03:13.558Z
Learning: In tests/countries/test_barbados.py, using years_non_observed=range(2000, 2024) is intentional because all observed holiday examples fall within 2001-2023, making this range appropriate for limiting testing to years where observed holidays actually exist in the test data.
Applied to files:
tests/countries/test_sweden.py
📚 Learning: 2025-04-05T04:29:38.042Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 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_sweden.py
📚 Learning: 2025-04-05T04:50:40.752Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 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_sweden.py
📚 Learning: 2025-04-05T04:33:53.254Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 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_sweden.py
📚 Learning: 2025-09-10T21:12:39.614Z
Learnt from: KJhellico
Repo: vacanza/holidays PR: 2854
File: tests/countries/test_sudan.py:21-25
Timestamp: 2025-09-10T21:12:39.614Z
Learning: Sudan holidays implementation does not include observed holiday logic (holidays that shift when falling on weekends), so test files for Sudan should not use years_non_observed parameter in the setUpClass method.
Applied to files:
tests/countries/test_sweden.py
📚 Learning: 2025-09-10T14:35:54.603Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2881
File: tests/countries/test_brazil.py:28-30
Timestamp: 2025-09-10T14:35:54.603Z
Learning: In the holidays project, the test_no_holidays method should test ALL supported_categories (via categories=CountryClass.supported_categories) rather than just the default PUBLIC category, to ensure comprehensive validation that no holidays exist before start_year across any supported category including OPTIONAL and subdivision categories.
Applied to files:
tests/countries/test_sweden.py
📚 Learning: 2025-06-16T15:48:48.680Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 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_sweden.py
📚 Learning: 2025-06-18T17:01:58.067Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 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)` where HolidayClass is passed as the first argument. This is the correct signature used across all country test files.
Applied to files:
tests/countries/test_sweden.py
📚 Learning: 2025-09-10T16:17:30.428Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2881
File: tests/countries/test_bosnia_and_herzegovina.py:21-24
Timestamp: 2025-09-10T16:17:30.428Z
Learning: Bosnia and Herzegovina holidays implementation currently lacks a start_year attribute. In tests/countries/test_bosnia_and_herzegovina.py, using cls.full_range = range(2000, 2050) is intentional to bound assertions and setup. Do not suggest replacing it with harness default full_range until start_year is introduced.
Applied to files:
tests/countries/test_sweden.py
📚 Learning: 2025-09-14T06:39:32.896Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2881
File: tests/countries/test_switzerland.py:22-23
Timestamp: 2025-09-14T06:39:32.896Z
Learning: In tests/countries/test_switzerland.py, the cls.full_range = range(1970, 2050) is intentionally hard-coded rather than using CH.start_year until a proper test case refactor is completed for Switzerland's implementation.
Applied to files:
tests/countries/test_sweden.py
📚 Learning: 2025-09-17T09:07:56.459Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2881
File: tests/countries/test_paraguay.py:134-139
Timestamp: 2025-09-17T09:07:56.459Z
Learning: In the vacanza/holidays project, when testing holidays that start from a specific year (not the country's start_year), the standard pattern is to use `range(specific_year, self.end_year)` for the holiday dates and `assertNoHolidayName(name, range(self.start_year, specific_year))` for the gap period. Using `self.full_range` with year conditions like `if year >= specific_year` is not the established pattern and would be inconsistent with the codebase.
Applied to files:
tests/countries/test_sweden.py
📚 Learning: 2025-09-02T08:02:03.604Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2881
File: tests/financial/test_ice_futures_europe.py:22-22
Timestamp: 2025-09-02T08:02:03.604Z
Learning: In the vacanza/holidays project, cls.full_range should only be introduced in financial test classes when there are test methods that actually iterate over or use the full year range. For test classes like ICEFuturesEurope that only have year-specific tests (e.g., test_2021, test_2022), using the range directly in setUpClass is preferred to avoid premature abstraction.
Applied to files:
tests/countries/test_sweden.py
📚 Learning: 2025-09-25T08:56:22.473Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2881
File: tests/countries/test_azerbaijan.py:23-24
Timestamp: 2025-09-25T08:56:22.473Z
Learning: In the vacanza/holidays project's test framework, TestCase.setUpClass is designed to handle pre-existing cls.full_range attributes. If a test class manually sets cls.full_range before calling super().setUpClass(), the framework will use cls.full_range.start and cls.full_range.stop to set start_year and end_year, then use cls.full_range as the years parameter. This allows test classes to define custom year ranges when needed while still integrating with the framework.
Applied to files:
tests/countries/test_sweden.py
📚 Learning: 2025-11-28T02:24:17.418Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 3088
File: tests/countries/test_gabon.py:88-110
Timestamp: 2025-11-28T02:24:17.418Z
Learning: For Gabon's holiday implementation (tests/countries/test_gabon.py), all Islamic holiday dates are currently estimates. Therefore, the correct test pattern is to use assertIslamicNoEstimatedHolidayName for both specific known dates and the full range (e.g., test_eid_al_fitr and test_eid_al_adha), rather than using assertHolidayName for specific dates followed by assertIslamicNoEstimatedHolidayName for the range.
Applied to files:
tests/countries/test_sweden.py
📚 Learning: 2025-07-09T21:16:35.145Z
Learnt from: KJhellico
Repo: vacanza/holidays PR: 2623
File: tests/countries/test_christmas_island.py:136-146
Timestamp: 2025-07-09T21:16:35.145Z
Learning: In Christmas Island's holiday implementation, the test_christmas_day method cannot use assertNoNonObservedHoliday because in some years observed Christmas Day overlaps with Boxing Day when both holidays are moved due to weekend conflicts, causing the standard non-observed holiday check to fail inappropriately.
Applied to files:
tests/countries/test_sweden.py
📚 Learning: 2025-07-24T15:21:31.632Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2750
File: tests/countries/test_germany.py:46-46
Timestamp: 2025-07-24T15:21:31.632Z
Learning: In the holidays project test files, the standard method name for testing the absence of holidays is `test_no_holidays`, not more descriptive names like `test_no_holidays_before_1990`. This is a consistent naming convention across country test files like France and Germany.
Applied to files:
tests/countries/test_sweden.py
📚 Learning: 2025-09-14T16:23:46.707Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2881
File: tests/countries/test_botswana.py:59-59
Timestamp: 2025-09-14T16:23:46.707Z
Learning: In Botswana's holiday tests, assertNonObservedHoliday(dt) is used to verify that certain holidays (like Easter holidays) stay on their original dates regardless of the observed holiday system, which is different from assertNoNonObservedHoliday that checks for absence of non-observed holidays.
Applied to files:
tests/countries/test_sweden.py
📚 Learning: 2025-09-28T05:42:12.777Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2881
File: tests/countries/test_indonesia.py:221-223
Timestamp: 2025-09-28T05:42:12.777Z
Learning: In tests/countries/test_indonesia.py, the manual set inclusion checks using get_named and years_found for Lunar New Year (test_lunar_new_year) and Vesak Day (test_vesak_day) are intentional and should remain until both holidays get their own `{insert}_no_estimated` flags implemented, rather than using standard harness assertions like assertHolidayName/assertNoHolidayName.
Applied to files:
tests/countries/test_sweden.py
🧬 Code graph analysis (2)
holidays/countries/sweden.py (3)
holidays/calendars/gregorian.py (3)
_get_all_sundays(92-95)_get_nth_weekday_from(45-61)_timedelta(37-42)holidays/holiday_base.py (1)
_add_holiday(798-810)holidays/groups/international.py (1)
_add_labor_day(115-124)
tests/countries/test_sweden.py (1)
holidays/countries/sweden.py (1)
Sweden(28-192)
🪛 Ruff (0.14.6)
holidays/countries/sweden.py
129-129: Missing return type annotation for private function _populate_common
Add return type annotation: None
(ANN202)
155-155: Missing return type annotation for private function _populate_bank_holidays
Add return type annotation: None
(ANN202)
179-179: Missing return type annotation for private function _populate_optional_holidays
Add return type annotation: None
(ANN202)
tests/countries/test_sweden.py
713-713: String contains ambiguous у (CYRILLIC SMALL LETTER U). Did you mean y (LATIN SMALL LETTER Y)?
(RUF001)
713-713: String contains ambiguous с (CYRILLIC SMALL LETTER ES). Did you mean c (LATIN SMALL LETTER C)?
(RUF001)
713-713: String contains ambiguous і (CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I). Did you mean i (LATIN SMALL LETTER I)?
(RUF001)
713-713: String contains ambiguous х (CYRILLIC SMALL LETTER HA). Did you mean x (LATIN SMALL LETTER X)?
(RUF001)
714-714: String contains ambiguous у (CYRILLIC SMALL LETTER U). Did you mean y (LATIN SMALL LETTER Y)?
(RUF001)
714-714: String contains ambiguous с (CYRILLIC SMALL LETTER ES). Did you mean c (LATIN SMALL LETTER C)?
(RUF001)
714-714: String contains ambiguous і (CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I). Did you mean i (LATIN SMALL LETTER I)?
(RUF001)
714-714: String contains ambiguous х (CYRILLIC SMALL LETTER HA). Did you mean x (LATIN SMALL LETTER X)?
(RUF001)
⏰ 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). (5)
- GitHub Check: Test Python 3.13 on windows-latest
- GitHub Check: Test Python 3.12 on windows-latest
- GitHub Check: Test Python 3.14 on windows-latest
- GitHub Check: Test Python 3.10 on windows-latest
- GitHub Check: Test Python 3.11 on windows-latest
Co-authored-by: Panpakorn Siripanich <[email protected]> Signed-off-by: ~Jhellico <[email protected]>
|
@davidhedlund, your feedback on these changes would be very valuable. |
There was a problem hiding this comment.
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 (1)
tests/countries/test_sweden.py (1)
15-25: Setup for BANK/OPTIONAL tests looks good; consider extendingtest_no_holidaysImporting
BANK/OPTIONALand overridingcls.holidays = Sweden(include_sundays=False, years=cls.full_range)keeps the base fixture focused on statutory public holidays while separate tests cover Sunday behavior and category variants.Given Sweden now defines
supported_categories = (BANK, OPTIONAL, PUBLIC), it would be safer to explicitly assert there are no holidays in any category beforestart_year, following the Brazil pattern:class TestSweden(CommonCountryTests, SundayHolidays, TestCase): @@ @classmethod def setUpClass(cls): super().setUpClass(Sweden) cls.holidays = Sweden(include_sundays=False, years=cls.full_range) + + def test_no_holidays(self): + # No holidays in any category before the country start year. + self.assertNoHolidayName( + Sweden, + range(self.start_year - 1, self.start_year), + categories=Sweden.supported_categories, + )Adjust the exact helper (
assertNoHolidayName/assertNoHolidays) to match the common pattern used in other multi-category country tests.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (2)
holidays/locale/th/LC_MESSAGES/SE.po(5 hunks)tests/countries/test_sweden.py(4 hunks)
🧰 Additional context used
🧠 Learnings (42)
📓 Common learnings
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2881
File: tests/countries/test_brazil.py:28-30
Timestamp: 2025-09-10T14:35:54.603Z
Learning: In the holidays project, the test_no_holidays method should test ALL supported_categories (via categories=CountryClass.supported_categories) rather than just the default PUBLIC category, to ensure comprehensive validation that no holidays exist before start_year across any supported category including OPTIONAL and subdivision categories.
Learnt from: KJhellico
Repo: vacanza/holidays PR: 2783
File: tests/countries/test_eritrea.py:130-147
Timestamp: 2025-08-18T13:06:16.919Z
Learning: The `assertLocalizedHolidays` method in the vacanza/holidays project requires a complete list of all holidays from all categories (PUBLIC, GOVERNMENT, etc.), not just the holidays from the default category. This is a framework requirement for comprehensive localization testing.
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2881
File: tests/countries/test_curacao.py:29-29
Timestamp: 2025-09-20T12:24:28.864Z
Learning: For Curacao in the holidays library, PUBLIC and HALF_DAY categories have different start years - PUBLIC holidays begin at the country's start_year while HALF_DAY holidays begin in 2010. When testing no_holidays methods, each category should be tested separately with appropriate pre-start years rather than using a unified supported_categories approach.
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2881
File: tests/countries/test_french_polynesia.py:19-22
Timestamp: 2025-11-08T05:09:56.159Z
Learning: In the vacanza/holidays project's test framework (PR #2881 onwards), the base class CommonCountryTests provides a default test_no_holidays implementation that automatically tests years=start_year - 1 for standard PUBLIC category cases. Individual country test files should only override test_no_holidays when the country supports additional non-PUBLIC categories (GOVERNMENT, WORKDAY, OPTIONAL, etc.) with different start years requiring separate validation.
Learnt from: KJhellico
Repo: vacanza/holidays PR: 2854
File: tests/countries/test_sudan.py:29-31
Timestamp: 2025-09-12T21:37:10.710Z
Learning: For countries in the holidays library that only use the default PUBLIC category (like Sudan), there's no need to specify `categories=Sudan.supported_categories` in test_no_holidays methods, as it would be equivalent to the default behavior.
Learnt from: KJhellico
Repo: vacanza/holidays PR: 2854
File: tests/countries/test_sudan.py:29-31
Timestamp: 2025-09-12T21:37:10.710Z
Learning: For countries in the holidays library that only use the default PUBLIC category (like Sudan), there's no need to specify `categories=Sudan.supported_categories` in test_no_holidays methods, as it would be equivalent to the default behavior.
Learnt from: KJhellico
Repo: vacanza/holidays PR: 2854
File: tests/countries/test_sudan.py:29-31
Timestamp: 2025-09-12T21:37:10.710Z
Learning: For countries in the holidays library that only use the default PUBLIC category (like Sudan), there's no need to specify `categories=Sudan.supported_categories` in test_no_holidays methods, as it would be equivalent to the default behavior.
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2881
File: tests/countries/test_brunei.py:27-29
Timestamp: 2025-09-29T08:09:54.436Z
Learning: For Brunei in the holidays library, only the default PUBLIC category is used, so there's no need to specify `categories=Brunei.supported_categories` in test_no_holidays methods, as it would be equivalent to the default behavior and Brunei doesn't define supported_categories.
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2881
File: tests/countries/test_antigua_and_barbuda.py:27-29
Timestamp: 2025-09-14T16:19:23.651Z
Learning: For Antigua and Barbuda in the holidays library, only the default PUBLIC category is used, so there's no need to specify `categories=AntiguaAndBarbuda.supported_categories` in test_no_holidays methods, as it would be equivalent to the default behavior and AntiguaAndBarbuda doesn't define supported_categories.
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2881
File: tests/countries/test_antigua_and_barbuda.py:27-29
Timestamp: 2025-09-14T16:19:23.651Z
Learning: For Antigua and Barbuda in the holidays library, only the default PUBLIC category is used, so there's no need to specify `categories=AntiguaAndBarbuda.supported_categories` in test_no_holidays methods, as it would be equivalent to the default behavior and AntiguaAndBarbuda doesn't define supported_categories.
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2537
File: tests/countries/test_finland.py:23-26
Timestamp: 2025-05-09T18:36:09.607Z
Learning: The holidays project prioritizes complete historical coverage in tests, verifying holidays from their first year of observance (e.g., 1853 for Finland) through future projections, rather than using shorter sliding windows.
Learnt from: KJhellico
Repo: vacanza/holidays PR: 2851
File: docs/holiday_categories.md:272-282
Timestamp: 2025-08-26T14:43:53.605Z
Learning: In the holidays library documentation, it's strongly advisable to recommend the use of constants from holidays.constants (e.g., PUBLIC, CATHOLIC) instead of direct string values when specifying holiday categories, as constants provide better type safety, IDE support, and prevent typos.
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2323
File: holidays/countries/macau.py:284-366
Timestamp: 2025-03-04T11:41:56.389Z
Learning: For Macau holidays implementation, maintaining separate methods for each holiday category (PUBLIC, MANDATORY, GOVERNMENT) is preferred because these categories are based on different sets of laws and have distinct historical evolution.
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2323
File: holidays/countries/macau.py:278-377
Timestamp: 2025-03-05T02:35:03.298Z
Learning: For Macau holiday implementations, it's preferable to maintain separate methods for different holiday categories (MANDATORY, GOVERNMENT, PUBLIC) as they are based on different sets of laws, making the code easier to maintain despite having multiple year-based conditionals.
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2881
File: holidays/countries/south_africa.py:69-75
Timestamp: 2025-09-14T07:26:25.431Z
Learning: When reviewing historical holiday implementations in the vacanza/holidays repository, trust the maintainers' research and implementation decisions for specific historical edge cases, especially when they can provide sources like Wikipedia or other historical documentation that supports unusual or complex date calculation rules during specific time periods.
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2323
File: holidays/countries/macau.py:407-461
Timestamp: 2025-03-04T11:32:45.095Z
Learning: In the holidays library, the standard approach for organizing static holidays is to use separate dictionaries for different categories (`government`, `mandatory`, and `public`), which are utilized by syntactic sugar methods.
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 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.
Learnt from: KJhellico
Repo: vacanza/holidays PR: 2653
File: holidays/locale/th/LC_MESSAGES/TW.po:17-21
Timestamp: 2025-06-21T18:06:50.027Z
Learning: KJhellico's username includes a tilde character (~) as part of their nickname (appears as "~Jhellico" in Last-Translator headers), which is intentional formatting and not an error.
📚 Learning: 2025-06-28T10:39:19.185Z
Learnt from: KJhellico
Repo: vacanza/holidays PR: 2684
File: holidays/locale/it/LC_MESSAGES/SM.po:13-13
Timestamp: 2025-06-28T10:39:19.185Z
Learning: In the holidays project, .po file header comments use the format "# [Country] holidays." for default language files (without trailing hash) and "# [Country] holidays [locale] localization." for non-default language files (also without trailing hash).
Applied to files:
holidays/locale/th/LC_MESSAGES/SE.po
📚 Learning: 2025-06-26T15:34:35.476Z
Learnt from: KJhellico
Repo: vacanza/holidays PR: 2676
File: holidays/locale/en_US/LC_MESSAGES/TN.po:17-28
Timestamp: 2025-06-26T15:34:35.476Z
Learning: In the holidays project, .po file header metadata updates (version numbers, revision dates, translator information) are legitimate changes when part of localization work and don't require `make l10n` regeneration. The `make l10n` command is primarily for formatting fixes and missing translator comments, not for intentional metadata updates.
Applied to files:
holidays/locale/th/LC_MESSAGES/SE.po
📚 Learning: 2025-09-26T13:58:49.363Z
Learnt from: KJhellico
Repo: vacanza/holidays PR: 2960
File: holidays/locale/ca/LC_MESSAGES/ES.po:148-151
Timestamp: 2025-09-26T13:58:49.363Z
Learning: In the holidays project, when translating holiday names in .po files, the msgstr should be a faithful translation of the original msgid (in the country's default language), not influenced by English commentary or common en_US names. For example, "Día de la Pascua Granada" (Spanish) correctly translates to "Dia de la Pasqua Granada" (Catalan), even though the English comment refers to it as "Whit Monday".
Applied to files:
holidays/locale/th/LC_MESSAGES/SE.po
📚 Learning: 2025-03-30T18:25:07.087Z
Learnt from: KJhellico
Repo: vacanza/holidays PR: 2388
File: holidays/locale/en_CI/LC_MESSAGES/CI.po:88-88
Timestamp: 2025-03-30T18:25:07.087Z
Learning: In the holidays library, localization files have a specific structure: message comments are in standard English (en_US) describing the holiday, while actual translations (msgstr) should use the locale-specific terminology (e.g., en_CI for Ivory Coast English). For example, "Night of Power" in standard English is translated as "Lailatou-Kadr" in Ivory Coast English.
Applied to files:
holidays/locale/th/LC_MESSAGES/SE.po
📚 Learning: 2025-06-29T09:37:35.283Z
Learnt from: KJhellico
Repo: vacanza/holidays PR: 2687
File: holidays/locale/en_US/LC_MESSAGES/CF.po:13-28
Timestamp: 2025-06-29T09:37:35.283Z
Learning: In the holidays project, .po files follow a standard formatting convention where there is always a blank line after the metadata header section (after the "X-Source-Language" line). This blank line separates the header from the actual translation content and should not be removed.
Applied to files:
holidays/locale/th/LC_MESSAGES/SE.po
📚 Learning: 2025-06-11T18:32:25.595Z
Learnt from: ankushhKapoor
Repo: vacanza/holidays PR: 2601
File: holidays/locale/en_MN/LC_MESSAGES/MN.po:13-14
Timestamp: 2025-06-11T18:32:25.595Z
Learning: For non-default locale `.po` files, the header comment format is:
`# <Country> holidays <locale> localization.` (no trailing hash).
Applied to files:
holidays/locale/th/LC_MESSAGES/SE.po
📚 Learning: 2025-06-26T13:20:10.172Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2678
File: holidays/locale/th/LC_MESSAGES/US.po:30-34
Timestamp: 2025-06-26T13:20:10.172Z
Learning: In the holidays library Thai localizations, the "observed" format consistently uses "ชดเชย%s" without spaces between the Thai word and placeholder across all .po files in the codebase.
Applied to files:
holidays/locale/th/LC_MESSAGES/SE.po
📚 Learning: 2025-09-25T10:05:04.107Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2959
File: tests/countries/test_myanmar.py:398-434
Timestamp: 2025-09-25T10:05:04.107Z
Learning: In the holidays library Thai localizations, there are two distinct patterns: 1) "%s (observed)" holidays use "ชดเชย%s" format, and 2) "Day off (substituted from %s)" holidays use "วันหยุด (แทน %s)" format. These serve different purposes and should not be confused - substituted holidays are not the same as observed holidays.
Applied to files:
holidays/locale/th/LC_MESSAGES/SE.po
📚 Learning: 2025-05-06T15:25:44.333Z
Learnt from: KJhellico
Repo: vacanza/holidays PR: 2530
File: holidays/locale/ca/LC_MESSAGES/AD.po:31-40
Timestamp: 2025-05-06T15:25:44.333Z
Learning: In the Holidays project, msgid fields in localization files contain strings in the entity's default language (as defined by default_language attribute), not English source strings as in standard gettext implementations.
Applied to files:
holidays/locale/th/LC_MESSAGES/SE.po
📚 Learning: 2025-03-05T17:51:00.633Z
Learnt from: KJhellico
Repo: vacanza/holidays PR: 2259
File: holidays/locale/en_IN/LC_MESSAGES/IN.po:30-299
Timestamp: 2025-03-05T17:51:00.633Z
Learning: In the Holidays project, .po files for a country's default locale use empty msgstr fields as a standard convention.
Applied to files:
holidays/locale/th/LC_MESSAGES/SE.po
📚 Learning: 2025-03-04T10:06:57.171Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2323
File: holidays/locale/en_MO/LC_MESSAGES/MO.po:86-96
Timestamp: 2025-03-04T10:06:57.171Z
Learning: In Macau holiday localizations, having multiple Chinese variants (聖誕節前日, 聖誕節前夕, 聖誕前夕) for "Christmas Eve" is intentional design, as confirmed by the developer.
Applied to files:
holidays/locale/th/LC_MESSAGES/SE.po
📚 Learning: 2025-06-25T10:09:29.029Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2676
File: holidays/locale/ar/LC_MESSAGES/EG.po:0-0
Timestamp: 2025-06-25T10:09:29.029Z
Learning: In the holidays library, msgstr fields can be left empty for source/default_language files when using Lingva, the localization tool used by the project.
Applied to files:
holidays/locale/th/LC_MESSAGES/SE.po
📚 Learning: 2025-04-17T17:08:48.082Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2438
File: holidays/locale/ar_IQ/LC_MESSAGES/IQ.po:35-81
Timestamp: 2025-04-17T17:08:48.082Z
Learning: In holiday PO files, when the file represents the default language of an entity (e.g., ar_IQ for Iraq), no translations in `msgstr` are required as the `msgid` values are already in the target language.
Applied to files:
holidays/locale/th/LC_MESSAGES/SE.po
📚 Learning: 2025-06-10T12:17:58.880Z
Learnt from: KJhellico
Repo: vacanza/holidays PR: 2608
File: holidays/locale/en_VC/LC_MESSAGES/VC.po:1-14
Timestamp: 2025-06-10T12:17:58.880Z
Learning: In the holidays project, .po files should use the full multi-line header format including the project description, authors, website, and license information, rather than a single-line comment format.
Applied to files:
holidays/locale/th/LC_MESSAGES/SE.po
📚 Learning: 2025-03-30T13:33:31.598Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2388
File: holidays/locale/fr/LC_MESSAGES/CI.po:28-101
Timestamp: 2025-03-30T13:33:31.598Z
Learning: In the holidays library, for localization files of the default language (like French for Ivory Coast in fr/LC_MESSAGES/CI.po), the best practice is to leave the message strings (msgstr) empty to avoid possible typos, since the message IDs (msgid) are already in the target language.
Applied to files:
holidays/locale/th/LC_MESSAGES/SE.po
📚 Learning: 2025-07-04T03:26:56.759Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2651
File: holidays/locale/en_US/LC_MESSAGES/BQ.po:61-63
Timestamp: 2025-07-04T03:26:56.759Z
Learning: In the holidays library, "Eerste Pinksterdag" (Dutch for Pentecost Sunday) is consistently translated as "Whit Sunday" across all Dutch-speaking territories' en_US locale files, rather than "Pentecost", to maintain consistency within the codebase.
Applied to files:
holidays/locale/th/LC_MESSAGES/SE.po
📚 Learning: 2025-11-08T05:09:56.159Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2881
File: tests/countries/test_french_polynesia.py:19-22
Timestamp: 2025-11-08T05:09:56.159Z
Learning: In the vacanza/holidays project's test framework (PR #2881 onwards), the base class CommonCountryTests provides a default test_no_holidays implementation that automatically tests years=start_year - 1 for standard PUBLIC category cases. Individual country test files should only override test_no_holidays when the country supports additional non-PUBLIC categories (GOVERNMENT, WORKDAY, OPTIONAL, etc.) with different start years requiring separate validation.
Applied to files:
tests/countries/test_sweden.py
📚 Learning: 2025-04-05T04:47:27.213Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2416
File: tests/countries/test_turkmenistan.py:52-64
Timestamp: 2025-04-05T04:47:27.213Z
Learning: For holiday tests in the vacanza/holidays project, structure tests by individual holidays rather than by years. Each test method should focus on a specific holiday and test it across multiple years (from start_year through 2050) using helper methods like `assertHolidayName`. For fixed holidays, use generators like `(f"{year}-01-01" for year in range(1991, 2051))`. For movable holidays, specify individual dates for specific years followed by a range check.
Applied to files:
tests/countries/test_sweden.py
📚 Learning: 2025-05-06T21:07:11.577Z
Learnt from: KJhellico
Repo: vacanza/holidays PR: 2530
File: tests/countries/test_andorra.py:23-28
Timestamp: 2025-05-06T21:07:11.577Z
Learning: In the holidays project, test methods for country holidays follow a standard form where year ranges are explicitly recreated in each test method rather than being stored as class variables, to maintain consistency across all country tests.
Applied to files:
tests/countries/test_sweden.py
📚 Learning: 2025-09-03T16:49:35.246Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2881
File: tests/countries/test_argentina.py:375-375
Timestamp: 2025-09-03T16:49:35.246Z
Learning: In the holidays library, national holiday tests use self.full_range (or similar comprehensive year ranges) even when explicit test dates only show modern observance. This is intentional for correctness and comprehensive coverage, unlike subdivision-specific holidays which have explicit year boundaries based on known start dates.
Applied to files:
tests/countries/test_sweden.py
📚 Learning: 2025-05-09T18:36:09.607Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2537
File: tests/countries/test_finland.py:23-26
Timestamp: 2025-05-09T18:36:09.607Z
Learning: The holidays project prioritizes complete historical coverage in tests, verifying holidays from their first year of observance (e.g., 1853 for Finland) through future projections, rather than using shorter sliding windows.
Applied to files:
tests/countries/test_sweden.py
📚 Learning: 2025-04-03T16:58:27.175Z
Learnt from: Wasif-Shahzad
Repo: vacanza/holidays PR: 2409
File: holidays/countries/qatar.py:27-46
Timestamp: 2025-04-03T16:58:27.175Z
Learning: In the holidays library, method names like `_add_holiday_2nd_tue_of_feb()` and `_add_holiday_1st_sun_of_mar()` use calendar constants internally through parent class implementations even when these constants don't appear directly in the file. Removing imports that seem unused based on a simple text search could break functionality.
Applied to files:
tests/countries/test_sweden.py
📚 Learning: 2025-04-05T06:49:06.217Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2386
File: tests/countries/test_nepal.py:499-536
Timestamp: 2025-04-05T06:49:06.217Z
Learning: In the holidays project, test files follow a dual testing approach: individual methods test specific holidays across multiple years, while comprehensive year-specific tests (e.g., `test_2025`) verify all holidays for a specific year in a single assertion. Both approaches serve different testing purposes and complement each other.
Applied to files:
tests/countries/test_sweden.py
📚 Learning: 2025-09-18T03:19:23.722Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2881
File: tests/countries/test_algeria.py:28-30
Timestamp: 2025-09-18T03:19:23.722Z
Learning: In the vacanza/holidays project, tests now use self.start_year and self.end_year from the TestCase class instead of country-specific aliases (like DZ.start_year) for start_year and end_year references. This approach provides the test framework with better control over test year ranges rather than being tied to specific country start years.
Applied to files:
tests/countries/test_sweden.py
📚 Learning: 2025-09-28T05:42:12.777Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2881
File: tests/countries/test_indonesia.py:221-223
Timestamp: 2025-09-28T05:42:12.777Z
Learning: In tests/countries/test_indonesia.py, the manual set inclusion checks using get_named and years_found for Lunar New Year (test_lunar_new_year) and Vesak Day (test_vesak_day) are intentional and should remain until both holidays get their own `{insert}_no_estimated` flags implemented, rather than using standard harness assertions like assertHolidayName/assertNoHolidayName.
Applied to files:
tests/countries/test_sweden.py
📚 Learning: 2025-09-10T16:17:30.428Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2881
File: tests/countries/test_bosnia_and_herzegovina.py:21-24
Timestamp: 2025-09-10T16:17:30.428Z
Learning: Bosnia and Herzegovina holidays implementation currently lacks a start_year attribute. In tests/countries/test_bosnia_and_herzegovina.py, using cls.full_range = range(2000, 2050) is intentional to bound assertions and setup. Do not suggest replacing it with harness default full_range until start_year is introduced.
Applied to files:
tests/countries/test_sweden.py
📚 Learning: 2025-04-05T04:29:38.042Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 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_sweden.py
📚 Learning: 2025-04-05T04:50:40.752Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 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_sweden.py
📚 Learning: 2025-04-05T04:33:53.254Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 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_sweden.py
📚 Learning: 2025-09-10T21:12:39.614Z
Learnt from: KJhellico
Repo: vacanza/holidays PR: 2854
File: tests/countries/test_sudan.py:21-25
Timestamp: 2025-09-10T21:12:39.614Z
Learning: Sudan holidays implementation does not include observed holiday logic (holidays that shift when falling on weekends), so test files for Sudan should not use years_non_observed parameter in the setUpClass method.
Applied to files:
tests/countries/test_sweden.py
📚 Learning: 2025-09-10T14:35:54.603Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2881
File: tests/countries/test_brazil.py:28-30
Timestamp: 2025-09-10T14:35:54.603Z
Learning: In the holidays project, the test_no_holidays method should test ALL supported_categories (via categories=CountryClass.supported_categories) rather than just the default PUBLIC category, to ensure comprehensive validation that no holidays exist before start_year across any supported category including OPTIONAL and subdivision categories.
Applied to files:
tests/countries/test_sweden.py
📚 Learning: 2025-06-16T15:48:48.680Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 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_sweden.py
📚 Learning: 2025-06-18T17:01:58.067Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 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)` where HolidayClass is passed as the first argument. This is the correct signature used across all country test files.
Applied to files:
tests/countries/test_sweden.py
📚 Learning: 2025-09-14T06:39:32.896Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2881
File: tests/countries/test_switzerland.py:22-23
Timestamp: 2025-09-14T06:39:32.896Z
Learning: In tests/countries/test_switzerland.py, the cls.full_range = range(1970, 2050) is intentionally hard-coded rather than using CH.start_year until a proper test case refactor is completed for Switzerland's implementation.
Applied to files:
tests/countries/test_sweden.py
📚 Learning: 2025-09-17T09:07:56.459Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2881
File: tests/countries/test_paraguay.py:134-139
Timestamp: 2025-09-17T09:07:56.459Z
Learning: In the vacanza/holidays project, when testing holidays that start from a specific year (not the country's start_year), the standard pattern is to use `range(specific_year, self.end_year)` for the holiday dates and `assertNoHolidayName(name, range(self.start_year, specific_year))` for the gap period. Using `self.full_range` with year conditions like `if year >= specific_year` is not the established pattern and would be inconsistent with the codebase.
Applied to files:
tests/countries/test_sweden.py
📚 Learning: 2025-09-02T08:02:03.604Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2881
File: tests/financial/test_ice_futures_europe.py:22-22
Timestamp: 2025-09-02T08:02:03.604Z
Learning: In the vacanza/holidays project, cls.full_range should only be introduced in financial test classes when there are test methods that actually iterate over or use the full year range. For test classes like ICEFuturesEurope that only have year-specific tests (e.g., test_2021, test_2022), using the range directly in setUpClass is preferred to avoid premature abstraction.
Applied to files:
tests/countries/test_sweden.py
📚 Learning: 2025-09-25T08:56:22.473Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2881
File: tests/countries/test_azerbaijan.py:23-24
Timestamp: 2025-09-25T08:56:22.473Z
Learning: In the vacanza/holidays project's test framework, TestCase.setUpClass is designed to handle pre-existing cls.full_range attributes. If a test class manually sets cls.full_range before calling super().setUpClass(), the framework will use cls.full_range.start and cls.full_range.stop to set start_year and end_year, then use cls.full_range as the years parameter. This allows test classes to define custom year ranges when needed while still integrating with the framework.
Applied to files:
tests/countries/test_sweden.py
📚 Learning: 2025-11-28T02:24:17.418Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 3088
File: tests/countries/test_gabon.py:88-110
Timestamp: 2025-11-28T02:24:17.418Z
Learning: For Gabon's holiday implementation (tests/countries/test_gabon.py), all Islamic holiday dates are currently estimates. Therefore, the correct test pattern is to use assertIslamicNoEstimatedHolidayName for both specific known dates and the full range (e.g., test_eid_al_fitr and test_eid_al_adha), rather than using assertHolidayName for specific dates followed by assertIslamicNoEstimatedHolidayName for the range.
Applied to files:
tests/countries/test_sweden.py
📚 Learning: 2025-07-09T21:16:35.145Z
Learnt from: KJhellico
Repo: vacanza/holidays PR: 2623
File: tests/countries/test_christmas_island.py:136-146
Timestamp: 2025-07-09T21:16:35.145Z
Learning: In Christmas Island's holiday implementation, the test_christmas_day method cannot use assertNoNonObservedHoliday because in some years observed Christmas Day overlaps with Boxing Day when both holidays are moved due to weekend conflicts, causing the standard non-observed holiday check to fail inappropriately.
Applied to files:
tests/countries/test_sweden.py
📚 Learning: 2025-07-24T15:21:31.632Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2750
File: tests/countries/test_germany.py:46-46
Timestamp: 2025-07-24T15:21:31.632Z
Learning: In the holidays project test files, the standard method name for testing the absence of holidays is `test_no_holidays`, not more descriptive names like `test_no_holidays_before_1990`. This is a consistent naming convention across country test files like France and Germany.
Applied to files:
tests/countries/test_sweden.py
📚 Learning: 2025-09-14T16:23:46.707Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2881
File: tests/countries/test_botswana.py:59-59
Timestamp: 2025-09-14T16:23:46.707Z
Learning: In Botswana's holiday tests, assertNonObservedHoliday(dt) is used to verify that certain holidays (like Easter holidays) stay on their original dates regardless of the observed holiday system, which is different from assertNoNonObservedHoliday that checks for absence of non-observed holidays.
Applied to files:
tests/countries/test_sweden.py
🧬 Code graph analysis (1)
tests/countries/test_sweden.py (1)
holidays/countries/sweden.py (1)
Sweden(28-192)
🪛 Ruff (0.14.6)
tests/countries/test_sweden.py
713-713: String contains ambiguous у (CYRILLIC SMALL LETTER U). Did you mean y (LATIN SMALL LETTER Y)?
(RUF001)
713-713: String contains ambiguous с (CYRILLIC SMALL LETTER ES). Did you mean c (LATIN SMALL LETTER C)?
(RUF001)
713-713: String contains ambiguous і (CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I). Did you mean i (LATIN SMALL LETTER I)?
(RUF001)
713-713: String contains ambiguous х (CYRILLIC SMALL LETTER HA). Did you mean x (LATIN SMALL LETTER X)?
(RUF001)
714-714: String contains ambiguous у (CYRILLIC SMALL LETTER U). Did you mean y (LATIN SMALL LETTER Y)?
(RUF001)
714-714: String contains ambiguous с (CYRILLIC SMALL LETTER ES). Did you mean c (LATIN SMALL LETTER C)?
(RUF001)
714-714: String contains ambiguous і (CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I). Did you mean i (LATIN SMALL LETTER I)?
(RUF001)
714-714: String contains ambiguous х (CYRILLIC SMALL LETTER HA). Did you mean x (LATIN SMALL LETTER X)?
(RUF001)
⏰ 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). (5)
- GitHub Check: Test Python 3.14 on windows-latest
- GitHub Check: Test Python 3.13 on windows-latest
- GitHub Check: Test Python 3.12 on windows-latest
- GitHub Check: Test Python 3.11 on windows-latest
- GitHub Check: Test Python 3.10 on windows-latest
🔇 Additional comments (16)
holidays/locale/th/LC_MESSAGES/SE.po (3)
17-27: Header metadata updates look consistent with l10n conventionsProject/version, revision date, translator, and tool metadata follow the established .po header pattern; nothing to change here.
30-33: Time-label translation matches begin_time_label usage
"%s (ตั้งแต่ 14:00 น.)"is a good fit for"%s (från kl. 14.00)"and lines up with the expectations intest_l10n_thfor “from 2pm” holidays.
43-46: Feast of the Annunciation & National Day entries align with codeSwitch to
msgid "Marie bebådelsedag"and using"วันสมโภชแม่พระรับสาร"keeps the existing, accurate Thai rendering.
"Nationaldagen" → "วันชาติ"is also the natural Thai label for the National Day.Also applies to: 67-70
tests/countries/test_sweden.py (13)
26-31: Using generators +full_rangefor fixed-date holidays is solidThe refactor to:
test_new_years_dayandtest_epiphanyusing
(f"{year}-MM-DD" for year in self.full_range)keeps coverage dense fromstart_yearthroughend_yearwith minimal boilerplate.
32-50: Feast of the Annunciation test matches the new legal-rule implementationThe dedicated
test_feast_of_annunciation:
- Pins tricky historical dates where the “Palm/Easter Sunday” exception applies.
- Then asserts presence across
range(self.start_year, 1990)and absence from 1990 onward.This lines up with the
_year <= 1989logic inSweden._populate_public_holidays.
52-90: Easter trio extended to full range and 2025 checks outAdding 2025 dates and
self.assertHolidayName(name, self.full_range)for:
- Good Friday (
Långfredagen),- Easter Sunday (
Påskdagen),- Easter Monday (
Annandag påsk)matches the ChristianHolidays rules and improves historical coverage.
91-111: May Day, Ascension, and National Day rules are correctly constrained
Första majandKristi himmelsfärdsdagon their known 2020–2025 dates plusfull_rangecoverage are in line with the base helpers.test_national_daycorrectly enforcesNationaldagenonly from 2005 onward (range(2005, self.end_year)and a negative check before 2005), matching the law change.
112-138: Whit Sunday / Monday transition around 2005 is well covered
Pingstdagenasserted acrossself.full_range.Annandag pingstexplicitly listed up to 2004, then asserted present only onrange(self.start_year, 2005)and absent thereafter.This matches the move from Whit Monday to the National Day as a public holiday.
139-168: Midsummer Day, All Saints’ Day, and Christmas fixed-date coverage is robust
- New 2025 examples for
MidsommardagenandAlla helgons dagline up with the “first Saturday from June 20 / October 31” rules.- Using
self.full_rangeforJuldagenandAnnandag julkeeps the Christmas pair exhaustively tested.
172-243: Core BANK/OPTIONAL-only eves are tested cleanly per categoryFor:
- Twelfth Night,
- Maundy Thursday,
- Walpurgis Night,
- Midsummer Eve,
- All Saints’ Eve,
- Christmas Eve,
- New Year’s Eve,
you consistently:
- Assert they are not standard public holidays (
assertNoHolidayName).- Assert presence for BANK and OPTIONAL categories on the right dates and across
self.full_rangewhere appropriate.That cleanly encodes the “non-public but bank/optional” nature of these eves.
244-300: Bank-only “day before …” holidays are correctly isolatedThe tests for:
- Day before Ascension Day,
- Day before Midsummer Eve,
- Day before Whitsun Eve,
- Day before Christmas Eve,
- Day before New Year’s Eve,
use
assertNoHolidayName+assertNoOptionalHolidayNameand thenassertBankHolidayNameover sample dates andfull_range. This matches the design where these half-days are strictly bank holidays.
301-345: Optional-only Holy Saturday, squeeze day, and Whitsun Eve are well distinguishedEach of:
Påskafton,Klämdag,Pingstafton,is asserted to be:
- Not a standard public holiday,
- Not a bank holiday (where applicable),
- Present as OPTIONAL on both concrete dates and
self.full_range.This matches
_populate_optional_holidaysbehavior.
359-407: 2022 snapshot tests for PUBLIC, BANK and OPTIONAL categories line up with rules
test_2022withSweden(include_sundays=False, years=2022)now includes National Day and excludes Sundays as intended.test_bank_2022andtest_optional_2022neatly enumerate exactly the BANK/OPTIONAL dates derived from_populate_common,_populate_bank_holidays, and_populate_optional_holidays.These give a clear year-level sanity check over the per-holiday assertions.
409-487: Default (sv) 2025 localization covers Sundays + all categoriesThe
test_l10n_defaultlist for 2025:
- Includes every Sunday with “Söndag”.
- Adds PUBLIC, BANK, and OPTIONAL holidays with correct Swedish labels and combined names where dates overlap (e.g., National Day + Day before Whitsun Eve, Easter Sunday + Sunday, Midsummer cluster).
This looks consistent with
Sweden.supported_categoriesand the new begin_time_label.
489-568: en_US localization mirrors the Swedish structure accuratelyFor 2025,
test_l10n_en_us:
- Reflects the same date set as the default test.
- Uses idiomatic English names (“Twelfth Night (from 2pm)”, “Squeeze day”, “Whitsun Eve”, etc.).
- Preserves combined-name ordering on multi-holiday dates.
Nothing stands out as mismatched with the Swedish source.
651-729: Ukrainian 2025 localization is thorough; Ruff warnings are benign hereThe
test_l10n_ukblock:
- Mirrors the same 2025 date set and combined holidays as sv/en_US/th.
- Uses consistent Ukrainian terminology for Sundays, eves, and “from 2pm” labels.
Static analysis complaints about “ambiguous” Cyrillic letters are expected false positives in this context; the strings are legitimate Ukrainian and don’t need changing.
|
Other countries translations contain "วันพฤหัสศักดิสิทธิ์" also, so they will need to be corrected. 🙄 |
I'll open separate PR for other countries later (from quick look at it: Norway, Spain, USA, ...) |
As a Swedish citizen, I consider this an overall improvement. The sole exception is my comment:
|
This PR addresses a discussion in the issue, but that discussion is unrelated to the core split feature request. Therefore, the issue should remain open. |
|
About "Marie bebådelsedag", as I say here
, I am sure that this holiday was official until 1990; there is no such confirmation for the other holidays mentioned there (in particular, the apostolic ones). |
Act 1952:48, which regulated the celebration of Midsummer Day and other holidays, was effectively replaced by Act 1989:253. This is the reason why I only referenced Act 1989:253 in the main post of #3067 (comment) |
"Marie bebådelsedag" is not found in Act 1989:253 |
Yes, exactly, and that is why it's a holiday only until 1989 (inclusive). |
Okay, got it. Then everything is in place. |
Co-authored-by: Panpakorn Siripanich <[email protected]> Signed-off-by: ~Jhellico <[email protected]>
|



Proposed change
Update Sweden holidays:
Inspired by #3067.
Type of change
holidaysfunctionality in general)Checklist
make checklocally; all checks and tests passed.