-
-
Notifications
You must be signed in to change notification settings - Fork 558
Update Tanzania holidays: extend holidays support to 1965 #2821
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Summary by CodeRabbit
WalkthroughAdds observed-day handling to Tanzania holidays, extends historical and Islamic holiday data back to 1965 (Islamic dates through 2025), updates Swahili/English translations and snapshot regeneration, and expands tests to cover 1965–2050 with new naming and observance rules. Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested reviewers
Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. 📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro 💡 Knowledge Base configuration:
You can enable these sources in your CodeRabbit configuration. 📒 Files selected for processing (3)
🧰 Additional context used🧠 Learnings (50)📓 Common learnings
📚 Learning: 2025-08-26T09:43:38.294Z
Applied to files:
📚 Learning: 2025-08-15T19:16:14.119Z
Applied to files:
📚 Learning: 2025-08-15T19:16:14.119Z
Applied to files:
📚 Learning: 2025-08-11T10:14:28.517Z
Applied to files:
📚 Learning: 2025-07-09T20:27:37.760Z
Applied to files:
📚 Learning: 2025-07-02T18:17:53.342Z
Applied to files:
📚 Learning: 2025-08-25T09:57:22.263Z
Applied to files:
📚 Learning: 2025-08-19T21:22:13.125Z
Applied to files:
📚 Learning: 2025-08-08T14:35:35.829Z
Applied to files:
📚 Learning: 2025-05-10T04:32:15.760Z
Applied to files:
📚 Learning: 2025-08-25T09:57:22.263Z
Applied to files:
📚 Learning: 2025-03-19T16:54:58.657Z
Applied to files:
📚 Learning: 2025-03-29T15:15:05.919Z
Applied to files:
📚 Learning: 2025-08-03T13:48:11.910Z
Applied to files:
📚 Learning: 2025-03-19T16:53:00.375Z
Applied to files:
📚 Learning: 2025-05-09T18:36:09.607Z
Applied to files:
📚 Learning: 2025-03-23T10:11:50.465Z
Applied to files:
📚 Learning: 2025-08-15T20:49:30.223Z
Applied to files:
📚 Learning: 2025-06-15T20:39:51.085Z
Applied to files:
📚 Learning: 2025-07-14T20:23:48.198Z
Applied to files:
📚 Learning: 2025-07-09T21:16:35.145Z
Applied to files:
📚 Learning: 2025-05-13T13:23:11.375Z
Applied to files:
📚 Learning: 2025-07-08T10:20:04.069Z
Applied to files:
📚 Learning: 2025-06-14T11:04:24.104Z
Applied to files:
📚 Learning: 2025-06-14T11:04:24.104Z
Applied to files:
📚 Learning: 2025-07-02T18:21:59.302Z
Applied to files:
📚 Learning: 2025-04-04T10:52:41.546Z
Applied to files:
📚 Learning: 2025-04-04T10:52:41.546Z
Applied to files:
📚 Learning: 2025-08-19T20:39:52.024Z
Applied to files:
📚 Learning: 2025-06-15T11:52:39.572Z
Applied to files:
📚 Learning: 2025-06-16T12:28:31.641Z
Applied to files:
📚 Learning: 2025-04-13T20:41:56.613Z
Applied to files:
📚 Learning: 2025-08-19T21:00:47.849Z
Applied to files:
📚 Learning: 2025-06-06T14:40:31.932Z
Applied to files:
📚 Learning: 2025-06-14T11:04:31.180Z
Applied to files:
📚 Learning: 2025-04-03T12:36:41.201Z
Applied to files:
📚 Learning: 2025-04-23T09:59:19.886Z
Applied to files:
📚 Learning: 2025-08-12T18:40:16.160Z
Applied to files:
📚 Learning: 2025-04-05T06:49:06.217Z
Applied to files:
📚 Learning: 2025-06-19T02:34:18.382Z
Applied to files:
📚 Learning: 2025-04-23T09:22:41.753Z
Applied to files:
📚 Learning: 2025-04-25T20:27:59.086Z
Applied to files:
📚 Learning: 2025-06-13T12:18:03.539Z
Applied to files:
📚 Learning: 2025-07-10T15:55:34.523Z
Applied to files:
📚 Learning: 2025-08-21T06:52:25.503Z
Applied to files:
📚 Learning: 2025-04-13T19:10:31.502Z
Applied to files:
📚 Learning: 2025-03-30T18:25:07.087Z
Applied to files:
📚 Learning: 2025-03-08T11:28:48.652Z
Applied to files:
📚 Learning: 2025-07-08T10:21:37.055Z
Applied to files:
🧬 Code graph analysis (1)holidays/countries/tanzania.py (7)
🔇 Additional comments (25)
✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
Status, Documentation and Community
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #2821 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 292 292
Lines 17291 17330 +39
Branches 2245 2259 +14
=========================================
+ Hits 17291 17330 +39 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 7
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (5)
holidays/countries/tanzania.py
(8 hunks)holidays/locale/en_US/LC_MESSAGES/TZ.po
(3 hunks)holidays/locale/sw/LC_MESSAGES/TZ.po
(3 hunks)snapshots/countries/TZ_COMMON.json
(24 hunks)tests/countries/test_tanzania.py
(4 hunks)
🧰 Additional context used
🧠 Learnings (30)
📓 Common learnings
Learnt from: PPsyrius
PR: vacanza/holidays#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.
📚 Learning: 2025-04-03T05:59:57.480Z
Learnt from: PPsyrius
PR: vacanza/holidays#2407
File: snapshots/countries/TL_COMMON.json:7-7
Timestamp: 2025-04-03T05:59:57.480Z
Learning: In the holidays project, snapshot files (like snapshots/countries/TL_COMMON.json) are auto-generated when running `make snapshot` and should not be manually edited. Semicolons (;) in holiday entries are used as separators when multiple holidays occur on the same date.
Applied to files:
snapshots/countries/TZ_COMMON.json
📚 Learning: 2025-06-26T15:34:35.476Z
Learnt from: KJhellico
PR: vacanza/holidays#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/sw/LC_MESSAGES/TZ.po
📚 Learning: 2025-03-30T18:25:07.087Z
Learnt from: KJhellico
PR: vacanza/holidays#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/sw/LC_MESSAGES/TZ.po
holidays/locale/en_US/LC_MESSAGES/TZ.po
📚 Learning: 2025-03-08T11:28:48.652Z
Learnt from: KJhellico
PR: vacanza/holidays#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/sw/LC_MESSAGES/TZ.po
holidays/locale/en_US/LC_MESSAGES/TZ.po
📚 Learning: 2025-05-06T15:25:44.333Z
Learnt from: KJhellico
PR: vacanza/holidays#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/sw/LC_MESSAGES/TZ.po
holidays/locale/en_US/LC_MESSAGES/TZ.po
📚 Learning: 2025-06-25T10:09:29.029Z
Learnt from: PPsyrius
PR: vacanza/holidays#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/sw/LC_MESSAGES/TZ.po
holidays/locale/en_US/LC_MESSAGES/TZ.po
📚 Learning: 2025-06-28T10:39:19.185Z
Learnt from: KJhellico
PR: vacanza/holidays#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/sw/LC_MESSAGES/TZ.po
holidays/locale/en_US/LC_MESSAGES/TZ.po
📚 Learning: 2025-04-05T04:47:27.213Z
Learnt from: PPsyrius
PR: vacanza/holidays#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_tanzania.py
📚 Learning: 2025-05-06T21:07:11.577Z
Learnt from: KJhellico
PR: vacanza/holidays#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_tanzania.py
📚 Learning: 2025-04-05T06:49:06.217Z
Learnt from: PPsyrius
PR: vacanza/holidays#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_tanzania.py
📚 Learning: 2025-04-04T10:52:41.546Z
Learnt from: KJhellico
PR: vacanza/holidays#2398
File: holidays/countries/guinea.py:106-110
Timestamp: 2025-04-04T10:52:41.546Z
Learning: In the Guinea holidays implementation, observed Eid al-Fitr cases are properly covered by the test_eid_al_fitr_day() method, which tests both the regular holiday dates and the observed dates when the holiday falls on a non-working day (for years >= 2023).
Applied to files:
tests/countries/test_tanzania.py
📚 Learning: 2025-07-02T18:17:53.342Z
Learnt from: KJhellico
PR: vacanza/holidays#2608
File: tests/countries/test_saint_vincent_and_the_grenadines.py:162-178
Timestamp: 2025-07-02T18:17:53.342Z
Learning: In the Saint Vincent and the Grenadines holidays implementation, New Year's Day is added without observed rules using `_add_new_years_day()` and should not include observed rule testing in its test method. Only holidays explicitly wrapped with `_add_observed()` have observed behavior.
Applied to files:
tests/countries/test_tanzania.py
holidays/countries/tanzania.py
📚 Learning: 2025-04-05T04:50:40.752Z
Learnt from: PPsyrius
PR: vacanza/holidays#2416
File: tests/countries/test_turkmenistan.py:31-49
Timestamp: 2025-04-05T04:50:40.752Z
Learning: For Turkmenistan holiday tests, use this class structure: `class TestTurkmenistan(CommonCountryTests, TestCase)` with imports `from unittest import TestCase`, `from holidays.countries import Turkmenistan, TM, TKM`, and `from tests.common import CommonCountryTests`. Ensure to call `super().setUp()` in the setUp method.
Applied to files:
tests/countries/test_tanzania.py
📚 Learning: 2025-05-09T18:36:09.607Z
Learnt from: PPsyrius
PR: vacanza/holidays#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_tanzania.py
📚 Learning: 2025-04-04T10:52:41.546Z
Learnt from: KJhellico
PR: vacanza/holidays#2398
File: holidays/countries/guinea.py:106-110
Timestamp: 2025-04-04T10:52:41.546Z
Learning: In the Guinea holidays implementation, observed Eid al-Fitr cases are covered by the test_eid_al_fitr_day() method, which tests both regular holiday dates and the observed dates when the holiday falls on a non-working day (for years >= 2023).
Applied to files:
tests/countries/test_tanzania.py
📚 Learning: 2025-07-24T15:21:31.632Z
Learnt from: PPsyrius
PR: vacanza/holidays#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_tanzania.py
📚 Learning: 2025-06-18T17:01:58.067Z
Learnt from: PPsyrius
PR: vacanza/holidays#2642
File: tests/countries/test_wallis_and_futuna.py:19-23
Timestamp: 2025-06-18T17:01:58.067Z
Learning: In the vacanza/holidays repository, the standard pattern for test class setUpClass methods is `super().setUpClass(HolidayClass)` or `super().setUpClass(HolidayClass, years=...)` where HolidayClass is passed as the first argument. This is the correct signature that matches the CommonCountryTests.setUpClass method which accepts test_class as the first parameter after cls. Pylint warnings about parameter count mismatch are false positives when comparing against TestCase.setUpClass instead of the immediate parent CommonCountryTests.setUpClass.
Applied to files:
tests/countries/test_tanzania.py
📚 Learning: 2025-04-05T04:29:38.042Z
Learnt from: PPsyrius
PR: vacanza/holidays#2416
File: tests/countries/test_turkmenistan.py:85-86
Timestamp: 2025-04-05T04:29:38.042Z
Learning: For testing holiday implementations in the vacanza/holidays repository, recommend using `from tests.common import CommonCountryTests` as the base class instead of directly using `unittest.TestCase` to maintain consistency with project conventions and leverage common test utilities.
Applied to files:
tests/countries/test_tanzania.py
📚 Learning: 2025-04-05T04:33:53.254Z
Learnt from: PPsyrius
PR: vacanza/holidays#2416
File: tests/countries/test_turkmenistan.py:52-64
Timestamp: 2025-04-05T04:33:53.254Z
Learning: For Turkmenistan holiday tests, recommend using CommonCountryTests as the base class rather than unittest.TestCase to follow project conventions, be consistent with other country test files, and gain access to common test utilities.
Applied to files:
tests/countries/test_tanzania.py
📚 Learning: 2025-06-18T17:01:58.067Z
Learnt from: PPsyrius
PR: vacanza/holidays#2642
File: tests/countries/test_wallis_and_futuna.py:19-23
Timestamp: 2025-06-18T17:01:58.067Z
Learning: In the vacanza/holidays repository, the standard pattern for test class setUpClass methods is `super().setUpClass(HolidayClass)` 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_tanzania.py
📚 Learning: 2025-06-22T21:36:18.015Z
Learnt from: KJhellico
PR: vacanza/holidays#2671
File: tests/countries/test_libya.py:19-24
Timestamp: 2025-06-22T21:36:18.015Z
Learning: In the vacanza/holidays project, test classes for countries do not use docstrings. All test classes follow the same pattern: class declaration directly followed by classmethod def setUpClass(cls) without any docstrings for the class or methods.
Applied to files:
tests/countries/test_tanzania.py
📚 Learning: 2025-07-09T21:16:35.145Z
Learnt from: KJhellico
PR: vacanza/holidays#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_tanzania.py
📚 Learning: 2025-06-13T12:18:03.539Z
Learnt from: PPsyrius
PR: vacanza/holidays#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/tanzania.py
📚 Learning: 2025-07-09T20:27:37.760Z
Learnt from: KJhellico
PR: vacanza/holidays#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/tanzania.py
📚 Learning: 2025-03-19T16:53:00.375Z
Learnt from: PPsyrius
PR: vacanza/holidays#2354
File: holidays/countries/fiji.py:185-188
Timestamp: 2025-03-19T16:53:00.375Z
Learning: In the Fiji holidays implementation, the `special_public_holidays_observed` dictionary in `FijiStaticHolidays` is only used for exceptions to the normal observance rules, not for documenting all holidays. Only 2019's Constitution Day needed a special entry as it didn't follow the standard patterns.
Applied to files:
holidays/countries/tanzania.py
📚 Learning: 2025-04-13T19:10:31.502Z
Learnt from: KJhellico
PR: vacanza/holidays#2465
File: holidays/countries/suriname.py:219-251
Timestamp: 2025-04-13T19:10:31.502Z
Learning: The `_CustomIslamicHolidays` classes in this project contain only exact verified holiday dates from reliable sources, rather than calculated or estimated future dates. This is by design to ensure accuracy, particularly for religious holidays that may follow lunar calendars or depend on local observations.
Applied to files:
holidays/countries/tanzania.py
📚 Learning: 2025-03-19T16:54:58.657Z
Learnt from: PPsyrius
PR: vacanza/holidays#2354
File: holidays/countries/fiji.py:146-159
Timestamp: 2025-03-19T16:54:58.657Z
Learning: In the holidays library implementation, explicit holiday dates (like Diwali in Fiji) are only defined for historical years with official sources (2016-2025). Future dates beyond the explicitly defined range are automatically calculated by methods like `_add_diwali`, which provide approximations when official dates aren't yet available.
Applied to files:
holidays/countries/tanzania.py
📚 Learning: 2025-08-11T10:14:28.517Z
Learnt from: PPsyrius
PR: vacanza/holidays#2794
File: holidays/groups/christian.py:328-343
Timestamp: 2025-08-11T10:14:28.517Z
Learning: For Ethiopian holidays in the `holidays/groups/christian.py` file, docstring wording should maintain source-accurate phrasing (e.g., "in coincidence of" for Ethiopian New Year/Enkutatash), even when it might read awkwardly in English, to ensure consistency with official Ethiopian documentation.
Applied to files:
holidays/locale/en_US/LC_MESSAGES/TZ.po
📚 Learning: 2025-03-05T17:51:00.633Z
Learnt from: KJhellico
PR: vacanza/holidays#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/TZ.po
🧬 Code Graph Analysis (2)
tests/countries/test_tanzania.py (1)
holidays/countries/tanzania.py (1)
Tanzania
(32-272)
holidays/countries/tanzania.py (2)
holidays/groups/custom.py (1)
StaticHolidays
(18-47)holidays/observed_holiday_base.py (3)
ObservedHolidayBase
(102-246)_populate_observed
(208-219)_add_observed
(144-196)
🔇 Additional comments (17)
holidays/locale/sw/LC_MESSAGES/TZ.po (2)
17-27
: PO header bumps look good.Project-Id-Version, PO-Revision-Date, and X-Generator updates are fine for a localization refresh. No action needed.
35-44
: Observed/estimated label entries align with code.The Swahili msgids for observed and observed+estimated (“Badala ya %s”, “Badala ya %s (makisio)”) match Tanzania.observed_label/observed_estimated_label. Keeping msgstr empty in the default-language file is correct for this project.
snapshots/countries/TZ_COMMON.json (1)
1-1517
: Snapshot expansion and observed-day propagation look consistent.The snapshot reflects the widened range (1965–2050), observed/estimated variants, and historical one-offs (e.g., 1967-12-01 EAC inauguration, 1994 Christmas observed, 2022 observed set). Names and observed labels match the PO updates and tanzania.py behavior.
holidays/locale/en_US/LC_MESSAGES/TZ.po (3)
35-44
: Observed/estimated label translations are correct.“Badala ya %s” → “%s (observed)” and “Badala ya %s (makisio)” → “%s (observed, estimated)” align with ObservedHolidayBase behavior for label composition.
65-72
: New party founding day translations look right.“Kuzaliwa kwa Chama cha Mapinduzi”/“Kuzaliwa kwa ASP” mapped to “CCM Party Founding Day”/“Afro-Shirazi Party Founding Day” are appropriate.
78-85
: Good Friday/Easter Monday mappings LGTM.“Ijumaa Kuu” → “Good Friday”, “Jumatatu ya Pasaka” → “Easter Monday” are correct.
tests/countries/test_tanzania.py (2)
321-352
: 2022 comprehensive set assertion matches code and snapshot.The dates and localized names align with the observed exceptions and renamed labels in tanzania.py and the snapshot. Good coverage.
23-27
: Consider including 2050 in the precomputed years.You set years = range(1965, 2050), which excludes 2050. Not breaking, but using 2051 ensures any future assertions that touch 2050 use the prebuilt set.
Apply this diff:
- years = range(1965, 2050) + years = range(1965, 2051)⛔ Skipped due to learnings
Learnt from: PPsyrius PR: vacanza/holidays#2629 File: tests/countries/test_namibia.py:22-23 Timestamp: 2025-06-14T10:58:43.636Z Learning: In the vacanza/holidays project, country test files consistently use range(start_year, 2050) which intentionally excludes 2050 and stops at 2049. This is a library-wide implementation pattern, not an off-by-one error.
Learnt from: PPsyrius PR: vacanza/holidays#2416 File: tests/countries/test_turkmenistan.py:31-49 Timestamp: 2025-04-05T04:50:40.752Z Learning: For Turkmenistan holiday tests, use this class structure: `class TestTurkmenistan(CommonCountryTests, TestCase)` with imports `from unittest import TestCase`, `from holidays.countries import Turkmenistan, TM, TKM`, and `from tests.common import CommonCountryTests`. Ensure to call `super().setUp()` in the setUp method.
Learnt from: PPsyrius PR: vacanza/holidays#2642 File: tests/countries/test_wallis_and_futuna.py:19-23 Timestamp: 2025-06-18T17:01:58.067Z Learning: In the vacanza/holidays repository, the standard pattern for test class setUpClass methods is `super().setUpClass(HolidayClass)` or `super().setUpClass(HolidayClass, years=...)` where HolidayClass is passed as the first argument. This is the correct signature that matches the CommonCountryTests.setUpClass method which accepts test_class as the first parameter after cls. Pylint warnings about parameter count mismatch are false positives when comparing against TestCase.setUpClass instead of the immediate parent CommonCountryTests.setUpClass.
Learnt from: KJhellico PR: vacanza/holidays#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.
holidays/countries/tanzania.py (9)
13-29
: Imports and base class wiring are correct.Adding ObservedHolidayBase and observed-rule constants is appropriate for centralized observance handling.
85-97
: Start year lowered to 1965 matches PR objective.Default language, labels, and start_year updates are consistent. Observed/estimated labels match PO entries.
156-170
: NYD gating to <=1966 or >=1987 matches statutory changes.The removal in 1966 and reintroduction in 1987 are encoded clearly. Good.
179-190
: Karume Day observed handling is wired into dts_observed.Adding Apr 7 to dts_observed ensures it participates in observed moves; matches snapshots (e.g., 2007-04-09).
197-206
: Union Day vs Union Celebrations naming switch at 1991 is correct.The split in names across the 1991 boundary aligns with history and tests.
210-227
: Saba Saba/Peasants’ Day/International Trade Fair logic accurate.The naming transitions (pre-1977 Saba Saba, 1977–1993 Peasants’ Day on Jul 7, 1994+ Sabasaba on Jul 7, and Aug 8 Peasants’ Day from 1995) mirror known practice and tests.
244-249
: Boxing Day year gating matches Acts.Present in <=1965 and >=1993 only; consistent with snapshot/tests.
424-435
: Special observed holidays list is valuable and matches snapshot.The 1994 and 2022 observed entries capture legal exceptions outside the standard observed rules.
124-146
: Observed logic is sound; consider tightening the Eid check
The year guard (1995–2021
) correctly scopes the observed-holiday logic, and handling Christmas versus the first Eid day viaeid_al_fitr_count
is spot on. To guard against unexpected name variants (e.g. parenthetical suffixes), you might switch the substring test to a prefix check:- if eid_al_fitr in name: + if name.startswith(eid_al_fitr):Otherwise, everything looks solid.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
♻️ Duplicate comments (1)
tests/countries/test_tanzania.py (1)
228-240
: Optional: add 1994 Christmas observed to strengthen edge-case coverageThis complements the special observed window that includes 1994.
Apply this diff:
obs_dt = ( + "1994-12-27", "2005-12-27", "2010-12-27", "2011-12-27", "2016-12-27", "2021-12-27", )
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
tests/countries/test_tanzania.py
(4 hunks)
🧰 Additional context used
🧠 Learnings (18)
📓 Common learnings
Learnt from: PPsyrius
PR: vacanza/holidays#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
PR: vacanza/holidays#2354
File: holidays/countries/fiji.py:171-183
Timestamp: 2025-03-29T15:15:05.919Z
Learning: In the Fiji holidays implementation, the maintainers are aware of the need to extend the MAWLID_DATES dictionary beyond 2025 when future official references become available, and will do so when appropriate. No suggestions about extending this dictionary should be made in future reviews.
Learnt from: PPsyrius
PR: vacanza/holidays#2354
File: holidays/countries/fiji.py:146-159
Timestamp: 2025-03-19T16:54:58.657Z
Learning: In the holidays library implementation, explicit holiday dates (like Diwali in Fiji) are only defined for historical years with official sources (2016-2025). Future dates beyond the explicitly defined range are automatically calculated by methods like `_add_diwali`, which provide approximations when official dates aren't yet available.
Learnt from: KJhellico
PR: vacanza/holidays#2398
File: holidays/countries/guinea.py:106-110
Timestamp: 2025-04-04T10:52:41.546Z
Learning: In the Guinea holidays implementation, observed Eid al-Fitr cases are properly covered by the test_eid_al_fitr_day() method, which tests both the regular holiday dates and the observed dates when the holiday falls on a non-working day (for years >= 2023).
📚 Learning: 2025-04-05T04:47:27.213Z
Learnt from: PPsyrius
PR: vacanza/holidays#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_tanzania.py
📚 Learning: 2025-05-06T21:07:11.577Z
Learnt from: KJhellico
PR: vacanza/holidays#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_tanzania.py
📚 Learning: 2025-04-05T06:49:06.217Z
Learnt from: PPsyrius
PR: vacanza/holidays#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_tanzania.py
📚 Learning: 2025-04-04T10:52:41.546Z
Learnt from: KJhellico
PR: vacanza/holidays#2398
File: holidays/countries/guinea.py:106-110
Timestamp: 2025-04-04T10:52:41.546Z
Learning: In the Guinea holidays implementation, observed Eid al-Fitr cases are properly covered by the test_eid_al_fitr_day() method, which tests both the regular holiday dates and the observed dates when the holiday falls on a non-working day (for years >= 2023).
Applied to files:
tests/countries/test_tanzania.py
📚 Learning: 2025-04-05T04:50:40.752Z
Learnt from: PPsyrius
PR: vacanza/holidays#2416
File: tests/countries/test_turkmenistan.py:31-49
Timestamp: 2025-04-05T04:50:40.752Z
Learning: For Turkmenistan holiday tests, use this class structure: `class TestTurkmenistan(CommonCountryTests, TestCase)` with imports `from unittest import TestCase`, `from holidays.countries import Turkmenistan, TM, TKM`, and `from tests.common import CommonCountryTests`. Ensure to call `super().setUp()` in the setUp method.
Applied to files:
tests/countries/test_tanzania.py
📚 Learning: 2025-05-09T18:36:09.607Z
Learnt from: PPsyrius
PR: vacanza/holidays#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_tanzania.py
📚 Learning: 2025-07-02T18:17:53.342Z
Learnt from: KJhellico
PR: vacanza/holidays#2608
File: tests/countries/test_saint_vincent_and_the_grenadines.py:162-178
Timestamp: 2025-07-02T18:17:53.342Z
Learning: In the Saint Vincent and the Grenadines holidays implementation, New Year's Day is added without observed rules using `_add_new_years_day()` and should not include observed rule testing in its test method. Only holidays explicitly wrapped with `_add_observed()` have observed behavior.
Applied to files:
tests/countries/test_tanzania.py
📚 Learning: 2025-07-24T15:21:31.632Z
Learnt from: PPsyrius
PR: vacanza/holidays#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_tanzania.py
📚 Learning: 2025-04-04T10:52:41.546Z
Learnt from: KJhellico
PR: vacanza/holidays#2398
File: holidays/countries/guinea.py:106-110
Timestamp: 2025-04-04T10:52:41.546Z
Learning: In the Guinea holidays implementation, observed Eid al-Fitr cases are covered by the test_eid_al_fitr_day() method, which tests both regular holiday dates and the observed dates when the holiday falls on a non-working day (for years >= 2023).
Applied to files:
tests/countries/test_tanzania.py
📚 Learning: 2025-07-09T21:16:35.145Z
Learnt from: KJhellico
PR: vacanza/holidays#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_tanzania.py
📚 Learning: 2025-07-02T18:21:59.302Z
Learnt from: KJhellico
PR: vacanza/holidays#2608
File: tests/countries/test_saint_vincent_and_the_grenadines.py:162-178
Timestamp: 2025-07-02T18:21:59.302Z
Learning: In the Saint Vincent and the Grenadines holiday tests, for holidays without observed rules that only require a single assertHolidayName call, pass the holiday name directly as a string literal rather than storing it in a variable first for cleaner, more concise code.
Applied to files:
tests/countries/test_tanzania.py
📚 Learning: 2025-04-23T14:55:35.504Z
Learnt from: PPsyrius
PR: vacanza/holidays#2489
File: holidays/countries/sao_tome_and_principe.py:22-26
Timestamp: 2025-04-23T14:55:35.504Z
Learning: References in holidays classes should only be included if they're used for test case cross-checks or provide historical context about when holidays were added/removed, not just for the sake of having more references.
Applied to files:
tests/countries/test_tanzania.py
📚 Learning: 2025-06-18T17:01:58.067Z
Learnt from: PPsyrius
PR: vacanza/holidays#2642
File: tests/countries/test_wallis_and_futuna.py:19-23
Timestamp: 2025-06-18T17:01:58.067Z
Learning: In the vacanza/holidays repository, the standard pattern for test class setUpClass methods is `super().setUpClass(HolidayClass)` or `super().setUpClass(HolidayClass, years=...)` where HolidayClass is passed as the first argument. This is the correct signature that matches the CommonCountryTests.setUpClass method which accepts test_class as the first parameter after cls. Pylint warnings about parameter count mismatch are false positives when comparing against TestCase.setUpClass instead of the immediate parent CommonCountryTests.setUpClass.
Applied to files:
tests/countries/test_tanzania.py
📚 Learning: 2025-04-05T04:29:38.042Z
Learnt from: PPsyrius
PR: vacanza/holidays#2416
File: tests/countries/test_turkmenistan.py:85-86
Timestamp: 2025-04-05T04:29:38.042Z
Learning: For testing holiday implementations in the vacanza/holidays repository, recommend using `from tests.common import CommonCountryTests` as the base class instead of directly using `unittest.TestCase` to maintain consistency with project conventions and leverage common test utilities.
Applied to files:
tests/countries/test_tanzania.py
📚 Learning: 2025-04-05T04:33:53.254Z
Learnt from: PPsyrius
PR: vacanza/holidays#2416
File: tests/countries/test_turkmenistan.py:52-64
Timestamp: 2025-04-05T04:33:53.254Z
Learning: For Turkmenistan holiday tests, recommend using CommonCountryTests as the base class rather than unittest.TestCase to follow project conventions, be consistent with other country test files, and gain access to common test utilities.
Applied to files:
tests/countries/test_tanzania.py
📚 Learning: 2025-06-18T17:01:58.067Z
Learnt from: PPsyrius
PR: vacanza/holidays#2642
File: tests/countries/test_wallis_and_futuna.py:19-23
Timestamp: 2025-06-18T17:01:58.067Z
Learning: In the vacanza/holidays repository, the standard pattern for test class setUpClass methods is `super().setUpClass(HolidayClass)` 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_tanzania.py
📚 Learning: 2025-06-22T21:36:18.015Z
Learnt from: KJhellico
PR: vacanza/holidays#2671
File: tests/countries/test_libya.py:19-24
Timestamp: 2025-06-22T21:36:18.015Z
Learning: In the vacanza/holidays project, test classes for countries do not use docstrings. All test classes follow the same pattern: class declaration directly followed by classmethod def setUpClass(cls) without any docstrings for the class or methods.
Applied to files:
tests/countries/test_tanzania.py
🧬 Code Graph Analysis (1)
tests/countries/test_tanzania.py (1)
holidays/countries/tanzania.py (3)
Tanzania
(32-272)TZ
(275-276)TZA
(279-280)
⏰ 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). (3)
- GitHub Check: Test build on macos-latest
- GitHub Check: Test build on windows-latest
- GitHub Check: Test build on ubuntu-latest
🔇 Additional comments (21)
tests/countries/test_tanzania.py (21)
31-34
: LGTM: correct “no holidays” guard for pre-support yearAsserting no holidays for 1964 against all supported categories matches the start_year logic and project conventions.
36-45
: LGTM: special holidays include the new 1967-12-01 caseThe added 1967-12-01 entry aligns with the expanded historical coverage.
47-60
: Verify 2022 observed handling sourceThe 2022 New Year’s observed date is asserted. Given the implementation’s observed logic window for automatic rules is 1995–2021, ensure 2022-01-03 is covered in the special observed dataset.
If that’s intentional via explicit special observed entries, this is good; otherwise, the test may drift from the current observed rule window.
61-71
: LGTM: Zanzibar Revolution Day + observed instancesCoverage and observed dates look consistent with historical practice.
80-94
: LGTM: Karume Day range and observed casesStart year 2006, name, and observed list look accurate.
95-107
: LGTM: Good Friday fixed dates and broad rangeKnown sample dates plus the full-year coverage are appropriate; matches the implementation.
108-122
: Confirm default suite excludes BANK for negative assertionYou assert Easter Sunday exists in
bank_holidays
and then assert it’s absent in the default set. This relies on the default test suite using PUBLIC-only. If the default ever includes BANK, this assertion will fail.If you want to future-proof, you could explicitly target PUBLIC in the negative assertion:
- self.assertNoHolidayName(name, range(1965, 2050)) + self.assertNoHolidayName(name, Tanzania(categories=PUBLIC, years=range(1965, 2051)))Or keep as-is if you’re confident the default stays PUBLIC-only.
123-135
: LGTM: Easter Monday coverageSample dates and full range assertions are consistent with the implementation.
136-152
: LGTM: Union Celebrations naming split + observedThe 1991 renaming boundary and observed instances align with the described rules.
153-165
: LGTM: International Workers’ Day + observedNaming and observed dates look correct across the supported years.
166-200
: LGTM: International Trade Fair / Peasants’ Day evolution + observedYear-bounded naming across 1965/1977/1994 transitions and observed sets for both 07-07 and 08-08 look sound.
201-214
: LGTM: Nyerere Day coverage + observedStart year and observed dates are consistent with the implementation notes.
215-227
: LGTM: Independence and Republic Day + observedSolid coverage with correct observed instances.
241-256
: LGTM: Boxing Day presence window + observedHoliday present in 1965 and >=1993, absent 1966–1992, with appropriate observed instances. Matches the implementation.
257-284
: LGTM: Eid al-Fitr (two days), estimated toggle, and observed
- Two-day coverage for 1965 aligns with the implementation’s _day and _day_two.
no_estimated_holidays
is a good check for label handling.- Observed list years match the stated observed logic window and special entries.
285-306
: LGTM: Eid al-Adha coverage + observedTwo-day 1965 coverage, sample years, and observed dates look consistent with the added datasets.
307-325
: LGTM: Prophet’s Birthday + observed and estimated toggleSamples, range checks, and observed cases match expectations.
326-357
: LGTM: 2022 comprehensive year snapshotNames, observed variants, and dual-Eid handling line up with the revised rules.
359-385
: LGTM: Default localization samplesSwahili labels and combined-name formatting (semicolon) look correct, including the Karume/Good Friday overlap.
386-407
: LGTM: en_US localization samplesEnglish labels and naming conventions are consistent, including ITF/Peasants’ Day and the long-form Nyerere title.
23-26
: Off-by-one: include 2050 in the covered rangeThe PR summary and project convention target coverage through 2050 inclusive. Using
range(1965, 2050)
excludes 2050 from both the fixture years and derived helpers, under-testing the boundary year.Apply this diff to include 2050:
- years = range(1965, 2050) + years = range(1965, 2051)Follow-up: consider updating other occurrences of
range(..., 2050)
across this file torange(..., 2051)
so fixed and movable-holiday assertions also cover 2050.⛔ Skipped due to learnings
Learnt from: PPsyrius PR: vacanza/holidays#2629 File: tests/countries/test_namibia.py:22-23 Timestamp: 2025-06-14T10:58:43.636Z Learning: In the vacanza/holidays project, country test files consistently use range(start_year, 2050) which intentionally excludes 2050 and stops at 2049. This is a library-wide implementation pattern, not an off-by-one error.
Learnt from: PPsyrius PR: vacanza/holidays#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.
Learnt from: KJhellico PR: vacanza/holidays#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.
Learnt from: PPsyrius PR: vacanza/holidays#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.
Learnt from: PPsyrius PR: vacanza/holidays#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: PPsyrius PR: vacanza/holidays#2416 File: tests/countries/test_turkmenistan.py:31-49 Timestamp: 2025-04-05T04:50:40.752Z Learning: For Turkmenistan holiday tests, use this class structure: `class TestTurkmenistan(CommonCountryTests, TestCase)` with imports `from unittest import TestCase`, `from holidays.countries import Turkmenistan, TM, TKM`, and `from tests.common import CommonCountryTests`. Ensure to call `super().setUp()` in the setUp method.
Learnt from: PPsyrius PR: vacanza/holidays#2642 File: tests/countries/test_wallis_and_futuna.py:19-23 Timestamp: 2025-06-18T17:01:58.067Z Learning: In the vacanza/holidays repository, the standard pattern for test class setUpClass methods is `super().setUpClass(HolidayClass)` or `super().setUpClass(HolidayClass, years=...)` where HolidayClass is passed as the first argument. This is the correct signature that matches the CommonCountryTests.setUpClass method which accepts test_class as the first parameter after cls. Pylint warnings about parameter count mismatch are false positives when comparing against TestCase.setUpClass instead of the immediate parent CommonCountryTests.setUpClass.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
♻️ Duplicate comments (6)
holidays/locale/en_US/LC_MESSAGES/TZ.po (1)
138-141
: Swahili grammar fix for Magufuli’s funeral is correct and synchronized."Mazishi ya John Pombe Magufuli" resolves the earlier "cha" error and matches tests and source code.
holidays/locale/sw/LC_MESSAGES/TZ.po (1)
138-141
: Magufuli’s funeral grammar corrected in the source locale."… ya John Pombe Magufuli" is the correct Swahili form. Matches en_US and code references.
tests/countries/test_tanzania.py (2)
72-79
: ASP/CCM split and rename boundaries are accurate.Correct ranges (ASP: 1973–1976, CCM: 1977–1993) with non-existence checks elsewhere. The earlier “AFP→ASP” nit is addressed.
228-241
: Christmas observed includes the 1994 edge case (good catch).1994-12-27 is now explicitly tested as observed; aligns with special_public_holidays_observed.
holidays/countries/tanzania.py (2)
37-83
: References set is thorough; BOT 2024 filename quirk is documented correctly.Retaining the archived 2024 link with a “2023” filename is intentional and source-accurate (BOT reuse pattern).
252-255
: Neutral, source-focused comment style for the 1975 Eid anomaly.Good cleanup avoiding first-person tone while preserving historical nuance.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (4)
holidays/countries/tanzania.py
(8 hunks)holidays/locale/en_US/LC_MESSAGES/TZ.po
(3 hunks)holidays/locale/sw/LC_MESSAGES/TZ.po
(3 hunks)tests/countries/test_tanzania.py
(4 hunks)
🧰 Additional context used
🧠 Learnings (40)
📓 Common learnings
Learnt from: PPsyrius
PR: vacanza/holidays#2821
File: holidays/countries/tanzania.py:37-83
Timestamp: 2025-08-15T19:16:14.070Z
Learning: In Tanzania holiday documentation, the Bank of Tanzania (BOT) may publish yearly public holidays PDFs using URLs with previous year filenames. For example, the 2024 public holidays document is accessible via a URL containing "2023 public holidays.pdf" but contains actual 2024 holiday information. Always check content rather than assuming filename indicates the year covered.
Learnt from: PPsyrius
PR: vacanza/holidays#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: PPsyrius
PR: vacanza/holidays#2821
File: holidays/countries/tanzania.py:37-83
Timestamp: 2025-08-15T19:16:14.070Z
Learning: PDF filenames in government holiday documentation may not always reflect the actual year covered in the content. The Tanzania Bank of Tanzania (BOT) 2024 public holidays document is hosted at a URL containing "2023" in the filename but contains 2024 holiday information.
Learnt from: KJhellico
PR: vacanza/holidays#2354
File: holidays/countries/fiji.py:171-183
Timestamp: 2025-03-29T15:15:05.919Z
Learning: In the Fiji holidays implementation, the maintainers are aware of the need to extend the MAWLID_DATES dictionary beyond 2025 when future official references become available, and will do so when appropriate. No suggestions about extending this dictionary should be made in future reviews.
Learnt from: PPsyrius
PR: vacanza/holidays#2354
File: holidays/countries/fiji.py:146-159
Timestamp: 2025-03-19T16:54:58.657Z
Learning: In the holidays library implementation, explicit holiday dates (like Diwali in Fiji) are only defined for historical years with official sources (2016-2025). Future dates beyond the explicitly defined range are automatically calculated by methods like `_add_diwali`, which provide approximations when official dates aren't yet available.
Learnt from: KJhellico
PR: vacanza/holidays#2398
File: holidays/countries/guinea.py:106-110
Timestamp: 2025-04-04T10:52:41.546Z
Learning: In the Guinea holidays implementation, observed Eid al-Fitr cases are properly covered by the test_eid_al_fitr_day() method, which tests both the regular holiday dates and the observed dates when the holiday falls on a non-working day (for years >= 2023).
📚 Learning: 2025-04-05T04:47:27.213Z
Learnt from: PPsyrius
PR: vacanza/holidays#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_tanzania.py
📚 Learning: 2025-05-06T21:07:11.577Z
Learnt from: KJhellico
PR: vacanza/holidays#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_tanzania.py
📚 Learning: 2025-04-05T06:49:06.217Z
Learnt from: PPsyrius
PR: vacanza/holidays#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_tanzania.py
📚 Learning: 2025-04-05T04:50:40.752Z
Learnt from: PPsyrius
PR: vacanza/holidays#2416
File: tests/countries/test_turkmenistan.py:31-49
Timestamp: 2025-04-05T04:50:40.752Z
Learning: For Turkmenistan holiday tests, use this class structure: `class TestTurkmenistan(CommonCountryTests, TestCase)` with imports `from unittest import TestCase`, `from holidays.countries import Turkmenistan, TM, TKM`, and `from tests.common import CommonCountryTests`. Ensure to call `super().setUp()` in the setUp method.
Applied to files:
tests/countries/test_tanzania.py
📚 Learning: 2025-05-09T18:36:09.607Z
Learnt from: PPsyrius
PR: vacanza/holidays#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_tanzania.py
holidays/countries/tanzania.py
📚 Learning: 2025-07-02T18:17:53.342Z
Learnt from: KJhellico
PR: vacanza/holidays#2608
File: tests/countries/test_saint_vincent_and_the_grenadines.py:162-178
Timestamp: 2025-07-02T18:17:53.342Z
Learning: In the Saint Vincent and the Grenadines holidays implementation, New Year's Day is added without observed rules using `_add_new_years_day()` and should not include observed rule testing in its test method. Only holidays explicitly wrapped with `_add_observed()` have observed behavior.
Applied to files:
tests/countries/test_tanzania.py
holidays/countries/tanzania.py
📚 Learning: 2025-04-04T10:52:41.546Z
Learnt from: KJhellico
PR: vacanza/holidays#2398
File: holidays/countries/guinea.py:106-110
Timestamp: 2025-04-04T10:52:41.546Z
Learning: In the Guinea holidays implementation, observed Eid al-Fitr cases are properly covered by the test_eid_al_fitr_day() method, which tests both the regular holiday dates and the observed dates when the holiday falls on a non-working day (for years >= 2023).
Applied to files:
tests/countries/test_tanzania.py
📚 Learning: 2025-07-24T15:21:31.632Z
Learnt from: PPsyrius
PR: vacanza/holidays#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_tanzania.py
📚 Learning: 2025-08-15T19:16:14.070Z
Learnt from: PPsyrius
PR: vacanza/holidays#2821
File: holidays/countries/tanzania.py:37-83
Timestamp: 2025-08-15T19:16:14.070Z
Learning: In Tanzania holiday documentation, the Bank of Tanzania (BOT) may publish yearly public holidays PDFs using URLs with previous year filenames. For example, the 2024 public holidays document is accessible via a URL containing "2023 public holidays.pdf" but contains actual 2024 holiday information. Always check content rather than assuming filename indicates the year covered.
Applied to files:
tests/countries/test_tanzania.py
holidays/countries/tanzania.py
📚 Learning: 2025-07-09T21:16:35.145Z
Learnt from: KJhellico
PR: vacanza/holidays#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_tanzania.py
📚 Learning: 2025-07-02T18:21:59.302Z
Learnt from: KJhellico
PR: vacanza/holidays#2608
File: tests/countries/test_saint_vincent_and_the_grenadines.py:162-178
Timestamp: 2025-07-02T18:21:59.302Z
Learning: In the Saint Vincent and the Grenadines holiday tests, for holidays without observed rules that only require a single assertHolidayName call, pass the holiday name directly as a string literal rather than storing it in a variable first for cleaner, more concise code.
Applied to files:
tests/countries/test_tanzania.py
📚 Learning: 2025-04-23T14:55:35.504Z
Learnt from: PPsyrius
PR: vacanza/holidays#2489
File: holidays/countries/sao_tome_and_principe.py:22-26
Timestamp: 2025-04-23T14:55:35.504Z
Learning: References in holidays classes should only be included if they're used for test case cross-checks or provide historical context about when holidays were added/removed, not just for the sake of having more references.
Applied to files:
tests/countries/test_tanzania.py
📚 Learning: 2025-06-18T17:01:58.067Z
Learnt from: PPsyrius
PR: vacanza/holidays#2642
File: tests/countries/test_wallis_and_futuna.py:19-23
Timestamp: 2025-06-18T17:01:58.067Z
Learning: In the vacanza/holidays repository, the standard pattern for test class setUpClass methods is `super().setUpClass(HolidayClass)` or `super().setUpClass(HolidayClass, years=...)` where HolidayClass is passed as the first argument. This is the correct signature that matches the CommonCountryTests.setUpClass method which accepts test_class as the first parameter after cls. Pylint warnings about parameter count mismatch are false positives when comparing against TestCase.setUpClass instead of the immediate parent CommonCountryTests.setUpClass.
Applied to files:
tests/countries/test_tanzania.py
📚 Learning: 2025-04-05T04:29:38.042Z
Learnt from: PPsyrius
PR: vacanza/holidays#2416
File: tests/countries/test_turkmenistan.py:85-86
Timestamp: 2025-04-05T04:29:38.042Z
Learning: For testing holiday implementations in the vacanza/holidays repository, recommend using `from tests.common import CommonCountryTests` as the base class instead of directly using `unittest.TestCase` to maintain consistency with project conventions and leverage common test utilities.
Applied to files:
tests/countries/test_tanzania.py
📚 Learning: 2025-04-05T04:33:53.254Z
Learnt from: PPsyrius
PR: vacanza/holidays#2416
File: tests/countries/test_turkmenistan.py:52-64
Timestamp: 2025-04-05T04:33:53.254Z
Learning: For Turkmenistan holiday tests, recommend using CommonCountryTests as the base class rather than unittest.TestCase to follow project conventions, be consistent with other country test files, and gain access to common test utilities.
Applied to files:
tests/countries/test_tanzania.py
📚 Learning: 2025-06-18T17:01:58.067Z
Learnt from: PPsyrius
PR: vacanza/holidays#2642
File: tests/countries/test_wallis_and_futuna.py:19-23
Timestamp: 2025-06-18T17:01:58.067Z
Learning: In the vacanza/holidays repository, the standard pattern for test class setUpClass methods is `super().setUpClass(HolidayClass)` 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_tanzania.py
📚 Learning: 2025-06-22T21:36:18.015Z
Learnt from: KJhellico
PR: vacanza/holidays#2671
File: tests/countries/test_libya.py:19-24
Timestamp: 2025-06-22T21:36:18.015Z
Learning: In the vacanza/holidays project, test classes for countries do not use docstrings. All test classes follow the same pattern: class declaration directly followed by classmethod def setUpClass(cls) without any docstrings for the class or methods.
Applied to files:
tests/countries/test_tanzania.py
📚 Learning: 2025-08-15T19:16:14.070Z
Learnt from: PPsyrius
PR: vacanza/holidays#2821
File: holidays/countries/tanzania.py:37-83
Timestamp: 2025-08-15T19:16:14.070Z
Learning: PDF filenames in government holiday documentation may not always reflect the actual year covered in the content. The Tanzania Bank of Tanzania (BOT) 2024 public holidays document is hosted at a URL containing "2023" in the filename but contains 2024 holiday information.
Applied to files:
tests/countries/test_tanzania.py
holidays/countries/tanzania.py
📚 Learning: 2025-06-26T15:34:35.476Z
Learnt from: KJhellico
PR: vacanza/holidays#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/TZ.po
📚 Learning: 2025-03-30T18:25:07.087Z
Learnt from: KJhellico
PR: vacanza/holidays#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/TZ.po
holidays/locale/sw/LC_MESSAGES/TZ.po
📚 Learning: 2025-03-08T11:28:48.652Z
Learnt from: KJhellico
PR: vacanza/holidays#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/TZ.po
holidays/locale/sw/LC_MESSAGES/TZ.po
📚 Learning: 2025-05-06T15:25:44.333Z
Learnt from: KJhellico
PR: vacanza/holidays#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/TZ.po
holidays/locale/sw/LC_MESSAGES/TZ.po
📚 Learning: 2025-06-28T10:39:19.185Z
Learnt from: KJhellico
PR: vacanza/holidays#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/TZ.po
holidays/locale/sw/LC_MESSAGES/TZ.po
📚 Learning: 2025-06-25T10:09:29.029Z
Learnt from: PPsyrius
PR: vacanza/holidays#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/TZ.po
holidays/locale/sw/LC_MESSAGES/TZ.po
📚 Learning: 2025-08-11T10:14:28.517Z
Learnt from: PPsyrius
PR: vacanza/holidays#2794
File: holidays/groups/christian.py:328-343
Timestamp: 2025-08-11T10:14:28.517Z
Learning: For Ethiopian holidays in the `holidays/groups/christian.py` file, docstring wording should maintain source-accurate phrasing (e.g., "in coincidence of" for Ethiopian New Year/Enkutatash), even when it might read awkwardly in English, to ensure consistency with official Ethiopian documentation.
Applied to files:
holidays/locale/en_US/LC_MESSAGES/TZ.po
holidays/countries/tanzania.py
📚 Learning: 2025-03-05T17:51:00.633Z
Learnt from: KJhellico
PR: vacanza/holidays#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/TZ.po
📚 Learning: 2025-05-10T04:02:13.815Z
Learnt from: PPsyrius
PR: vacanza/holidays#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/TZ.po
📚 Learning: 2025-07-09T20:27:37.760Z
Learnt from: KJhellico
PR: vacanza/holidays#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/tanzania.py
📚 Learning: 2025-03-19T16:53:00.375Z
Learnt from: PPsyrius
PR: vacanza/holidays#2354
File: holidays/countries/fiji.py:185-188
Timestamp: 2025-03-19T16:53:00.375Z
Learning: In the Fiji holidays implementation, the `special_public_holidays_observed` dictionary in `FijiStaticHolidays` is only used for exceptions to the normal observance rules, not for documenting all holidays. Only 2019's Constitution Day needed a special entry as it didn't follow the standard patterns.
Applied to files:
holidays/countries/tanzania.py
📚 Learning: 2025-08-08T14:35:35.829Z
Learnt from: KJhellico
PR: vacanza/holidays#2774
File: tests/countries/test_liberia.py:33-46
Timestamp: 2025-08-08T14:35:35.829Z
Learning: In tests/countries/test_liberia.py, prefer neutral comments that reference the election-year rule for Inauguration Day (first Monday of January after an election year). Avoid naming specific winners; e.g., note “1976 follows the 1975 election,” not candidate details.
Applied to files:
holidays/countries/tanzania.py
📚 Learning: 2025-05-10T04:32:15.760Z
Learnt from: PPsyrius
PR: vacanza/holidays#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/tanzania.py
📚 Learning: 2025-04-03T12:36:41.201Z
Learnt from: PPsyrius
PR: vacanza/holidays#2398
File: holidays/countries/guinea.py:73-77
Timestamp: 2025-04-03T12:36:41.201Z
Learning: In the Holidays library, comments explaining year restrictions for holidays should be placed above the year check conditional statement, not inside it. Example format:
```python
# reason why goes here
if start_year <= self._year <= end_year:
# Holiday name
self._add_holiday_function(tr("Holiday Name"))
```
Applied to files:
holidays/countries/tanzania.py
📚 Learning: 2025-03-19T16:54:58.657Z
Learnt from: PPsyrius
PR: vacanza/holidays#2354
File: holidays/countries/fiji.py:146-159
Timestamp: 2025-03-19T16:54:58.657Z
Learning: In the holidays library implementation, explicit holiday dates (like Diwali in Fiji) are only defined for historical years with official sources (2016-2025). Future dates beyond the explicitly defined range are automatically calculated by methods like `_add_diwali`, which provide approximations when official dates aren't yet available.
Applied to files:
holidays/countries/tanzania.py
📚 Learning: 2025-03-29T15:15:05.919Z
Learnt from: KJhellico
PR: vacanza/holidays#2354
File: holidays/countries/fiji.py:171-183
Timestamp: 2025-03-29T15:15:05.919Z
Learning: In the Fiji holidays implementation, the maintainers are aware of the need to extend the MAWLID_DATES dictionary beyond 2025 when future official references become available, and will do so when appropriate. No suggestions about extending this dictionary should be made in future reviews.
Applied to files:
holidays/countries/tanzania.py
📚 Learning: 2025-08-03T13:48:11.910Z
Learnt from: KJhellico
PR: vacanza/holidays#2777
File: holidays/countries/gambia.py:120-122
Timestamp: 2025-08-03T13:48:11.910Z
Learning: When reviewing holiday implementations in the holidays library, defer to the maintainers' choice of start years for specific holiday policies, as they likely have access to more reliable primary sources and official documentation than what can be found through web searches.
Applied to files:
holidays/countries/tanzania.py
📚 Learning: 2025-06-19T02:34:18.382Z
Learnt from: PPsyrius
PR: vacanza/holidays#2643
File: holidays/countries/mauritius.py:144-169
Timestamp: 2025-06-19T02:34:18.382Z
Learning: Custom holiday classes that extend _CustomHinduHolidays, _CustomIslamicHolidays, _CustomBuddhistHolidays, etc. in the holidays library do not use docstrings. They follow a pattern of using only inline comments above date dictionaries, as seen in Malaysia, Singapore, UAE, and other country implementations.
Applied to files:
holidays/countries/tanzania.py
📚 Learning: 2025-06-19T02:34:14.456Z
Learnt from: PPsyrius
PR: vacanza/holidays#2643
File: holidays/countries/mauritius.py:171-184
Timestamp: 2025-06-19T02:34:14.456Z
Learning: In the holidays library, `_CustomIslamicHolidays` subclasses follow a consistent pattern of NOT having docstrings. They go directly to defining date dictionaries, as evidenced by Malaysia, Singapore, UAE, and dozens of other country implementations.
Applied to files:
holidays/countries/tanzania.py
📚 Learning: 2025-06-13T12:18:03.539Z
Learnt from: PPsyrius
PR: vacanza/holidays#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/tanzania.py
📚 Learning: 2025-04-13T19:10:31.502Z
Learnt from: KJhellico
PR: vacanza/holidays#2465
File: holidays/countries/suriname.py:219-251
Timestamp: 2025-04-13T19:10:31.502Z
Learning: The `_CustomIslamicHolidays` classes in this project contain only exact verified holiday dates from reliable sources, rather than calculated or estimated future dates. This is by design to ensure accuracy, particularly for religious holidays that may follow lunar calendars or depend on local observations.
Applied to files:
holidays/countries/tanzania.py
🧬 Code Graph Analysis (1)
tests/countries/test_tanzania.py (3)
tests/countries/test_canada.py (1)
setUpClass
(22-44)holidays/countries/tanzania.py (3)
Tanzania
(32-272)TZ
(275-276)TZA
(279-280)tests/common.py (7)
assertAliases
(121-130)assertNoHolidays
(292-294)assertHoliday
(150-152)assertHolidayName
(195-199)assertNoHolidayName
(273-275)assertNoNonObservedHoliday
(248-250)assertHolidays
(228-230)
⏰ Context from checks skipped due to timeout of 300000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: Test docs build
- GitHub Check: Build distribution
🔇 Additional comments (37)
holidays/locale/en_US/LC_MESSAGES/TZ.po (7)
17-27
: Headers/metadata updates are appropriate and consistent with project conventions.Project-Id-Version, PO-Revision-Date, Last-Translator, and X-Generator changes look legitimate for l10n maintenance. No need to regenerate via make l10n solely for these.
35-44
: Observed and observed+estimated labels added correctly.The additions of "Badala ya %s" and "Badala ya %s (makisio)" with accurate en_US translations align with ObservedHolidayBase usage and will enable proper label rendering for observed Islamic dates.
78-85
: Good Friday/Easter Monday entries align with code and tests.Swahili msgids with correct en_US translations match the new public holiday handling and the tests.
86-93
: Union naming split (pre/post-1991) looks correct."Muungano wa Tanzania" vs "Sikukuu ya Muungano" separation matches tanzania.py logic and test coverage.
122-125
: Eid al-Adha spacing normalization is consistent."msgid 'Eid El Hajj' → 'Eid al-Adha'" mapping mirrors code and tests and avoids mixed spellings.
142-149
: New EAC inauguration and Magufuli inauguration keys are properly localized.The additions match TanzaniaStaticHolidays and test_special_holidays coverage.
35-44
: No stale msgids found—ready to mergeI searched the entire repo for the prior incorrect msgids (“Mazishi cha John” and “Muungano wa Tanganyika na Zanzibar”), including the updates at lines 35–44 and 138–141, and found no lingering occurrences. All outdated entries have been removed.
holidays/locale/sw/LC_MESSAGES/TZ.po (3)
17-27
: Headers/metadata updates look good for the default language file.Conforms to project’s localization conventions for sw.
35-44
: Observed label keys added to the source locale (sw).Keeping msgstr empty for the default language is correct per project rules.
45-52
: Core holiday keys present and consistent with code."Eid El-Fitri" and "Kuzaliwa Kristo" entries align with Tanzania’s default language and naming in source.
tests/countries/test_tanzania.py (9)
23-26
: Solid test harness: wide year range, bank-holiday instance, and estimated toggle.Using years=range(1965, 2050) with bank_holidays and no_estimated_holidays instances matches project testing patterns and the class API.
31-34
: No holidays before start_year is correctly asserted.Validates the new start_year=1965 contract across supported categories.
36-45
: Special holidays coverage expanded and precise.Includes 1967-12-01 (EAC inauguration) and 2021 funeral dates; matches TanzaniaStaticHolidays.
47-60
: New Year’s Day observance rules verified, including 2022 exception.Observance gaps (1967–1986), standard observed years, and the 2022 special observed case are covered.
166-201
: Saba Saba / Peasants’ Day / International Trade Fair transitions are well-tested.Year-based renames and observed dates for both July 7 and August 8 are validated.
286-307
: Eid al-Adha coverage mirrors policy nuances correctly.Observed dates (2014, 2017, 2022) and the 1965–1966 second-day inclusion are asserted.
327-358
: 2022 snapshot is comprehensive and aligned with ordinance-driven exceptions.Includes observed days for New Year’s, Workers’ Day, and Eid al-Adha with correct labels.
360-385
: Default-language (sw) localization expectations look right.Multi-holiday same-day label merging (Good Friday + Karume) and Islamic labels match source keys.
387-407
: en_US localization checks align with translations and renames.Verifies renamed Union, Saba/Sabasaba/Peasants’ Day, and Islamic entries across 2023.
holidays/countries/tanzania.py (18)
25-29
: ObservedHolidayBase integration and observed-rule constants imported correctly.This enables the tailored SAT_SUN_TO_NEXT_MON_TUE handling needed for Christmas and 1st day of Eid al-Fitr.
33-34
: Class inheritance and mixins composition is appropriate.ObservedHolidayBase + Christian/International/Islamic/Static mixins match the design of other countries and new observed logic.
88-97
: Start year lowered and observed labels defined (sw) — consistent across code and l10n.estimated_label / observed_label / observed_estimated_label keys match the newly added PO entries, and start_year=1965 satisfies PR scope.
98-112
: Constructor forwards islamic_show_estimated and initializes static holidays properly.Signature follows the repository’s standard and powers the test helper instance no_estimated_holidays.
113-124
: Observed-rule window and docstring are clear and source-cited.The 1995–2021 enforcement with 1994/2022 handled via special_public_holidays_observed is correct.
127-146
: Observed-rule application logic is correct and robust.
- Uses SAT_SUN_TO_NEXT_MON_TUE for Christmas and the first Eid al-Fitr day; SAT_SUN_TO_NEXT_MON for others.
- Iterating names per date ensures multi-label days are handled without duplication.
156-166
: New Year’s Day conditional matches legal history.Removed 1967–1986; present in 1965–1966 and 1987+. Test coverage reflects this split.
167-177
: Party Founding Day logic (ASP→CCM, 1973–1993) is correctly implemented.Renaming in 1977 and removal in 1993 aligns with the cited acts and the tests.
179-189
: Karume Day addition (2006+) with observed handling looks right.Names and year bounds match tests and l10n entries.
197-205
: Union naming change in 1991 is implemented per policy."Muungano wa Tanzania" used from 1991 onward; "Sikukuu ya Muungano" prior — consistent with tests and PO updates.
207-209
: International Workers’ Day inclusion and observance handling are correct.Observed exceptions for 2010, 2011, 2016, 2021, 2022 are covered via rules and special cases.
210-227
: Saba Saba / Peasants’ Day / International Trade Fair renames are accurately encoded.Year-based naming and the separation of Aug 8 Peasants’ Day post-1995 align with references and tests.
228-236
: Mwalimu Nyerere Day addition and observance are consistent with 2002 legislation.Label matches l10n, and observed dates are handled.
244-249
: Boxing Day year-bounds match legal changes.Only 1965 and 1993+ — consistent with tests.
256-270
: Islamic holidays are added with clear naming and observance sets; no overreach on future dates.Uses explicit date dictionaries and observed integration without speculating beyond available sources; matches project policy.
271-273
: Observed population delegated appropriately.Centralizing observed additions via _populate_observed keeps rules coherent and testable.
283-391
: Islamic date dictionaries expanded prudently (1965–2025).
- Confirmed-years windows set to (2013, 2025) are in line with tests showing no “estimated” labels for 2024–2025.
- Inclusion of 2024/2025 entries for Adha/Mawlidi and 2025 for Fitr matches test expectations.
394-435
: Static holidays and observed exceptions are precise and well-sourced.
- Adds EAC inauguration (1967-12-01).
- Corrects Magufuli’s funeral Swahili.
- Encodes 1994 and 2022 observed exceptions explicitly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (3)
holidays/countries/tanzania.py
(8 hunks)snapshots/countries/TZ_COMMON.json
(24 hunks)tests/countries/test_tanzania.py
(4 hunks)
🧰 Additional context used
🧠 Learnings (48)
📓 Common learnings
Learnt from: PPsyrius
PR: vacanza/holidays#2821
File: holidays/countries/tanzania.py:37-83
Timestamp: 2025-08-15T19:16:14.119Z
Learning: In Tanzania holiday documentation, the Bank of Tanzania (BOT) may publish yearly public holidays PDFs using URLs with previous year filenames. For example, the 2024 public holidays document is accessible via a URL containing "2023 public holidays.pdf" but contains actual 2024 holiday information. Always check content rather than assuming filename indicates the year covered.
Learnt from: PPsyrius
PR: vacanza/holidays#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: PPsyrius
PR: vacanza/holidays#2821
File: holidays/countries/tanzania.py:37-83
Timestamp: 2025-08-15T19:16:14.119Z
Learning: PDF filenames in government holiday documentation may not always reflect the actual year covered in the content. The Tanzania Bank of Tanzania (BOT) 2024 public holidays document is hosted at a URL containing "2023" in the filename but contains 2024 holiday information.
Learnt from: KJhellico
PR: vacanza/holidays#2354
File: holidays/countries/fiji.py:171-183
Timestamp: 2025-03-29T15:15:05.919Z
Learning: In the Fiji holidays implementation, the maintainers are aware of the need to extend the MAWLID_DATES dictionary beyond 2025 when future official references become available, and will do so when appropriate. No suggestions about extending this dictionary should be made in future reviews.
Learnt from: PPsyrius
PR: vacanza/holidays#2354
File: holidays/countries/fiji.py:146-159
Timestamp: 2025-03-19T16:54:58.657Z
Learning: In the holidays library implementation, explicit holiday dates (like Diwali in Fiji) are only defined for historical years with official sources (2016-2025). Future dates beyond the explicitly defined range are automatically calculated by methods like `_add_diwali`, which provide approximations when official dates aren't yet available.
Learnt from: KJhellico
PR: vacanza/holidays#2398
File: holidays/countries/guinea.py:106-110
Timestamp: 2025-04-04T10:52:41.546Z
Learning: In the Guinea holidays implementation, observed Eid al-Fitr cases are properly covered by the test_eid_al_fitr_day() method, which tests both the regular holiday dates and the observed dates when the holiday falls on a non-working day (for years >= 2023).
📚 Learning: 2025-04-03T05:59:57.480Z
Learnt from: PPsyrius
PR: vacanza/holidays#2407
File: snapshots/countries/TL_COMMON.json:7-7
Timestamp: 2025-04-03T05:59:57.480Z
Learning: In the holidays project, snapshot files (like snapshots/countries/TL_COMMON.json) are auto-generated when running `make snapshot` and should not be manually edited. Semicolons (;) in holiday entries are used as separators when multiple holidays occur on the same date.
Applied to files:
snapshots/countries/TZ_COMMON.json
📚 Learning: 2025-08-15T19:16:14.119Z
Learnt from: PPsyrius
PR: vacanza/holidays#2821
File: holidays/countries/tanzania.py:37-83
Timestamp: 2025-08-15T19:16:14.119Z
Learning: In Tanzania holiday documentation, the Bank of Tanzania (BOT) may publish yearly public holidays PDFs using URLs with previous year filenames. For example, the 2024 public holidays document is accessible via a URL containing "2023 public holidays.pdf" but contains actual 2024 holiday information. Always check content rather than assuming filename indicates the year covered.
Applied to files:
snapshots/countries/TZ_COMMON.json
holidays/countries/tanzania.py
tests/countries/test_tanzania.py
📚 Learning: 2025-08-15T19:16:14.119Z
Learnt from: PPsyrius
PR: vacanza/holidays#2821
File: holidays/countries/tanzania.py:37-83
Timestamp: 2025-08-15T19:16:14.119Z
Learning: PDF filenames in government holiday documentation may not always reflect the actual year covered in the content. The Tanzania Bank of Tanzania (BOT) 2024 public holidays document is hosted at a URL containing "2023" in the filename but contains 2024 holiday information.
Applied to files:
snapshots/countries/TZ_COMMON.json
holidays/countries/tanzania.py
tests/countries/test_tanzania.py
📚 Learning: 2025-08-11T10:14:28.517Z
Learnt from: PPsyrius
PR: vacanza/holidays#2794
File: holidays/groups/christian.py:328-343
Timestamp: 2025-08-11T10:14:28.517Z
Learning: For Ethiopian holidays in the `holidays/groups/christian.py` file, docstring wording should maintain source-accurate phrasing (e.g., "in coincidence of" for Ethiopian New Year/Enkutatash), even when it might read awkwardly in English, to ensure consistency with official Ethiopian documentation.
Applied to files:
holidays/countries/tanzania.py
📚 Learning: 2025-07-09T20:27:37.760Z
Learnt from: KJhellico
PR: vacanza/holidays#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/tanzania.py
📚 Learning: 2025-07-02T18:17:53.342Z
Learnt from: KJhellico
PR: vacanza/holidays#2608
File: tests/countries/test_saint_vincent_and_the_grenadines.py:162-178
Timestamp: 2025-07-02T18:17:53.342Z
Learning: In the Saint Vincent and the Grenadines holidays implementation, New Year's Day is added without observed rules using `_add_new_years_day()` and should not include observed rule testing in its test method. Only holidays explicitly wrapped with `_add_observed()` have observed behavior.
Applied to files:
holidays/countries/tanzania.py
tests/countries/test_tanzania.py
📚 Learning: 2025-08-25T09:57:22.263Z
Learnt from: PPsyrius
PR: vacanza/holidays#2833
File: holidays/countries/uganda.py:50-56
Timestamp: 2025-08-25T09:57:22.263Z
Learning: In the holidays package, when adding comments for year-restricted holidays in Uganda and similar country modules, include specific legal or historical context such as the actual laws, parliamentary acts, or government decisions that established the holidays, rather than just generic "since YEAR" information. For example, reference the specific Parliament act, decree, or historical event that created the holiday.
Applied to files:
holidays/countries/tanzania.py
📚 Learning: 2025-08-19T21:22:13.125Z
Learnt from: KJhellico
PR: vacanza/holidays#2831
File: holidays/countries/south_sudan.py:84-88
Timestamp: 2025-08-19T21:22:13.125Z
Learning: In the holidays library, message comments directly above holiday addition methods must match the holiday name exactly without any additions, modifications, or explanatory text. For example, if the holiday name is "Eid al-Fitr Holiday", the comment should be "# Eid al-Fitr Holiday." with no extra context.
Applied to files:
holidays/countries/tanzania.py
📚 Learning: 2025-08-08T14:35:35.829Z
Learnt from: KJhellico
PR: vacanza/holidays#2774
File: tests/countries/test_liberia.py:33-46
Timestamp: 2025-08-08T14:35:35.829Z
Learning: In tests/countries/test_liberia.py, prefer neutral comments that reference the election-year rule for Inauguration Day (first Monday of January after an election year). Avoid naming specific winners; e.g., note “1976 follows the 1975 election,” not candidate details.
Applied to files:
holidays/countries/tanzania.py
📚 Learning: 2025-05-10T04:32:15.760Z
Learnt from: PPsyrius
PR: vacanza/holidays#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/tanzania.py
📚 Learning: 2025-08-25T09:57:22.263Z
Learnt from: PPsyrius
PR: vacanza/holidays#2833
File: holidays/countries/uganda.py:50-56
Timestamp: 2025-08-25T09:57:22.263Z
Learning: In the holidays package, when adding contextual comments about holiday establishment dates, avoid making claims about specific laws, parliamentary acts, or government decisions unless they can be verified from authoritative sources like official government legal databases, gazettes, or parliamentary records. Unverified legal claims should not be added to comments even if they seem plausible.
Applied to files:
holidays/countries/tanzania.py
📚 Learning: 2025-03-19T16:54:58.657Z
Learnt from: PPsyrius
PR: vacanza/holidays#2354
File: holidays/countries/fiji.py:146-159
Timestamp: 2025-03-19T16:54:58.657Z
Learning: In the holidays library implementation, explicit holiday dates (like Diwali in Fiji) are only defined for historical years with official sources (2016-2025). Future dates beyond the explicitly defined range are automatically calculated by methods like `_add_diwali`, which provide approximations when official dates aren't yet available.
Applied to files:
holidays/countries/tanzania.py
📚 Learning: 2025-03-29T15:15:05.919Z
Learnt from: KJhellico
PR: vacanza/holidays#2354
File: holidays/countries/fiji.py:171-183
Timestamp: 2025-03-29T15:15:05.919Z
Learning: In the Fiji holidays implementation, the maintainers are aware of the need to extend the MAWLID_DATES dictionary beyond 2025 when future official references become available, and will do so when appropriate. No suggestions about extending this dictionary should be made in future reviews.
Applied to files:
holidays/countries/tanzania.py
📚 Learning: 2025-08-03T13:48:11.910Z
Learnt from: KJhellico
PR: vacanza/holidays#2777
File: holidays/countries/gambia.py:120-122
Timestamp: 2025-08-03T13:48:11.910Z
Learning: When reviewing holiday implementations in the holidays library, defer to the maintainers' choice of start years for specific holiday policies, as they likely have access to more reliable primary sources and official documentation than what can be found through web searches.
Applied to files:
holidays/countries/tanzania.py
📚 Learning: 2025-03-19T16:53:00.375Z
Learnt from: PPsyrius
PR: vacanza/holidays#2354
File: holidays/countries/fiji.py:185-188
Timestamp: 2025-03-19T16:53:00.375Z
Learning: In the Fiji holidays implementation, the `special_public_holidays_observed` dictionary in `FijiStaticHolidays` is only used for exceptions to the normal observance rules, not for documenting all holidays. Only 2019's Constitution Day needed a special entry as it didn't follow the standard patterns.
Applied to files:
holidays/countries/tanzania.py
📚 Learning: 2025-05-09T18:36:09.607Z
Learnt from: PPsyrius
PR: vacanza/holidays#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:
holidays/countries/tanzania.py
tests/countries/test_tanzania.py
📚 Learning: 2025-06-19T02:34:18.382Z
Learnt from: PPsyrius
PR: vacanza/holidays#2643
File: holidays/countries/mauritius.py:144-169
Timestamp: 2025-06-19T02:34:18.382Z
Learning: Custom holiday classes that extend _CustomHinduHolidays, _CustomIslamicHolidays, _CustomBuddhistHolidays, etc. in the holidays library do not use docstrings. They follow a pattern of using only inline comments above date dictionaries, as seen in Malaysia, Singapore, UAE, and other country implementations.
Applied to files:
holidays/countries/tanzania.py
📚 Learning: 2025-04-03T12:36:41.201Z
Learnt from: PPsyrius
PR: vacanza/holidays#2398
File: holidays/countries/guinea.py:73-77
Timestamp: 2025-04-03T12:36:41.201Z
Learning: In the Holidays library, comments explaining year restrictions for holidays should be placed above the year check conditional statement, not inside it. Example format:
```python
# reason why goes here
if start_year <= self._year <= end_year:
# Holiday name
self._add_holiday_function(tr("Holiday Name"))
```
Applied to files:
holidays/countries/tanzania.py
📚 Learning: 2025-03-23T10:11:50.465Z
Learnt from: KJhellico
PR: vacanza/holidays#2354
File: holidays/countries/fiji.py:63-70
Timestamp: 2025-03-23T10:11:50.465Z
Learning: In the holidays library, the `SAT_SUN_TO_NEXT_MON_TUE` rule is specifically used for consecutive holidays (like Christmas Day and Boxing Day) to ensure they're observed on separate weekdays (Monday and Tuesday) when they fall on weekends, while `SAT_SUN_TO_NEXT_MON` is used as the default rule for other holidays.
Applied to files:
holidays/countries/tanzania.py
📚 Learning: 2025-08-15T20:49:30.223Z
Learnt from: KJhellico
PR: vacanza/holidays#2822
File: holidays/countries/azerbaijan.py:170-170
Timestamp: 2025-08-15T20:49:30.223Z
Learning: In Azerbaijan's Labor Code, there is a legal distinction between holidays (Article 105) and days of remembrance (Article 106). Martyrs' Day (January 20) is a day of remembrance under Article 106, not a holiday, which affects how Bayram rollover rules apply when they coincide - §105(6) rollover rules don't apply to days of remembrance.
Applied to files:
holidays/countries/tanzania.py
📚 Learning: 2025-06-15T20:39:51.085Z
Learnt from: KJhellico
PR: vacanza/holidays#2632
File: holidays/countries/solomon_islands.py:90-97
Timestamp: 2025-06-15T20:39:51.085Z
Learning: Solomon Islands Saturday → Friday holiday shift rule was systematically implemented only from around 2021-2022 onward, not consistently applied since 1979. The Public Holidays Act only explicitly mentions Sunday → Monday shifts, with Saturday shifts handled through discretionary ministerial gazette notices.
Applied to files:
holidays/countries/tanzania.py
📚 Learning: 2025-07-14T20:23:48.198Z
Learnt from: KJhellico
PR: vacanza/holidays#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/tanzania.py
📚 Learning: 2025-07-09T21:16:35.145Z
Learnt from: KJhellico
PR: vacanza/holidays#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:
holidays/countries/tanzania.py
tests/countries/test_tanzania.py
📚 Learning: 2025-05-13T13:23:11.375Z
Learnt from: KJhellico
PR: vacanza/holidays#2483
File: holidays/countries/turks_and_caicos_islands.py:117-118
Timestamp: 2025-05-13T13:23:11.375Z
Learning: The holidays library uses `_add_christmas_day_two` method to add Boxing Day holiday, not `_add_boxing_day`.
Applied to files:
holidays/countries/tanzania.py
📚 Learning: 2025-07-08T10:20:04.069Z
Learnt from: KJhellico
PR: vacanza/holidays#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/tanzania.py
📚 Learning: 2025-06-14T11:04:24.104Z
Learnt from: KJhellico
PR: vacanza/holidays#2629
File: holidays/countries/namibia.py:70-73
Timestamp: 2025-06-14T11:04:24.104Z
Learning: In Namibia's holiday system, Genocide Remembrance Day (May 28, starting 2025) is implemented as a fixed commemorative date without observed day handling (_add_observed), indicating it should be observed on May 28th regardless of the day of the week, similar to other commemorative holidays like Good Friday and Christmas Day.
Applied to files:
holidays/countries/tanzania.py
📚 Learning: 2025-06-14T11:04:24.104Z
Learnt from: KJhellico
PR: vacanza/holidays#2629
File: holidays/countries/namibia.py:70-73
Timestamp: 2025-06-14T11:04:24.104Z
Learning: In Namibia's holiday system, holidays declared by presidential proclamation under Section 1(3) of the Public Holidays Act may not automatically be subject to the Sunday-to-Monday observation rule in Section 1(2), which primarily applies to holidays listed in the Schedule. Genocide Remembrance Day (May 28) starting in 2025 is treated as a fixed commemorative date without observed day handling.
Applied to files:
holidays/countries/tanzania.py
📚 Learning: 2025-06-13T12:18:03.539Z
Learnt from: PPsyrius
PR: vacanza/holidays#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/tanzania.py
📚 Learning: 2025-07-10T15:55:34.523Z
Learnt from: KJhellico
PR: vacanza/holidays#2706
File: holidays/countries/cayman_islands.py:50-55
Timestamp: 2025-07-10T15:55:34.523Z
Learning: The `islamic_show_estimated` parameter in country class constructors is only needed for countries that implement Islamic holidays (inherit from IslamicHolidays or _CustomIslamicHolidays groups). Countries with only Christian and secular holidays do not need this parameter.
Applied to files:
holidays/countries/tanzania.py
📚 Learning: 2025-08-21T06:52:25.503Z
Learnt from: PPsyrius
PR: vacanza/holidays#2843
File: holidays/countries/burundi.py:140-155
Timestamp: 2025-08-21T06:52:25.503Z
Learning: In the holidays library Islamic calendar implementation, CONFIRMED_YEARS represents the full range of years that have been officially verified, while the individual EID_AL_FITR_DATES and EID_AL_ADHA_DATES dictionaries only contain entries for years where the official dates differ from the base Umm al-Qura algorithmic calculations. Years within CONFIRMED_YEARS but not in the explicit date dictionaries will use the base algorithm but be marked as "confirmed" rather than "estimated".
Applied to files:
holidays/countries/tanzania.py
📚 Learning: 2025-04-13T19:10:31.502Z
Learnt from: KJhellico
PR: vacanza/holidays#2465
File: holidays/countries/suriname.py:219-251
Timestamp: 2025-04-13T19:10:31.502Z
Learning: The `_CustomIslamicHolidays` classes in this project contain only exact verified holiday dates from reliable sources, rather than calculated or estimated future dates. This is by design to ensure accuracy, particularly for religious holidays that may follow lunar calendars or depend on local observations.
Applied to files:
holidays/countries/tanzania.py
📚 Learning: 2025-04-05T04:47:27.213Z
Learnt from: PPsyrius
PR: vacanza/holidays#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_tanzania.py
📚 Learning: 2025-05-06T21:07:11.577Z
Learnt from: KJhellico
PR: vacanza/holidays#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_tanzania.py
📚 Learning: 2025-04-05T06:49:06.217Z
Learnt from: PPsyrius
PR: vacanza/holidays#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_tanzania.py
📚 Learning: 2025-04-05T04:50:40.752Z
Learnt from: PPsyrius
PR: vacanza/holidays#2416
File: tests/countries/test_turkmenistan.py:31-49
Timestamp: 2025-04-05T04:50:40.752Z
Learning: For Turkmenistan holiday tests, use this class structure: `class TestTurkmenistan(CommonCountryTests, TestCase)` with imports `from unittest import TestCase`, `from holidays.countries import Turkmenistan, TM, TKM`, and `from tests.common import CommonCountryTests`. Ensure to call `super().setUp()` in the setUp method.
Applied to files:
tests/countries/test_tanzania.py
📚 Learning: 2025-04-04T10:52:41.546Z
Learnt from: KJhellico
PR: vacanza/holidays#2398
File: holidays/countries/guinea.py:106-110
Timestamp: 2025-04-04T10:52:41.546Z
Learning: In the Guinea holidays implementation, observed Eid al-Fitr cases are properly covered by the test_eid_al_fitr_day() method, which tests both the regular holiday dates and the observed dates when the holiday falls on a non-working day (for years >= 2023).
Applied to files:
tests/countries/test_tanzania.py
📚 Learning: 2025-04-05T04:29:38.042Z
Learnt from: PPsyrius
PR: vacanza/holidays#2416
File: tests/countries/test_turkmenistan.py:85-86
Timestamp: 2025-04-05T04:29:38.042Z
Learning: For testing holiday implementations in the vacanza/holidays repository, recommend using `from tests.common import CommonCountryTests` as the base class instead of directly using `unittest.TestCase` to maintain consistency with project conventions and leverage common test utilities.
Applied to files:
tests/countries/test_tanzania.py
📚 Learning: 2025-07-24T15:21:31.632Z
Learnt from: PPsyrius
PR: vacanza/holidays#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_tanzania.py
📚 Learning: 2025-08-25T04:28:02.030Z
Learnt from: PPsyrius
PR: vacanza/holidays#2848
File: tests/countries/test_somalia.py:44-127
Timestamp: 2025-08-25T04:28:02.030Z
Learning: In the holidays library, Islamic holiday tests use `self.no_estimated_holidays = Country(years=years, islamic_show_estimated=False)` as the library-wide standard approach to simplify test cases. This pattern is intentional and preferred over testing estimated labels.
Applied to files:
tests/countries/test_tanzania.py
📚 Learning: 2025-07-02T18:21:59.302Z
Learnt from: KJhellico
PR: vacanza/holidays#2608
File: tests/countries/test_saint_vincent_and_the_grenadines.py:162-178
Timestamp: 2025-07-02T18:21:59.302Z
Learning: In the Saint Vincent and the Grenadines holiday tests, for holidays without observed rules that only require a single assertHolidayName call, pass the holiday name directly as a string literal rather than storing it in a variable first for cleaner, more concise code.
Applied to files:
tests/countries/test_tanzania.py
📚 Learning: 2025-04-23T14:55:35.504Z
Learnt from: PPsyrius
PR: vacanza/holidays#2489
File: holidays/countries/sao_tome_and_principe.py:22-26
Timestamp: 2025-04-23T14:55:35.504Z
Learning: References in holidays classes should only be included if they're used for test case cross-checks or provide historical context about when holidays were added/removed, not just for the sake of having more references.
Applied to files:
tests/countries/test_tanzania.py
📚 Learning: 2025-04-04T10:52:41.546Z
Learnt from: KJhellico
PR: vacanza/holidays#2398
File: holidays/countries/guinea.py:106-110
Timestamp: 2025-04-04T10:52:41.546Z
Learning: In the Guinea holidays implementation, observed Eid al-Fitr cases are covered by the test_eid_al_fitr_day() method, which tests both regular holiday dates and the observed dates when the holiday falls on a non-working day (for years >= 2023).
Applied to files:
tests/countries/test_tanzania.py
📚 Learning: 2025-08-12T17:16:54.497Z
Learnt from: PPsyrius
PR: vacanza/holidays#2794
File: tests/calendars/test_julian.py:35-36
Timestamp: 2025-08-12T17:16:54.497Z
Learning: In the vacanza/holidays project calendar tests (Thai, Ethiopian, Julian, etc.), the established testing pattern for validation methods is to use simple for loops like `for year in known_data_dict:` followed by `self.assertEqual(expected, actual)` without using unittest's subTest feature. This pattern is consistently maintained across all calendar test files.
Applied to files:
tests/countries/test_tanzania.py
📚 Learning: 2025-06-18T17:01:58.067Z
Learnt from: PPsyrius
PR: vacanza/holidays#2642
File: tests/countries/test_wallis_and_futuna.py:19-23
Timestamp: 2025-06-18T17:01:58.067Z
Learning: In the vacanza/holidays repository, the standard pattern for test class setUpClass methods is `super().setUpClass(HolidayClass)` or `super().setUpClass(HolidayClass, years=...)` where HolidayClass is passed as the first argument. This is the correct signature that matches the CommonCountryTests.setUpClass method which accepts test_class as the first parameter after cls. Pylint warnings about parameter count mismatch are false positives when comparing against TestCase.setUpClass instead of the immediate parent CommonCountryTests.setUpClass.
Applied to files:
tests/countries/test_tanzania.py
📚 Learning: 2025-04-05T04:33:53.254Z
Learnt from: PPsyrius
PR: vacanza/holidays#2416
File: tests/countries/test_turkmenistan.py:52-64
Timestamp: 2025-04-05T04:33:53.254Z
Learning: For Turkmenistan holiday tests, recommend using CommonCountryTests as the base class rather than unittest.TestCase to follow project conventions, be consistent with other country test files, and gain access to common test utilities.
Applied to files:
tests/countries/test_tanzania.py
📚 Learning: 2025-06-18T17:01:58.067Z
Learnt from: PPsyrius
PR: vacanza/holidays#2642
File: tests/countries/test_wallis_and_futuna.py:19-23
Timestamp: 2025-06-18T17:01:58.067Z
Learning: In the vacanza/holidays repository, the standard pattern for test class setUpClass methods is `super().setUpClass(HolidayClass)` 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_tanzania.py
📚 Learning: 2025-06-22T21:36:18.015Z
Learnt from: KJhellico
PR: vacanza/holidays#2671
File: tests/countries/test_libya.py:19-24
Timestamp: 2025-06-22T21:36:18.015Z
Learning: In the vacanza/holidays project, test classes for countries do not use docstrings. All test classes follow the same pattern: class declaration directly followed by classmethod def setUpClass(cls) without any docstrings for the class or methods.
Applied to files:
tests/countries/test_tanzania.py
🧬 Code graph analysis (2)
holidays/countries/tanzania.py (6)
holidays/calendars/gregorian.py (1)
_timedelta
(37-42)holidays/groups/christian.py (6)
ChristianHolidays
(23-499)_easter_sunday
(105-109)_add_good_friday
(344-353)_add_easter_monday
(275-284)_add_christmas_day
(224-232)_add_christmas_day_two
(234-242)holidays/groups/islamic.py (5)
_add_eid_al_fitr_day
(152-163)_add_eid_al_fitr_day_two
(165-173)_add_eid_al_adha_day
(109-120)_add_eid_al_adha_day_two
(122-130)_add_mawlid_day
(329-339)holidays/groups/custom.py (1)
StaticHolidays
(18-47)holidays/observed_holiday_base.py (3)
ObservedHolidayBase
(102-246)_populate_observed
(208-219)_add_observed
(144-196)holidays/holiday_base.py (1)
get_list
(971-986)
tests/countries/test_tanzania.py (4)
tests/countries/test_canada.py (1)
setUpClass
(22-44)tests/countries/test_indonesia.py (1)
setUpClass
(22-26)holidays/countries/tanzania.py (2)
Tanzania
(47-290)TZ
(293-294)tests/common.py (7)
assertAliases
(121-130)assertNoHolidays
(292-294)assertHoliday
(150-152)assertHolidayName
(195-199)assertNoHolidayName
(273-275)assertNoNonObservedHoliday
(248-250)assertHolidays
(228-230)
⏰ 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). (3)
- GitHub Check: Test build on macos-latest
- GitHub Check: Test build on windows-latest
- GitHub Check: Test build on ubuntu-latest
🔇 Additional comments (13)
snapshots/countries/TZ_COMMON.json (1)
2-1519
: Snapshot looks consistent with rules and translations; no manual edits needed.Data reflects 1965 start year, observed/estimated labels, and multi-holiday days (semicolon-delimited) as expected. Entries align with tanzania.py (e.g., 1994 and 2022 observed edge-cases, 1967-12-01 EAC inauguration, dual-day Eid patterns). Given snapshots are auto-generated, this looks good.
tests/countries/test_tanzania.py (9)
22-26
: Solid test harness: full-year ranges, BANK fixture, and estimated toggle match project conventions.Using years=range(1965, 2050) for both observed and non-observed instances plus the BANK-only fixture mirrors established patterns (e.g., Indonesia/Canada). Good reuse of CommonCountryTests helpers.
31-34
: Nice negative coverage for pre-support years.Checking 1964 across supported_categories is a clean way to enforce the new start boundary at 1965.
47-60
: New Year’s Day periods and observed cases are correct.Covers 1965–1966, the 1967–1986 gap, re-introduction from 1987, and observed edge (2012, 2017, 2022). Matches the implementation comments and start/stop logic.
80-95
: Karume Day: good Holy Saturday observed checks.The observed dates include the Tuesday move when Apr 7 hits Holy Saturday (e.g., 2007-04-10, 2012-04-10), matching SAT_TO_NEXT_TUE handling.
137-153
: Union Day → Union Celebrations transition and observed coverage look right.Switch at 1991 and observed moves (2008, 2009, 2014, 2015, 2020) match code and snapshot behavior.
167-201
: Saba Saba / Peasants’ Day split is well tested.Separate assertions for 1965 label, 1977 rename, and 1994 “Sabasaba” Englishing, plus observed moves on both July 7 and Aug 8. Great coverage.
229-242
: Christmas observed edge-cases include 1994—nice catch.List includes 1994-12-27 along with later years, asserting “Badala ya …” and non-observed absence. This locks in the special_public_holidays_observed behavior.
259-286
: Eid al-Fitr: coverage of two-day behavior, observed days, and estimated toggle is comprehensive.Validates 1965 dual-day, modern windows, and the islamic_show_estimated=False path. Good balance without overfitting to estimated labels.
287-308
: Eid al-Adha: first/second day historical nuance and observed behavior are validated.Checks 1965 two-day pattern, modern dates, observed moves (2014, 2017, 2022), and the estimated toggle instance.
holidays/countries/tanzania.py (3)
173-291
: Observed candidates set is curated correctly.Only holidays that are eligible/needed for observation are added to dts_observed (e.g., excludes Good Friday/Easter Monday; includes Boxing Day conditional re-addition). Year gating and name changes are captured cleanly.
300-409
: Islamic date scaffolding and confirmed windows look sound.Confirmed-year ranges and sparse explicit mappings fall back to the base algorithm elsewhere. The notes around 1975 one-day Eid al-Fitr anomaly are neutral and precise.
420-453
: Special and observed-special holidays are well modeled.
- Adds 1967 EAC inauguration (DEC 1).
- Uses special_public_holidays_observed for 1994 and 2022 edge handling as documented.
- Fixes Magufuli funeral Swahili grammar.
All consistent with tests and snapshot.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (3)
holidays/countries/tanzania.py
(8 hunks)snapshots/countries/TZ_COMMON.json
(24 hunks)tests/countries/test_tanzania.py
(4 hunks)
🧰 Additional context used
🧠 Learnings (49)
📓 Common learnings
Learnt from: PPsyrius
PR: vacanza/holidays#2821
File: holidays/countries/tanzania.py:37-83
Timestamp: 2025-08-15T19:16:14.119Z
Learning: In Tanzania holiday documentation, the Bank of Tanzania (BOT) may publish yearly public holidays PDFs using URLs with previous year filenames. For example, the 2024 public holidays document is accessible via a URL containing "2023 public holidays.pdf" but contains actual 2024 holiday information. Always check content rather than assuming filename indicates the year covered.
Learnt from: PPsyrius
PR: vacanza/holidays#2821
File: holidays/countries/tanzania.py:37-83
Timestamp: 2025-08-15T19:16:14.119Z
Learning: PDF filenames in government holiday documentation may not always reflect the actual year covered in the content. The Tanzania Bank of Tanzania (BOT) 2024 public holidays document is hosted at a URL containing "2023" in the filename but contains 2024 holiday information.
Learnt from: PPsyrius
PR: vacanza/holidays#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.
📚 Learning: 2025-04-03T05:59:57.480Z
Learnt from: PPsyrius
PR: vacanza/holidays#2407
File: snapshots/countries/TL_COMMON.json:7-7
Timestamp: 2025-04-03T05:59:57.480Z
Learning: In the holidays project, snapshot files (like snapshots/countries/TL_COMMON.json) are auto-generated when running `make snapshot` and should not be manually edited. Semicolons (;) in holiday entries are used as separators when multiple holidays occur on the same date.
Applied to files:
snapshots/countries/TZ_COMMON.json
📚 Learning: 2025-08-15T19:16:14.119Z
Learnt from: PPsyrius
PR: vacanza/holidays#2821
File: holidays/countries/tanzania.py:37-83
Timestamp: 2025-08-15T19:16:14.119Z
Learning: In Tanzania holiday documentation, the Bank of Tanzania (BOT) may publish yearly public holidays PDFs using URLs with previous year filenames. For example, the 2024 public holidays document is accessible via a URL containing "2023 public holidays.pdf" but contains actual 2024 holiday information. Always check content rather than assuming filename indicates the year covered.
Applied to files:
snapshots/countries/TZ_COMMON.json
holidays/countries/tanzania.py
tests/countries/test_tanzania.py
📚 Learning: 2025-08-15T19:16:14.119Z
Learnt from: PPsyrius
PR: vacanza/holidays#2821
File: holidays/countries/tanzania.py:37-83
Timestamp: 2025-08-15T19:16:14.119Z
Learning: PDF filenames in government holiday documentation may not always reflect the actual year covered in the content. The Tanzania Bank of Tanzania (BOT) 2024 public holidays document is hosted at a URL containing "2023" in the filename but contains 2024 holiday information.
Applied to files:
snapshots/countries/TZ_COMMON.json
holidays/countries/tanzania.py
tests/countries/test_tanzania.py
📚 Learning: 2025-08-11T10:14:28.517Z
Learnt from: PPsyrius
PR: vacanza/holidays#2794
File: holidays/groups/christian.py:328-343
Timestamp: 2025-08-11T10:14:28.517Z
Learning: For Ethiopian holidays in the `holidays/groups/christian.py` file, docstring wording should maintain source-accurate phrasing (e.g., "in coincidence of" for Ethiopian New Year/Enkutatash), even when it might read awkwardly in English, to ensure consistency with official Ethiopian documentation.
Applied to files:
holidays/countries/tanzania.py
📚 Learning: 2025-07-09T20:27:37.760Z
Learnt from: KJhellico
PR: vacanza/holidays#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/tanzania.py
📚 Learning: 2025-07-02T18:17:53.342Z
Learnt from: KJhellico
PR: vacanza/holidays#2608
File: tests/countries/test_saint_vincent_and_the_grenadines.py:162-178
Timestamp: 2025-07-02T18:17:53.342Z
Learning: In the Saint Vincent and the Grenadines holidays implementation, New Year's Day is added without observed rules using `_add_new_years_day()` and should not include observed rule testing in its test method. Only holidays explicitly wrapped with `_add_observed()` have observed behavior.
Applied to files:
holidays/countries/tanzania.py
tests/countries/test_tanzania.py
📚 Learning: 2025-08-25T09:57:22.263Z
Learnt from: PPsyrius
PR: vacanza/holidays#2833
File: holidays/countries/uganda.py:50-56
Timestamp: 2025-08-25T09:57:22.263Z
Learning: In the holidays package, when adding comments for year-restricted holidays in Uganda and similar country modules, include specific legal or historical context such as the actual laws, parliamentary acts, or government decisions that established the holidays, rather than just generic "since YEAR" information. For example, reference the specific Parliament act, decree, or historical event that created the holiday.
Applied to files:
holidays/countries/tanzania.py
📚 Learning: 2025-08-19T21:22:13.125Z
Learnt from: KJhellico
PR: vacanza/holidays#2831
File: holidays/countries/south_sudan.py:84-88
Timestamp: 2025-08-19T21:22:13.125Z
Learning: In the holidays library, message comments directly above holiday addition methods must match the holiday name exactly without any additions, modifications, or explanatory text. For example, if the holiday name is "Eid al-Fitr Holiday", the comment should be "# Eid al-Fitr Holiday." with no extra context.
Applied to files:
holidays/countries/tanzania.py
📚 Learning: 2025-08-08T14:35:35.829Z
Learnt from: KJhellico
PR: vacanza/holidays#2774
File: tests/countries/test_liberia.py:33-46
Timestamp: 2025-08-08T14:35:35.829Z
Learning: In tests/countries/test_liberia.py, prefer neutral comments that reference the election-year rule for Inauguration Day (first Monday of January after an election year). Avoid naming specific winners; e.g., note “1976 follows the 1975 election,” not candidate details.
Applied to files:
holidays/countries/tanzania.py
📚 Learning: 2025-05-10T04:32:15.760Z
Learnt from: PPsyrius
PR: vacanza/holidays#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/tanzania.py
📚 Learning: 2025-08-25T09:57:22.263Z
Learnt from: PPsyrius
PR: vacanza/holidays#2833
File: holidays/countries/uganda.py:50-56
Timestamp: 2025-08-25T09:57:22.263Z
Learning: In the holidays package, when adding contextual comments about holiday establishment dates, avoid making claims about specific laws, parliamentary acts, or government decisions unless they can be verified from authoritative sources like official government legal databases, gazettes, or parliamentary records. Unverified legal claims should not be added to comments even if they seem plausible.
Applied to files:
holidays/countries/tanzania.py
📚 Learning: 2025-03-19T16:54:58.657Z
Learnt from: PPsyrius
PR: vacanza/holidays#2354
File: holidays/countries/fiji.py:146-159
Timestamp: 2025-03-19T16:54:58.657Z
Learning: In the holidays library implementation, explicit holiday dates (like Diwali in Fiji) are only defined for historical years with official sources (2016-2025). Future dates beyond the explicitly defined range are automatically calculated by methods like `_add_diwali`, which provide approximations when official dates aren't yet available.
Applied to files:
holidays/countries/tanzania.py
📚 Learning: 2025-03-29T15:15:05.919Z
Learnt from: KJhellico
PR: vacanza/holidays#2354
File: holidays/countries/fiji.py:171-183
Timestamp: 2025-03-29T15:15:05.919Z
Learning: In the Fiji holidays implementation, the maintainers are aware of the need to extend the MAWLID_DATES dictionary beyond 2025 when future official references become available, and will do so when appropriate. No suggestions about extending this dictionary should be made in future reviews.
Applied to files:
holidays/countries/tanzania.py
📚 Learning: 2025-08-03T13:48:11.910Z
Learnt from: KJhellico
PR: vacanza/holidays#2777
File: holidays/countries/gambia.py:120-122
Timestamp: 2025-08-03T13:48:11.910Z
Learning: When reviewing holiday implementations in the holidays library, defer to the maintainers' choice of start years for specific holiday policies, as they likely have access to more reliable primary sources and official documentation than what can be found through web searches.
Applied to files:
holidays/countries/tanzania.py
📚 Learning: 2025-03-19T16:53:00.375Z
Learnt from: PPsyrius
PR: vacanza/holidays#2354
File: holidays/countries/fiji.py:185-188
Timestamp: 2025-03-19T16:53:00.375Z
Learning: In the Fiji holidays implementation, the `special_public_holidays_observed` dictionary in `FijiStaticHolidays` is only used for exceptions to the normal observance rules, not for documenting all holidays. Only 2019's Constitution Day needed a special entry as it didn't follow the standard patterns.
Applied to files:
holidays/countries/tanzania.py
📚 Learning: 2025-05-09T18:36:09.607Z
Learnt from: PPsyrius
PR: vacanza/holidays#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:
holidays/countries/tanzania.py
tests/countries/test_tanzania.py
📚 Learning: 2025-06-19T02:34:18.382Z
Learnt from: PPsyrius
PR: vacanza/holidays#2643
File: holidays/countries/mauritius.py:144-169
Timestamp: 2025-06-19T02:34:18.382Z
Learning: Custom holiday classes that extend _CustomHinduHolidays, _CustomIslamicHolidays, _CustomBuddhistHolidays, etc. in the holidays library do not use docstrings. They follow a pattern of using only inline comments above date dictionaries, as seen in Malaysia, Singapore, UAE, and other country implementations.
Applied to files:
holidays/countries/tanzania.py
📚 Learning: 2025-04-03T12:36:41.201Z
Learnt from: PPsyrius
PR: vacanza/holidays#2398
File: holidays/countries/guinea.py:73-77
Timestamp: 2025-04-03T12:36:41.201Z
Learning: In the Holidays library, comments explaining year restrictions for holidays should be placed above the year check conditional statement, not inside it. Example format:
```python
# reason why goes here
if start_year <= self._year <= end_year:
# Holiday name
self._add_holiday_function(tr("Holiday Name"))
```
Applied to files:
holidays/countries/tanzania.py
📚 Learning: 2025-03-23T10:11:50.465Z
Learnt from: KJhellico
PR: vacanza/holidays#2354
File: holidays/countries/fiji.py:63-70
Timestamp: 2025-03-23T10:11:50.465Z
Learning: In the holidays library, the `SAT_SUN_TO_NEXT_MON_TUE` rule is specifically used for consecutive holidays (like Christmas Day and Boxing Day) to ensure they're observed on separate weekdays (Monday and Tuesday) when they fall on weekends, while `SAT_SUN_TO_NEXT_MON` is used as the default rule for other holidays.
Applied to files:
holidays/countries/tanzania.py
📚 Learning: 2025-08-15T20:49:30.223Z
Learnt from: KJhellico
PR: vacanza/holidays#2822
File: holidays/countries/azerbaijan.py:170-170
Timestamp: 2025-08-15T20:49:30.223Z
Learning: In Azerbaijan's Labor Code, there is a legal distinction between holidays (Article 105) and days of remembrance (Article 106). Martyrs' Day (January 20) is a day of remembrance under Article 106, not a holiday, which affects how Bayram rollover rules apply when they coincide - §105(6) rollover rules don't apply to days of remembrance.
Applied to files:
holidays/countries/tanzania.py
📚 Learning: 2025-06-15T20:39:51.085Z
Learnt from: KJhellico
PR: vacanza/holidays#2632
File: holidays/countries/solomon_islands.py:90-97
Timestamp: 2025-06-15T20:39:51.085Z
Learning: Solomon Islands Saturday → Friday holiday shift rule was systematically implemented only from around 2021-2022 onward, not consistently applied since 1979. The Public Holidays Act only explicitly mentions Sunday → Monday shifts, with Saturday shifts handled through discretionary ministerial gazette notices.
Applied to files:
holidays/countries/tanzania.py
📚 Learning: 2025-07-14T20:23:48.198Z
Learnt from: KJhellico
PR: vacanza/holidays#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/tanzania.py
📚 Learning: 2025-07-09T21:16:35.145Z
Learnt from: KJhellico
PR: vacanza/holidays#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:
holidays/countries/tanzania.py
tests/countries/test_tanzania.py
📚 Learning: 2025-05-13T13:23:11.375Z
Learnt from: KJhellico
PR: vacanza/holidays#2483
File: holidays/countries/turks_and_caicos_islands.py:117-118
Timestamp: 2025-05-13T13:23:11.375Z
Learning: The holidays library uses `_add_christmas_day_two` method to add Boxing Day holiday, not `_add_boxing_day`.
Applied to files:
holidays/countries/tanzania.py
📚 Learning: 2025-07-08T10:20:04.069Z
Learnt from: KJhellico
PR: vacanza/holidays#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/tanzania.py
📚 Learning: 2025-06-14T11:04:24.104Z
Learnt from: KJhellico
PR: vacanza/holidays#2629
File: holidays/countries/namibia.py:70-73
Timestamp: 2025-06-14T11:04:24.104Z
Learning: In Namibia's holiday system, Genocide Remembrance Day (May 28, starting 2025) is implemented as a fixed commemorative date without observed day handling (_add_observed), indicating it should be observed on May 28th regardless of the day of the week, similar to other commemorative holidays like Good Friday and Christmas Day.
Applied to files:
holidays/countries/tanzania.py
📚 Learning: 2025-06-14T11:04:24.104Z
Learnt from: KJhellico
PR: vacanza/holidays#2629
File: holidays/countries/namibia.py:70-73
Timestamp: 2025-06-14T11:04:24.104Z
Learning: In Namibia's holiday system, holidays declared by presidential proclamation under Section 1(3) of the Public Holidays Act may not automatically be subject to the Sunday-to-Monday observation rule in Section 1(2), which primarily applies to holidays listed in the Schedule. Genocide Remembrance Day (May 28) starting in 2025 is treated as a fixed commemorative date without observed day handling.
Applied to files:
holidays/countries/tanzania.py
📚 Learning: 2025-06-13T12:18:03.539Z
Learnt from: PPsyrius
PR: vacanza/holidays#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/tanzania.py
📚 Learning: 2025-07-10T15:55:34.523Z
Learnt from: KJhellico
PR: vacanza/holidays#2706
File: holidays/countries/cayman_islands.py:50-55
Timestamp: 2025-07-10T15:55:34.523Z
Learning: The `islamic_show_estimated` parameter in country class constructors is only needed for countries that implement Islamic holidays (inherit from IslamicHolidays or _CustomIslamicHolidays groups). Countries with only Christian and secular holidays do not need this parameter.
Applied to files:
holidays/countries/tanzania.py
📚 Learning: 2025-08-21T06:52:25.503Z
Learnt from: PPsyrius
PR: vacanza/holidays#2843
File: holidays/countries/burundi.py:140-155
Timestamp: 2025-08-21T06:52:25.503Z
Learning: In the holidays library Islamic calendar implementation, CONFIRMED_YEARS represents the full range of years that have been officially verified, while the individual EID_AL_FITR_DATES and EID_AL_ADHA_DATES dictionaries only contain entries for years where the official dates differ from the base Umm al-Qura algorithmic calculations. Years within CONFIRMED_YEARS but not in the explicit date dictionaries will use the base algorithm but be marked as "confirmed" rather than "estimated".
Applied to files:
holidays/countries/tanzania.py
📚 Learning: 2025-04-13T19:10:31.502Z
Learnt from: KJhellico
PR: vacanza/holidays#2465
File: holidays/countries/suriname.py:219-251
Timestamp: 2025-04-13T19:10:31.502Z
Learning: The `_CustomIslamicHolidays` classes in this project contain only exact verified holiday dates from reliable sources, rather than calculated or estimated future dates. This is by design to ensure accuracy, particularly for religious holidays that may follow lunar calendars or depend on local observations.
Applied to files:
holidays/countries/tanzania.py
📚 Learning: 2025-04-05T04:47:27.213Z
Learnt from: PPsyrius
PR: vacanza/holidays#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_tanzania.py
📚 Learning: 2025-05-06T21:07:11.577Z
Learnt from: KJhellico
PR: vacanza/holidays#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_tanzania.py
📚 Learning: 2025-04-05T06:49:06.217Z
Learnt from: PPsyrius
PR: vacanza/holidays#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_tanzania.py
📚 Learning: 2025-06-15T11:52:39.572Z
Learnt from: PPsyrius
PR: vacanza/holidays#2601
File: tests/countries/test_mongolia.py:128-156
Timestamp: 2025-06-15T11:52:39.572Z
Learning: In the vacanza/holidays project tests, when testing holidays that span multiple consecutive days across many years (like Mongolia's National Festival spanning July 11-13), prefer explicit for loops over complex nested generator expressions with unpacking. The explicit loops are more readable, easier to maintain, and better communicate the testing intent even though the Big O complexity is equivalent.
Applied to files:
tests/countries/test_tanzania.py
📚 Learning: 2025-04-04T10:52:41.546Z
Learnt from: KJhellico
PR: vacanza/holidays#2398
File: holidays/countries/guinea.py:106-110
Timestamp: 2025-04-04T10:52:41.546Z
Learning: In the Guinea holidays implementation, observed Eid al-Fitr cases are properly covered by the test_eid_al_fitr_day() method, which tests both the regular holiday dates and the observed dates when the holiday falls on a non-working day (for years >= 2023).
Applied to files:
tests/countries/test_tanzania.py
📚 Learning: 2025-08-25T04:28:02.030Z
Learnt from: PPsyrius
PR: vacanza/holidays#2848
File: tests/countries/test_somalia.py:44-127
Timestamp: 2025-08-25T04:28:02.030Z
Learning: In the holidays library, Islamic holiday tests use `self.no_estimated_holidays = Country(years=years, islamic_show_estimated=False)` as the library-wide standard approach to simplify test cases. This pattern is intentional and preferred over testing estimated labels.
Applied to files:
tests/countries/test_tanzania.py
📚 Learning: 2025-04-05T04:50:40.752Z
Learnt from: PPsyrius
PR: vacanza/holidays#2416
File: tests/countries/test_turkmenistan.py:31-49
Timestamp: 2025-04-05T04:50:40.752Z
Learning: For Turkmenistan holiday tests, use this class structure: `class TestTurkmenistan(CommonCountryTests, TestCase)` with imports `from unittest import TestCase`, `from holidays.countries import Turkmenistan, TM, TKM`, and `from tests.common import CommonCountryTests`. Ensure to call `super().setUp()` in the setUp method.
Applied to files:
tests/countries/test_tanzania.py
📚 Learning: 2025-07-24T15:21:31.632Z
Learnt from: PPsyrius
PR: vacanza/holidays#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_tanzania.py
📚 Learning: 2025-07-02T18:21:59.302Z
Learnt from: KJhellico
PR: vacanza/holidays#2608
File: tests/countries/test_saint_vincent_and_the_grenadines.py:162-178
Timestamp: 2025-07-02T18:21:59.302Z
Learning: In the Saint Vincent and the Grenadines holiday tests, for holidays without observed rules that only require a single assertHolidayName call, pass the holiday name directly as a string literal rather than storing it in a variable first for cleaner, more concise code.
Applied to files:
tests/countries/test_tanzania.py
📚 Learning: 2025-04-23T14:55:35.504Z
Learnt from: PPsyrius
PR: vacanza/holidays#2489
File: holidays/countries/sao_tome_and_principe.py:22-26
Timestamp: 2025-04-23T14:55:35.504Z
Learning: References in holidays classes should only be included if they're used for test case cross-checks or provide historical context about when holidays were added/removed, not just for the sake of having more references.
Applied to files:
tests/countries/test_tanzania.py
📚 Learning: 2025-04-04T10:52:41.546Z
Learnt from: KJhellico
PR: vacanza/holidays#2398
File: holidays/countries/guinea.py:106-110
Timestamp: 2025-04-04T10:52:41.546Z
Learning: In the Guinea holidays implementation, observed Eid al-Fitr cases are covered by the test_eid_al_fitr_day() method, which tests both regular holiday dates and the observed dates when the holiday falls on a non-working day (for years >= 2023).
Applied to files:
tests/countries/test_tanzania.py
📚 Learning: 2025-08-12T17:16:54.497Z
Learnt from: PPsyrius
PR: vacanza/holidays#2794
File: tests/calendars/test_julian.py:35-36
Timestamp: 2025-08-12T17:16:54.497Z
Learning: In the vacanza/holidays project calendar tests (Thai, Ethiopian, Julian, etc.), the established testing pattern for validation methods is to use simple for loops like `for year in known_data_dict:` followed by `self.assertEqual(expected, actual)` without using unittest's subTest feature. This pattern is consistently maintained across all calendar test files.
Applied to files:
tests/countries/test_tanzania.py
📚 Learning: 2025-04-05T04:29:38.042Z
Learnt from: PPsyrius
PR: vacanza/holidays#2416
File: tests/countries/test_turkmenistan.py:85-86
Timestamp: 2025-04-05T04:29:38.042Z
Learning: For testing holiday implementations in the vacanza/holidays repository, recommend using `from tests.common import CommonCountryTests` as the base class instead of directly using `unittest.TestCase` to maintain consistency with project conventions and leverage common test utilities.
Applied to files:
tests/countries/test_tanzania.py
📚 Learning: 2025-06-18T17:01:58.067Z
Learnt from: PPsyrius
PR: vacanza/holidays#2642
File: tests/countries/test_wallis_and_futuna.py:19-23
Timestamp: 2025-06-18T17:01:58.067Z
Learning: In the vacanza/holidays repository, the standard pattern for test class setUpClass methods is `super().setUpClass(HolidayClass)` or `super().setUpClass(HolidayClass, years=...)` where HolidayClass is passed as the first argument. This is the correct signature that matches the CommonCountryTests.setUpClass method which accepts test_class as the first parameter after cls. Pylint warnings about parameter count mismatch are false positives when comparing against TestCase.setUpClass instead of the immediate parent CommonCountryTests.setUpClass.
Applied to files:
tests/countries/test_tanzania.py
📚 Learning: 2025-04-05T04:33:53.254Z
Learnt from: PPsyrius
PR: vacanza/holidays#2416
File: tests/countries/test_turkmenistan.py:52-64
Timestamp: 2025-04-05T04:33:53.254Z
Learning: For Turkmenistan holiday tests, recommend using CommonCountryTests as the base class rather than unittest.TestCase to follow project conventions, be consistent with other country test files, and gain access to common test utilities.
Applied to files:
tests/countries/test_tanzania.py
📚 Learning: 2025-06-18T17:01:58.067Z
Learnt from: PPsyrius
PR: vacanza/holidays#2642
File: tests/countries/test_wallis_and_futuna.py:19-23
Timestamp: 2025-06-18T17:01:58.067Z
Learning: In the vacanza/holidays repository, the standard pattern for test class setUpClass methods is `super().setUpClass(HolidayClass)` 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_tanzania.py
📚 Learning: 2025-06-22T21:36:18.015Z
Learnt from: KJhellico
PR: vacanza/holidays#2671
File: tests/countries/test_libya.py:19-24
Timestamp: 2025-06-22T21:36:18.015Z
Learning: In the vacanza/holidays project, test classes for countries do not use docstrings. All test classes follow the same pattern: class declaration directly followed by classmethod def setUpClass(cls) without any docstrings for the class or methods.
Applied to files:
tests/countries/test_tanzania.py
🧬 Code graph analysis (2)
holidays/countries/tanzania.py (5)
holidays/calendars/gregorian.py (1)
_timedelta
(37-42)holidays/groups/christian.py (6)
ChristianHolidays
(23-499)_easter_sunday
(105-109)_add_good_friday
(344-353)_add_easter_monday
(275-284)_add_christmas_day
(224-232)_add_christmas_day_two
(234-242)holidays/groups/islamic.py (5)
_add_eid_al_fitr_day
(152-163)_add_eid_al_fitr_day_two
(165-173)_add_eid_al_adha_day
(109-120)_add_eid_al_adha_day_two
(122-130)_add_mawlid_day
(329-339)holidays/groups/custom.py (1)
StaticHolidays
(18-47)holidays/observed_holiday_base.py (3)
ObservedHolidayBase
(102-246)_populate_observed
(208-219)_add_observed
(144-196)
tests/countries/test_tanzania.py (6)
tests/countries/test_canada.py (1)
setUpClass
(22-44)tests/countries/test_indonesia.py (1)
setUpClass
(22-26)tests/countries/test_laos.py (1)
setUpClass
(22-23)tests/countries/test_uruguay.py (1)
setUpClass
(22-25)holidays/countries/tanzania.py (2)
Tanzania
(47-290)TZ
(293-294)tests/common.py (7)
assertAliases
(121-130)assertNoHolidays
(292-294)assertHoliday
(150-152)assertHolidayName
(195-199)assertNoHolidayName
(273-275)assertNoNonObservedHoliday
(248-250)assertHolidays
(228-230)
🔇 Additional comments (17)
snapshots/countries/TZ_COMMON.json (4)
413-430
: Data sanity: 1994 Christmas observed edge case correctly captured.The snapshot includes 1994-12-27 "Christmas Day (observed)", which matches the special_public_holidays_observed handling in TanzaniaStaticHolidays and the tests. Good catch on this boundary year.
618-621
: Intentional coalescing of observed days (Dec 27, 2004) looks correct per policy interpretation."2004-12-27": "Boxing Day (observed); Christmas Day (observed)" reflects the one-day-lieu approach discussed in code/comments rather than splitting into Mon/Tue. This aligns with the bespoke rule in Tanzania._populate_observed and avoids over-allocating observed days.
1018-1026
: Dual-day Eid al-Fitr representation is consistent.Both 2023-04-22 and 2023-04-23 are present for Eid al-Fitr. This matches the underlying Islamic calendar data and the tests that assert two days.
663-680
: Overlaps are represented with semicolons as expected.Composite entries like:
- 2007-01-01: "Eid al-Adha; New Year's Day"
- 2007-10-14: "Eid al-Fitr; The Mwalimu Nyerere Day and Climax of the Uhuru Torch Race"
match the snapshot convention for multiple holidays on the same date.
tests/countries/test_tanzania.py (6)
23-26
: Good: full-range coverage setup (1965–2049) with observed and non-observed instances.Using years for both observed and non-observed instances ensures assertNoNonObservedHoliday checks work across the entire supported span, including boundary years 1994 and 2022.
31-34
: No holidays before start_year is correctly asserted.Asserting no holidays for 1964 against supported categories validates the new start_year=1965 change.
80-95
: Karume Day Holy Saturday observed cases are tested.The observed Tuesday dates (e.g., 2007-04-10, 2012-04-10) verify the special Holy Saturday handling in the implementation. Solid coverage.
229-241
: Edge-case observed Christmas dates covered (incl. 1994).The observed list includes 1994-12-27 and other known Mondays. This guards the 1994 partial-year policy and later observed rules.
259-286
: Eid al-Fitr tests exercise dual days, observed-in-lieu, and estimated toggle.Using self.no_estimated_holidays enforces the library-wide pattern for Islamic “estimated” labels and keeps the suite clean. Nicely done.
287-307
: Eid al-Adha observed and multi-year assertions are comprehensive.Covers historical entries and modern confirmed years; observed rollover (e.g., 2022-07-11) is asserted.
holidays/countries/tanzania.py (7)
128-138
: Docstring is clear and correctly bounded; 1994/2022 edge handling documented.The observed-rule window is explicitly described with legal references and edge-year exceptions noted.
176-181
: New Year’s Day gaps (1967–1986) handled per references.The conditional correctly removes NYD for 1967–1986 inclusive and re-adds from 1987. Tests assert both the present and absent ranges.
228-240
: Renaming and split of July 7/Peasants’ Day is accurate.
- "Saba Saba" until 1976
- "Sikukuu ya Wakulima" (Peasants’ Day) from 1977–1993 on Jul 7
- "Sabasaba" from 1994 on Jul 7
- Separate Aug 8 Peasants’ Day from 1995
Matches tests and snapshot.
268-278
: Comment neutralization for 1975 Eid al-Fitr anomaly is good.The note avoids first-person tone and is precise. Implementation still adds two days for consistency with other years.
301-337
: Islamic date tables: ranges and spot years look consistent with tests and snapshot.Confirmed key anchors (e.g., 1965, 1967, 1982, 2014–2025). The confirmed-years spans align with the project’s approach of marking confirmed vs. estimated.
442-453
: Observed exceptions table captures the necessary 1994/2022 overrides.These entries bridge the skip-year logic in _populate_observed and are mirrored in tests and snapshot.
139-141
: Confirmed: 1994 & 2022 observed exceptions are in place—no changes needed.Both the code’s
special_public_holidays_observed
dict (line 442) and the TZ_COMMON snapshot include entries for
• 1994-12-27: Christmas Day (observed)
• 2022-01-03: New Year’s Day (observed)
• 2022-05-02: International Workers’ Day (observed)
• 2022-07-11: Eid al-Adha (observed)The early-return guard (
if year ≤ 1994 or year ≥ 2022
) correctly defers to those static overrides. Keep monitoring for any future edge-year exceptions, but no edits are required here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
♻️ Duplicate comments (2)
holidays/countries/tanzania.py (2)
52-97
: References/Checked With section: LGTM; 2024 BOT link quirk is intentional.The “2024” entry pointing to a URL with “2023” in the filename reflects the BOT hosting quirk and was already discussed/accepted. No change needed.
145-158
: Re: “first Eid day” MON/TUE rule – behavior is fine as implemented.Prior concern about rule “leaking” to co-occurring holidays was already resolved; in practice, collisions occur on Sundays where both rules move to Monday, so results are identical. No change needed.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
holidays/countries/tanzania.py
(8 hunks)
🧰 Additional context used
🧠 Learnings (39)
📓 Common learnings
Learnt from: PPsyrius
PR: vacanza/holidays#2821
File: holidays/countries/tanzania.py:145-163
Timestamp: 2025-08-26T09:43:38.294Z
Learning: In the Tanzania holidays implementation, when multiple holidays fall on the same date (like Eid al-Fitr and Mwalimu Nyerere Day on 2007-10-14), the observed rule logic correctly applies to all holidays on that date. The SAT_SUN_TO_NEXT_MON_TUE rule for the first Eid day doesn't create issues with co-occurring holidays because in practice, such collisions occur on Sundays where both SAT_SUN_TO_NEXT_MON and SAT_SUN_TO_NEXT_MON_TUE rules yield identical results (both move to Monday).
Learnt from: PPsyrius
PR: vacanza/holidays#2821
File: holidays/countries/tanzania.py:145-163
Timestamp: 2025-08-26T09:43:38.294Z
Learning: In the Tanzania holidays implementation, when multiple holidays fall on the same date (like Eid al-Fitr and Mwalimu Nyerere Day on 2007-10-14), the observed rule logic correctly applies to all holidays on that date. The SAT_SUN_TO_NEXT_MON_TUE rule for the first Eid day doesn't create issues with co-occurring holidays because in practice, such collisions occur on Sundays where both SAT_SUN_TO_NEXT_MON and SAT_SUN_TO_NEXT_MON_TUE rules yield identical results (both move to Monday).
Learnt from: PPsyrius
PR: vacanza/holidays#2821
File: holidays/countries/tanzania.py:37-83
Timestamp: 2025-08-15T19:16:14.119Z
Learning: In Tanzania holiday documentation, the Bank of Tanzania (BOT) may publish yearly public holidays PDFs using URLs with previous year filenames. For example, the 2024 public holidays document is accessible via a URL containing "2023 public holidays.pdf" but contains actual 2024 holiday information. Always check content rather than assuming filename indicates the year covered.
Learnt from: PPsyrius
PR: vacanza/holidays#2821
File: holidays/countries/tanzania.py:37-83
Timestamp: 2025-08-15T19:16:14.119Z
Learning: PDF filenames in government holiday documentation may not always reflect the actual year covered in the content. The Tanzania Bank of Tanzania (BOT) 2024 public holidays document is hosted at a URL containing "2023" in the filename but contains 2024 holiday information.
Learnt from: PPsyrius
PR: vacanza/holidays#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.
📚 Learning: 2025-08-15T19:16:14.119Z
Learnt from: PPsyrius
PR: vacanza/holidays#2821
File: holidays/countries/tanzania.py:37-83
Timestamp: 2025-08-15T19:16:14.119Z
Learning: In Tanzania holiday documentation, the Bank of Tanzania (BOT) may publish yearly public holidays PDFs using URLs with previous year filenames. For example, the 2024 public holidays document is accessible via a URL containing "2023 public holidays.pdf" but contains actual 2024 holiday information. Always check content rather than assuming filename indicates the year covered.
Applied to files:
holidays/countries/tanzania.py
📚 Learning: 2025-08-15T19:16:14.119Z
Learnt from: PPsyrius
PR: vacanza/holidays#2821
File: holidays/countries/tanzania.py:37-83
Timestamp: 2025-08-15T19:16:14.119Z
Learning: PDF filenames in government holiday documentation may not always reflect the actual year covered in the content. The Tanzania Bank of Tanzania (BOT) 2024 public holidays document is hosted at a URL containing "2023" in the filename but contains 2024 holiday information.
Applied to files:
holidays/countries/tanzania.py
📚 Learning: 2025-08-26T09:43:38.294Z
Learnt from: PPsyrius
PR: vacanza/holidays#2821
File: holidays/countries/tanzania.py:145-163
Timestamp: 2025-08-26T09:43:38.294Z
Learning: In the Tanzania holidays implementation, when multiple holidays fall on the same date (like Eid al-Fitr and Mwalimu Nyerere Day on 2007-10-14), the observed rule logic correctly applies to all holidays on that date. The SAT_SUN_TO_NEXT_MON_TUE rule for the first Eid day doesn't create issues with co-occurring holidays because in practice, such collisions occur on Sundays where both SAT_SUN_TO_NEXT_MON and SAT_SUN_TO_NEXT_MON_TUE rules yield identical results (both move to Monday).
Applied to files:
holidays/countries/tanzania.py
📚 Learning: 2025-08-11T10:14:28.517Z
Learnt from: PPsyrius
PR: vacanza/holidays#2794
File: holidays/groups/christian.py:328-343
Timestamp: 2025-08-11T10:14:28.517Z
Learning: For Ethiopian holidays in the `holidays/groups/christian.py` file, docstring wording should maintain source-accurate phrasing (e.g., "in coincidence of" for Ethiopian New Year/Enkutatash), even when it might read awkwardly in English, to ensure consistency with official Ethiopian documentation.
Applied to files:
holidays/countries/tanzania.py
📚 Learning: 2025-07-09T20:27:37.760Z
Learnt from: KJhellico
PR: vacanza/holidays#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/tanzania.py
📚 Learning: 2025-07-02T18:17:53.342Z
Learnt from: KJhellico
PR: vacanza/holidays#2608
File: tests/countries/test_saint_vincent_and_the_grenadines.py:162-178
Timestamp: 2025-07-02T18:17:53.342Z
Learning: In the Saint Vincent and the Grenadines holidays implementation, New Year's Day is added without observed rules using `_add_new_years_day()` and should not include observed rule testing in its test method. Only holidays explicitly wrapped with `_add_observed()` have observed behavior.
Applied to files:
holidays/countries/tanzania.py
📚 Learning: 2025-08-25T09:57:22.263Z
Learnt from: PPsyrius
PR: vacanza/holidays#2833
File: holidays/countries/uganda.py:50-56
Timestamp: 2025-08-25T09:57:22.263Z
Learning: In the holidays package, when adding comments for year-restricted holidays in Uganda and similar country modules, include specific legal or historical context such as the actual laws, parliamentary acts, or government decisions that established the holidays, rather than just generic "since YEAR" information. For example, reference the specific Parliament act, decree, or historical event that created the holiday.
Applied to files:
holidays/countries/tanzania.py
📚 Learning: 2025-08-19T21:22:13.125Z
Learnt from: KJhellico
PR: vacanza/holidays#2831
File: holidays/countries/south_sudan.py:84-88
Timestamp: 2025-08-19T21:22:13.125Z
Learning: In the holidays library, message comments directly above holiday addition methods must match the holiday name exactly without any additions, modifications, or explanatory text. For example, if the holiday name is "Eid al-Fitr Holiday", the comment should be "# Eid al-Fitr Holiday." with no extra context.
Applied to files:
holidays/countries/tanzania.py
📚 Learning: 2025-08-08T14:35:35.829Z
Learnt from: KJhellico
PR: vacanza/holidays#2774
File: tests/countries/test_liberia.py:33-46
Timestamp: 2025-08-08T14:35:35.829Z
Learning: In tests/countries/test_liberia.py, prefer neutral comments that reference the election-year rule for Inauguration Day (first Monday of January after an election year). Avoid naming specific winners; e.g., note “1976 follows the 1975 election,” not candidate details.
Applied to files:
holidays/countries/tanzania.py
📚 Learning: 2025-05-10T04:32:15.760Z
Learnt from: PPsyrius
PR: vacanza/holidays#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/tanzania.py
📚 Learning: 2025-08-25T09:57:22.263Z
Learnt from: PPsyrius
PR: vacanza/holidays#2833
File: holidays/countries/uganda.py:50-56
Timestamp: 2025-08-25T09:57:22.263Z
Learning: In the holidays package, when adding contextual comments about holiday establishment dates, avoid making claims about specific laws, parliamentary acts, or government decisions unless they can be verified from authoritative sources like official government legal databases, gazettes, or parliamentary records. Unverified legal claims should not be added to comments even if they seem plausible.
Applied to files:
holidays/countries/tanzania.py
📚 Learning: 2025-03-19T16:54:58.657Z
Learnt from: PPsyrius
PR: vacanza/holidays#2354
File: holidays/countries/fiji.py:146-159
Timestamp: 2025-03-19T16:54:58.657Z
Learning: In the holidays library implementation, explicit holiday dates (like Diwali in Fiji) are only defined for historical years with official sources (2016-2025). Future dates beyond the explicitly defined range are automatically calculated by methods like `_add_diwali`, which provide approximations when official dates aren't yet available.
Applied to files:
holidays/countries/tanzania.py
📚 Learning: 2025-03-29T15:15:05.919Z
Learnt from: KJhellico
PR: vacanza/holidays#2354
File: holidays/countries/fiji.py:171-183
Timestamp: 2025-03-29T15:15:05.919Z
Learning: In the Fiji holidays implementation, the maintainers are aware of the need to extend the MAWLID_DATES dictionary beyond 2025 when future official references become available, and will do so when appropriate. No suggestions about extending this dictionary should be made in future reviews.
Applied to files:
holidays/countries/tanzania.py
📚 Learning: 2025-08-03T13:48:11.910Z
Learnt from: KJhellico
PR: vacanza/holidays#2777
File: holidays/countries/gambia.py:120-122
Timestamp: 2025-08-03T13:48:11.910Z
Learning: When reviewing holiday implementations in the holidays library, defer to the maintainers' choice of start years for specific holiday policies, as they likely have access to more reliable primary sources and official documentation than what can be found through web searches.
Applied to files:
holidays/countries/tanzania.py
📚 Learning: 2025-03-19T16:53:00.375Z
Learnt from: PPsyrius
PR: vacanza/holidays#2354
File: holidays/countries/fiji.py:185-188
Timestamp: 2025-03-19T16:53:00.375Z
Learning: In the Fiji holidays implementation, the `special_public_holidays_observed` dictionary in `FijiStaticHolidays` is only used for exceptions to the normal observance rules, not for documenting all holidays. Only 2019's Constitution Day needed a special entry as it didn't follow the standard patterns.
Applied to files:
holidays/countries/tanzania.py
📚 Learning: 2025-05-09T18:36:09.607Z
Learnt from: PPsyrius
PR: vacanza/holidays#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:
holidays/countries/tanzania.py
📚 Learning: 2025-03-23T10:11:50.465Z
Learnt from: KJhellico
PR: vacanza/holidays#2354
File: holidays/countries/fiji.py:63-70
Timestamp: 2025-03-23T10:11:50.465Z
Learning: In the holidays library, the `SAT_SUN_TO_NEXT_MON_TUE` rule is specifically used for consecutive holidays (like Christmas Day and Boxing Day) to ensure they're observed on separate weekdays (Monday and Tuesday) when they fall on weekends, while `SAT_SUN_TO_NEXT_MON` is used as the default rule for other holidays.
Applied to files:
holidays/countries/tanzania.py
📚 Learning: 2025-08-15T20:49:30.223Z
Learnt from: KJhellico
PR: vacanza/holidays#2822
File: holidays/countries/azerbaijan.py:170-170
Timestamp: 2025-08-15T20:49:30.223Z
Learning: In Azerbaijan's Labor Code, there is a legal distinction between holidays (Article 105) and days of remembrance (Article 106). Martyrs' Day (January 20) is a day of remembrance under Article 106, not a holiday, which affects how Bayram rollover rules apply when they coincide - §105(6) rollover rules don't apply to days of remembrance.
Applied to files:
holidays/countries/tanzania.py
📚 Learning: 2025-06-15T20:39:51.085Z
Learnt from: KJhellico
PR: vacanza/holidays#2632
File: holidays/countries/solomon_islands.py:90-97
Timestamp: 2025-06-15T20:39:51.085Z
Learning: Solomon Islands Saturday → Friday holiday shift rule was systematically implemented only from around 2021-2022 onward, not consistently applied since 1979. The Public Holidays Act only explicitly mentions Sunday → Monday shifts, with Saturday shifts handled through discretionary ministerial gazette notices.
Applied to files:
holidays/countries/tanzania.py
📚 Learning: 2025-07-14T20:23:48.198Z
Learnt from: KJhellico
PR: vacanza/holidays#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/tanzania.py
📚 Learning: 2025-07-09T21:16:35.145Z
Learnt from: KJhellico
PR: vacanza/holidays#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:
holidays/countries/tanzania.py
📚 Learning: 2025-05-13T13:23:11.375Z
Learnt from: KJhellico
PR: vacanza/holidays#2483
File: holidays/countries/turks_and_caicos_islands.py:117-118
Timestamp: 2025-05-13T13:23:11.375Z
Learning: The holidays library uses `_add_christmas_day_two` method to add Boxing Day holiday, not `_add_boxing_day`.
Applied to files:
holidays/countries/tanzania.py
📚 Learning: 2025-07-08T10:20:04.069Z
Learnt from: KJhellico
PR: vacanza/holidays#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/tanzania.py
📚 Learning: 2025-06-14T11:04:24.104Z
Learnt from: KJhellico
PR: vacanza/holidays#2629
File: holidays/countries/namibia.py:70-73
Timestamp: 2025-06-14T11:04:24.104Z
Learning: In Namibia's holiday system, Genocide Remembrance Day (May 28, starting 2025) is implemented as a fixed commemorative date without observed day handling (_add_observed), indicating it should be observed on May 28th regardless of the day of the week, similar to other commemorative holidays like Good Friday and Christmas Day.
Applied to files:
holidays/countries/tanzania.py
📚 Learning: 2025-06-14T11:04:24.104Z
Learnt from: KJhellico
PR: vacanza/holidays#2629
File: holidays/countries/namibia.py:70-73
Timestamp: 2025-06-14T11:04:24.104Z
Learning: In Namibia's holiday system, holidays declared by presidential proclamation under Section 1(3) of the Public Holidays Act may not automatically be subject to the Sunday-to-Monday observation rule in Section 1(2), which primarily applies to holidays listed in the Schedule. Genocide Remembrance Day (May 28) starting in 2025 is treated as a fixed commemorative date without observed day handling.
Applied to files:
holidays/countries/tanzania.py
📚 Learning: 2025-07-02T18:21:59.302Z
Learnt from: KJhellico
PR: vacanza/holidays#2608
File: tests/countries/test_saint_vincent_and_the_grenadines.py:162-178
Timestamp: 2025-07-02T18:21:59.302Z
Learning: In the Saint Vincent and the Grenadines holiday tests, for holidays without observed rules that only require a single assertHolidayName call, pass the holiday name directly as a string literal rather than storing it in a variable first for cleaner, more concise code.
Applied to files:
holidays/countries/tanzania.py
📚 Learning: 2025-04-04T10:52:41.546Z
Learnt from: KJhellico
PR: vacanza/holidays#2398
File: holidays/countries/guinea.py:106-110
Timestamp: 2025-04-04T10:52:41.546Z
Learning: In the Guinea holidays implementation, observed Eid al-Fitr cases are properly covered by the test_eid_al_fitr_day() method, which tests both the regular holiday dates and the observed dates when the holiday falls on a non-working day (for years >= 2023).
Applied to files:
holidays/countries/tanzania.py
📚 Learning: 2025-04-04T10:52:41.546Z
Learnt from: KJhellico
PR: vacanza/holidays#2398
File: holidays/countries/guinea.py:106-110
Timestamp: 2025-04-04T10:52:41.546Z
Learning: In the Guinea holidays implementation, observed Eid al-Fitr cases are covered by the test_eid_al_fitr_day() method, which tests both regular holiday dates and the observed dates when the holiday falls on a non-working day (for years >= 2023).
Applied to files:
holidays/countries/tanzania.py
📚 Learning: 2025-08-19T20:39:52.024Z
Learnt from: KJhellico
PR: vacanza/holidays#2831
File: holidays/countries/south_sudan.py:84-88
Timestamp: 2025-08-19T20:39:52.024Z
Learning: In South Sudan holidays implementation, Eid al-Fitr and Eid al-Adha follow a specific two-day pattern: the first day of each Eid is a PUBLIC holiday (national holiday for everyone), while the second day is an ISLAMIC category holiday (Muslim-specific only). This should be implemented by keeping first day calls in _populate_public_holidays() and adding second day calls in _populate_islamic_holidays() method.
Applied to files:
holidays/countries/tanzania.py
📚 Learning: 2025-06-15T11:52:39.572Z
Learnt from: PPsyrius
PR: vacanza/holidays#2601
File: tests/countries/test_mongolia.py:128-156
Timestamp: 2025-06-15T11:52:39.572Z
Learning: In the vacanza/holidays project tests, when testing holidays that span multiple consecutive days across many years (like Mongolia's National Festival spanning July 11-13), prefer explicit for loops over complex nested generator expressions with unpacking. The explicit loops are more readable, easier to maintain, and better communicate the testing intent even though the Big O complexity is equivalent.
Applied to files:
holidays/countries/tanzania.py
📚 Learning: 2025-06-16T12:28:31.641Z
Learnt from: PPsyrius
PR: vacanza/holidays#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/tanzania.py
📚 Learning: 2025-04-13T20:41:56.613Z
Learnt from: KJhellico
PR: vacanza/holidays#2386
File: holidays/countries/nepal.py:266-284
Timestamp: 2025-04-13T20:41:56.613Z
Learning: The Islamic holiday dates in the holidays library should only include officially verified dates, not predicted ones, to maintain accuracy. This is especially important for holidays that depend on lunar observations like Eid al-Fitr and Eid al-Adha.
Applied to files:
holidays/countries/tanzania.py
📚 Learning: 2025-08-19T21:00:47.849Z
Learnt from: KJhellico
PR: vacanza/holidays#2831
File: holidays/countries/south_sudan.py:84-88
Timestamp: 2025-08-19T21:00:47.849Z
Learning: In the holidays library, Islamic holidays use dedicated methods for additional days (like `_add_eid_al_fitr_day_two`, `_add_eid_al_adha_day_two`) rather than parameters. The methods don't accept a `days` parameter - each day has its own specific method.
Applied to files:
holidays/countries/tanzania.py
📚 Learning: 2025-06-06T14:40:31.932Z
Learnt from: KJhellico
PR: vacanza/holidays#2593
File: holidays/countries/senegal.py:66-110
Timestamp: 2025-06-06T14:40:31.932Z
Learning: In the holidays library, within the _populate_public_holidays method, holidays should be arranged by calendar type (Islamic holidays first, then Gregorian holidays) without additional type grouping comments. The organization by calendar type is sufficient and follows the project's established conventions.
Applied to files:
holidays/countries/tanzania.py
📚 Learning: 2025-06-13T12:18:03.539Z
Learnt from: PPsyrius
PR: vacanza/holidays#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/tanzania.py
📚 Learning: 2025-07-10T15:55:34.523Z
Learnt from: KJhellico
PR: vacanza/holidays#2706
File: holidays/countries/cayman_islands.py:50-55
Timestamp: 2025-07-10T15:55:34.523Z
Learning: The `islamic_show_estimated` parameter in country class constructors is only needed for countries that implement Islamic holidays (inherit from IslamicHolidays or _CustomIslamicHolidays groups). Countries with only Christian and secular holidays do not need this parameter.
Applied to files:
holidays/countries/tanzania.py
📚 Learning: 2025-08-21T06:52:25.503Z
Learnt from: PPsyrius
PR: vacanza/holidays#2843
File: holidays/countries/burundi.py:140-155
Timestamp: 2025-08-21T06:52:25.503Z
Learning: In the holidays library Islamic calendar implementation, CONFIRMED_YEARS represents the full range of years that have been officially verified, while the individual EID_AL_FITR_DATES and EID_AL_ADHA_DATES dictionaries only contain entries for years where the official dates differ from the base Umm al-Qura algorithmic calculations. Years within CONFIRMED_YEARS but not in the explicit date dictionaries will use the base algorithm but be marked as "confirmed" rather than "estimated".
Applied to files:
holidays/countries/tanzania.py
📚 Learning: 2025-04-13T19:10:31.502Z
Learnt from: KJhellico
PR: vacanza/holidays#2465
File: holidays/countries/suriname.py:219-251
Timestamp: 2025-04-13T19:10:31.502Z
Learning: The `_CustomIslamicHolidays` classes in this project contain only exact verified holiday dates from reliable sources, rather than calculated or estimated future dates. This is by design to ensure accuracy, particularly for religious holidays that may follow lunar calendars or depend on local observations.
Applied to files:
holidays/countries/tanzania.py
🧬 Code graph analysis (1)
holidays/countries/tanzania.py (9)
holidays/calendars/gregorian.py (1)
_timedelta
(37-42)holidays/groups/christian.py (6)
ChristianHolidays
(23-499)_easter_sunday
(105-109)_add_good_friday
(344-353)_add_easter_monday
(275-284)_add_christmas_day
(224-232)_add_christmas_day_two
(234-242)holidays/groups/international.py (3)
InternationalHolidays
(20-236)_add_new_years_day
(142-150)_add_labor_day
(115-124)holidays/groups/islamic.py (6)
IslamicHolidays
(20-443)_add_eid_al_fitr_day
(152-163)_add_eid_al_fitr_day_two
(165-173)_add_eid_al_adha_day
(109-120)_add_eid_al_adha_day_two
(122-130)_add_mawlid_day
(329-339)holidays/groups/custom.py (1)
StaticHolidays
(18-47)holidays/observed_holiday_base.py (3)
ObservedHolidayBase
(102-246)_populate_observed
(208-219)_add_observed
(144-196)holidays/countries/trinidad_and_tobago.py (1)
_populate_observed
(85-92)holidays/countries/japan.py (1)
_populate_observed
(58-82)holidays/countries/taiwan.py (1)
_populate_observed
(90-114)
⏰ 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). (3)
- GitHub Check: Test build on windows-latest
- GitHub Check: Test build on macos-latest
- GitHub Check: Test build on ubuntu-latest
🔇 Additional comments (12)
holidays/countries/tanzania.py (12)
47-49
: Class mixin order and ObservedHolidayBase adoption look correct.ObservedHolidayBase first is important so its machinery (labels, _populate_observed dispatch) is available. Combining Christian/International/Islamic/Static groups here matches the project patterns.
110-111
: Start year lowered to 1965 – aligns with PR scope.This matches the extended historical coverage; tests should cover 1965 boundary.
113-126
: Constructor signature matches library convention.Using islamic_show_estimated kw-arg and wiring TanzaniaIslamicHolidays via cls is consistent with recent changes.
149-161
: Holy Saturday → Tuesday rule: good edge-case handling.Karume Day collision with Easter (2007, 2012) needs this; SAT_TO_NEXT_TUE avoids stepping on Easter Monday.
To lock this behavior, add/confirm tests asserting:
- 2007-04-07 (Holy Saturday) observed on 2007-04-10
- 2012-04-07 (Holy Saturday) observed on 2012-04-10
228-245
: Name transitions for July 7 and Aug 8: add/confirm tests for both eras.
- 1977–1993: “Sikukuu ya Wakulima”
- ≥1994: “Sabasaba” for July 7 and separate Aug 8 Peasants’ Day from 1995.
Recommend explicit tests covering 1976, 1977, 1994, 1995 to pin names/dates.
246-254
: Nyerere Day addition and observed handling – consistent with 2002+ law.Labeling and placement into observed candidate set look correct.
274-285
: Islamic days: two-day Eid handling and 1966 boundary for Adha Two are consistent.Comment about 1975 anomaly is neutral and fine. Good split: Eid al-Fitr two days always; Eid al-Adha day two only up to 1966.
289-291
: Observed application gated on self.observed – correct.Defer to the country-specific _populate_observed after collecting candidates.
426-435
: Swahili base string for Magufuli’s funeral corrected.“Mazishi ya John Pombe Magufuli” is the right form; thanks for fixing.
105-108
: Locale msgids and compiled files verified
- Confirmed
holidays/locale/sw/LC_MESSAGES/TZ.po
andholidays/locale/en_US/LC_MESSAGES/TZ.po
include
• msgid "Badala ya %s" (line 37)
• msgid "Badala ya %s (makisio)" (line 42)- Compiled
.mo
files exist underholidays/locale
, so translations are up to date.No further changes needed.
176-181
: Boundary checks confirmed for New Year’s Day & Boxing Day (Lines 176–181 & 262–267).
- TZ_COMMON.json snapshot shows “1966-01-01” New Year’s Day present and “1966-12-26” Boxing Day absent.
- Snapshot also shows “1993-12-26” Boxing Day present and “1992-12-26” Boxing Day absent.
✅ All observed-date boundaries behave as expected.
301-409
: Verify explicit overrides align with confirmed deviationsThe
CONFIRMED_YEARS=(2013, 2025)
tuple indicates that only years where the official (gazetted) dates diverge from the Umm al-Qura algorithm should be listed explicitly; all other years within 2013–2025 fall back to the base algorithm and are marked “confirmed.” Absence of 2024 in EID_AL_FITR (and the matching patterns in EID_AL_ADHA/MAWLID) is therefore intentional.File: holidays/countries/tanzania.py (lines 301–409)
Dict summaries within 2013–2025:
- EID_AL_FITR_DATES: 9 overrides (2014, 2015, 2016, 2017, 2019, 2021, 2022, 2023, 2025)
- EID_AL_ADHA_DATES: 10 overrides (2014, 2016, 2017, 2018, 2019, 2021, 2022, 2023, 2024, 2025)
- MAWLID_DATES: 10 overrides (2014, 2015, 2016, 2017, 2018, 2019, 2021, 2022, 2023, 2024)
Please confirm that each of these listed years truly deviates from the base calculation. If they do, the current implementation is correct and can be approved as-is.
Co-Authored-By: ~Jhellico <KJhellico@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! 👍
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Proposed change
Type of change
holidays
functionality in general)Checklist
make check
locally; all checks and tests passed.