Refactor Macau holidays: holiday categories standardization#2868
Refactor Macau holidays: holiday categories standardization#2868arkid15r merged 2 commits intovacanza:devfrom
Conversation
Summary by CodeRabbit
WalkthroughReclassifies Macau holidays by removing the MANDATORY constant, introducing an OPTIONAL category, updating Macau country logic and static holiday metadata, adjusting README and many locale translation files, and overhauling Macau tests to validate GOVERNMENT and OPTIONAL categories separately. Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Suggested labels
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 (1)
🧰 Additional context used🧠 Learnings (25)📓 Common learnings📚 Learning: 2025-03-04T11:41:56.389ZApplied to files:
📚 Learning: 2025-03-05T02:35:03.298ZApplied to files:
📚 Learning: 2025-03-13T15:17:45.519ZApplied to files:
📚 Learning: 2025-08-18T13:06:16.919ZApplied to files:
📚 Learning: 2025-08-28T02:42:52.725ZApplied to files:
📚 Learning: 2025-04-08T14:46:10.656ZApplied to files:
📚 Learning: 2025-05-04T10:29:46.780ZApplied to files:
📚 Learning: 2025-07-24T15:21:31.632ZApplied to files:
📚 Learning: 2025-04-02T18:38:35.164ZApplied to files:
📚 Learning: 2025-08-25T04:28:02.061ZApplied to files:
📚 Learning: 2025-04-05T04:29:38.042ZApplied to files:
📚 Learning: 2025-04-05T04:50:40.752ZApplied to files:
📚 Learning: 2025-05-06T21:07:11.577ZApplied to files:
📚 Learning: 2025-04-05T04:47:27.213ZApplied to files:
📚 Learning: 2025-04-05T04:33:53.254ZApplied to files:
📚 Learning: 2025-04-05T06:49:06.217ZApplied to files:
📚 Learning: 2025-07-09T21:16:35.145ZApplied to files:
📚 Learning: 2025-04-04T10:52:41.546ZApplied to files:
📚 Learning: 2025-07-02T18:17:53.342ZApplied to files:
📚 Learning: 2025-08-12T17:16:54.497ZApplied to files:
📚 Learning: 2025-03-04T10:06:09.555ZApplied to files:
📚 Learning: 2025-05-09T18:36:09.607ZApplied to files:
📚 Learning: 2025-04-04T10:52:41.546ZApplied to files:
📚 Learning: 2025-05-12T15:31:58.079ZApplied to files:
🧬 Code graph analysis (1)tests/countries/test_macau.py (1)
⏰ 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)
🔇 Additional comments (4)
✨ 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 #2868 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 292 292
Lines 17330 17329 -1
Branches 2259 2259
=========================================
- Hits 17330 17329 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (3)
holidays/locale/en_MO/LC_MESSAGES/MO.po (1)
98-101: Change “All Soul’s Day” → “All Souls’ Day” in English translations and update snapshots/tests
- Update msgstr in holidays/locale/en_MO/LC_MESSAGES/MO.po (line 100) and holidays/locale/en_US/LC_MESSAGES/MO.po (line 100)
- Replace occurrences in tests/countries/test_macau.py for the “2024-11-02” and “2024-11-04” entries
- Update all “All Soul’s Day” entries in snapshots/countries/MO_M.json, MO_I.json and MO_COMMON.json
- Rerun snapshot generation to reflect the corrected pluralization
holidays/locale/en_US/LC_MESSAGES/MO.po (1)
99-101: Update “All Soul’s Day” → “All Souls’ Day” across PO files, tests, and snapshots
- In
holidays/locale/en_US/LC_MESSAGES/MO.poandholidays/locale/en_MO/LC_MESSAGES/MO.po, change- msgstr "All Soul's Day" + msgstr "All Souls' Day"- In
tests/countries/test_macau.py(around lines 1245 & 1278), update- "All Soul's Day" - "Compensatory rest day for All Soul's Day" + "All Souls' Day" + "Compensatory rest day for All Souls' Day"- Regenerate or edit all
snapshots/countries/MO_*.jsonentries replacing"All Soul's Day"and"Compensatory rest day for All Soul's Day"with the new phrasing.tests/countries/test_macau.py (1)
36-67: Rename dt_mandatory to reflect new categorization.It’s now PUBLIC; rename for consistency.
Apply this diff:
- dt_mandatory = ( + dt_public_special = ( # https://www.dsal.gov.mo/en/text/holiday_table.html "2015-09-03" ) - self.assertHoliday(dt_mandatory) + self.assertHoliday(dt_public_special)Also applies to: 60-66
📜 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 (10)
README.md(1 hunks)holidays/constants.py(0 hunks)holidays/countries/macau.py(7 hunks)holidays/locale/en_MO/LC_MESSAGES/MO.po(2 hunks)holidays/locale/en_US/LC_MESSAGES/MO.po(2 hunks)holidays/locale/pt_MO/LC_MESSAGES/MO.po(2 hunks)holidays/locale/th/LC_MESSAGES/MO.po(2 hunks)holidays/locale/zh_CN/LC_MESSAGES/MO.po(2 hunks)holidays/locale/zh_MO/LC_MESSAGES/MO.po(2 hunks)tests/countries/test_macau.py(33 hunks)
💤 Files with no reviewable changes (1)
- holidays/constants.py
🧰 Additional context used
🧠 Learnings (54)
📓 Common learnings
Learnt from: PPsyrius
PR: vacanza/holidays#2323
File: holidays/countries/macau.py:284-366
Timestamp: 2025-03-04T11:41:56.389Z
Learning: For Macau holidays implementation, maintaining separate methods for each holiday category (PUBLIC, MANDATORY, GOVERNMENT) is preferred because these categories are based on different sets of laws and have distinct historical evolution.
Learnt from: PPsyrius
PR: vacanza/holidays#2323
File: holidays/countries/macau.py:278-377
Timestamp: 2025-03-05T02:35:03.298Z
Learning: For Macau holiday implementations, it's preferable to maintain separate methods for different holiday categories (MANDATORY, GOVERNMENT, PUBLIC) as they are based on different sets of laws, making the code easier to maintain despite having multiple year-based conditionals.
Learnt from: KJhellico
PR: vacanza/holidays#2783
File: tests/countries/test_eritrea.py:130-147
Timestamp: 2025-08-18T13:06:16.919Z
Learning: The `assertLocalizedHolidays` method in the vacanza/holidays project requires a complete list of all holidays from all categories (PUBLIC, GOVERNMENT, etc.), not just the holidays from the default category. This is a framework requirement for comprehensive localization testing.
Learnt from: PPsyrius
PR: vacanza/holidays#2323
File: holidays/locale/zh_CN/LC_MESSAGES/MO.po:230-234
Timestamp: 2025-03-04T14:38:15.029Z
Learning: For Macau holidays localization, official Macau government sources (e.g., gov.mo) should be the reference for correct terminology, even when it differs from mainland Chinese standards.
Learnt from: PPsyrius
PR: vacanza/holidays#2349
File: tests/countries/test_taiwan.py:0-0
Timestamp: 2025-03-13T15:17:45.519Z
Learning: For Taiwan's holiday system, different categories (GOVERNMENT, OPTIONAL, SCHOOL, WORKDAY) have distinct uses and contexts, justifying separate instances rather than parameterization in tests.
Learnt from: PPsyrius
PR: vacanza/holidays#2323
File: holidays/locale/zh_CN/LC_MESSAGES/MO.po:230-234
Timestamp: 2025-03-04T14:42:43.024Z
Learning: For Macau's Simplified Chinese (zh_CN) localization, the term "重迭" is used on the official government website (gov.mo) for "overlapping" holidays, rather than the mainland standard "重叠".
Learnt from: KJhellico
PR: vacanza/holidays#2851
File: docs/holiday_categories.md:272-282
Timestamp: 2025-08-26T14:43:53.605Z
Learning: In the holidays library documentation, it's strongly advisable to recommend the use of constants from holidays.constants (e.g., PUBLIC, CATHOLIC) instead of direct string values when specifying holiday categories, as constants provide better type safety, IDE support, and prevent typos.
Learnt from: PPsyrius
PR: vacanza/holidays#2323
File: holidays/locale/en_MO/LC_MESSAGES/MO.po:86-96
Timestamp: 2025-03-04T10:06:57.171Z
Learning: In Macau holiday localizations, having multiple Chinese variants (聖誕節前日, 聖誕節前夕, 聖誕前夕) for "Christmas Eve" is intentional design, as confirmed by the developer.
Learnt from: PPsyrius
PR: vacanza/holidays#2323
File: holidays/countries/macau.py:385-396
Timestamp: 2025-03-04T10:06:09.555Z
Learning: The winter solstice calculation in Macau's holiday implementation uses the same approximation method as Hong Kong's implementation and has been verified against the official Macau calendar for years 2017-2025. The method is valid for years 1952-2099.
📚 Learning: 2025-03-04T11:41:56.389Z
Learnt from: PPsyrius
PR: vacanza/holidays#2323
File: holidays/countries/macau.py:284-366
Timestamp: 2025-03-04T11:41:56.389Z
Learning: For Macau holidays implementation, maintaining separate methods for each holiday category (PUBLIC, MANDATORY, GOVERNMENT) is preferred because these categories are based on different sets of laws and have distinct historical evolution.
Applied to files:
README.mdholidays/countries/macau.pytests/countries/test_macau.py
📚 Learning: 2025-03-04T14:38:15.029Z
Learnt from: PPsyrius
PR: vacanza/holidays#2323
File: holidays/locale/zh_CN/LC_MESSAGES/MO.po:230-234
Timestamp: 2025-03-04T14:38:15.029Z
Learning: For Macau holidays localization, official Macau government sources (e.g., gov.mo) should be the reference for correct terminology, even when it differs from mainland Chinese standards.
Applied to files:
README.mdholidays/countries/macau.py
📚 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/MO.poholidays/locale/pt_MO/LC_MESSAGES/MO.poholidays/locale/en_MO/LC_MESSAGES/MO.poholidays/locale/zh_MO/LC_MESSAGES/MO.poholidays/locale/zh_CN/LC_MESSAGES/MO.poholidays/locale/th/LC_MESSAGES/MO.po
📚 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/MO.poholidays/locale/pt_MO/LC_MESSAGES/MO.poholidays/locale/en_MO/LC_MESSAGES/MO.poholidays/locale/zh_MO/LC_MESSAGES/MO.poholidays/locale/zh_CN/LC_MESSAGES/MO.po
📚 Learning: 2025-06-11T18:32:25.595Z
Learnt from: ankushhKapoor
PR: vacanza/holidays#2601
File: holidays/locale/en_MN/LC_MESSAGES/MN.po:13-14
Timestamp: 2025-06-11T18:32:25.595Z
Learning: For non-default locale `.po` files, the header comment format is:
`# <Country> holidays <locale> localization.` (no trailing hash).
Applied to files:
holidays/locale/en_US/LC_MESSAGES/MO.poholidays/locale/pt_MO/LC_MESSAGES/MO.poholidays/locale/en_MO/LC_MESSAGES/MO.poholidays/locale/zh_MO/LC_MESSAGES/MO.poholidays/locale/zh_CN/LC_MESSAGES/MO.poholidays/locale/th/LC_MESSAGES/MO.po
📚 Learning: 2025-06-10T12:17:58.880Z
Learnt from: KJhellico
PR: vacanza/holidays#2608
File: holidays/locale/en_VC/LC_MESSAGES/VC.po:1-14
Timestamp: 2025-06-10T12:17:58.880Z
Learning: In the holidays project, .po files should use the full multi-line header format including the project description, authors, website, and license information, rather than a single-line comment format.
Applied to files:
holidays/locale/en_US/LC_MESSAGES/MO.poholidays/locale/pt_MO/LC_MESSAGES/MO.poholidays/locale/en_MO/LC_MESSAGES/MO.poholidays/locale/zh_MO/LC_MESSAGES/MO.poholidays/locale/zh_CN/LC_MESSAGES/MO.poholidays/locale/th/LC_MESSAGES/MO.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/MO.poholidays/locale/pt_MO/LC_MESSAGES/MO.poholidays/locale/en_MO/LC_MESSAGES/MO.poholidays/locale/zh_MO/LC_MESSAGES/MO.poholidays/locale/zh_CN/LC_MESSAGES/MO.poholidays/locale/th/LC_MESSAGES/MO.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/MO.poholidays/locale/pt_MO/LC_MESSAGES/MO.poholidays/locale/en_MO/LC_MESSAGES/MO.poholidays/locale/zh_MO/LC_MESSAGES/MO.poholidays/locale/zh_CN/LC_MESSAGES/MO.poholidays/locale/th/LC_MESSAGES/MO.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/MO.poholidays/locale/pt_MO/LC_MESSAGES/MO.poholidays/locale/en_MO/LC_MESSAGES/MO.poholidays/locale/zh_MO/LC_MESSAGES/MO.poholidays/locale/zh_CN/LC_MESSAGES/MO.poholidays/locale/th/LC_MESSAGES/MO.po
📚 Learning: 2025-04-17T17:08:48.082Z
Learnt from: PPsyrius
PR: vacanza/holidays#2438
File: holidays/locale/ar_IQ/LC_MESSAGES/IQ.po:35-81
Timestamp: 2025-04-17T17:08:48.082Z
Learning: In holiday PO files, when the file represents the default language of an entity (e.g., ar_IQ for Iraq), no translations in `msgstr` are required as the `msgid` values are already in the target language.
Applied to files:
holidays/locale/en_US/LC_MESSAGES/MO.poholidays/locale/pt_MO/LC_MESSAGES/MO.poholidays/locale/en_MO/LC_MESSAGES/MO.poholidays/locale/zh_MO/LC_MESSAGES/MO.poholidays/locale/zh_CN/LC_MESSAGES/MO.poholidays/locale/th/LC_MESSAGES/MO.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/MO.poholidays/locale/pt_MO/LC_MESSAGES/MO.poholidays/locale/en_MO/LC_MESSAGES/MO.poholidays/locale/zh_MO/LC_MESSAGES/MO.poholidays/locale/zh_CN/LC_MESSAGES/MO.poholidays/locale/th/LC_MESSAGES/MO.po
📚 Learning: 2025-03-30T13:33:31.598Z
Learnt from: PPsyrius
PR: vacanza/holidays#2388
File: holidays/locale/fr/LC_MESSAGES/CI.po:28-101
Timestamp: 2025-03-30T13:33:31.598Z
Learning: In the holidays library, for localization files of the default language (like French for Ivory Coast in fr/LC_MESSAGES/CI.po), the best practice is to leave the message strings (msgstr) empty to avoid possible typos, since the message IDs (msgid) are already in the target language.
Applied to files:
holidays/locale/en_US/LC_MESSAGES/MO.poholidays/locale/pt_MO/LC_MESSAGES/MO.poholidays/locale/en_MO/LC_MESSAGES/MO.poholidays/locale/zh_MO/LC_MESSAGES/MO.poholidays/locale/zh_CN/LC_MESSAGES/MO.poholidays/locale/th/LC_MESSAGES/MO.po
📚 Learning: 2025-06-25T20:55:00.642Z
Learnt from: KJhellico
PR: vacanza/holidays#2651
File: holidays/locale/nl/LC_MESSAGES/BQ.po:29-95
Timestamp: 2025-06-25T20:55:00.642Z
Learning: In the holidays library, Dutch locale files (.po) with `X-Source-Language: nl` should have empty msgstr entries when the target language is also Dutch. The library uses fallback=True with gettext, which returns the original msgid when msgstr is empty. This is the correct pattern for native language files and does not cause blank holiday names.
Applied to files:
holidays/locale/en_US/LC_MESSAGES/MO.poholidays/locale/pt_MO/LC_MESSAGES/MO.poholidays/locale/en_MO/LC_MESSAGES/MO.poholidays/locale/zh_MO/LC_MESSAGES/MO.poholidays/locale/zh_CN/LC_MESSAGES/MO.poholidays/locale/th/LC_MESSAGES/MO.po
📚 Learning: 2025-03-31T19:37:57.691Z
Learnt from: KJhellico
PR: vacanza/holidays#2394
File: holidays/locale/pt_PT/LC_MESSAGES/CV.po:31-88
Timestamp: 2025-03-31T19:37:57.691Z
Learning: In the holidays library, when a locale file matches the country's default language (e.g., pt_PT for Cape Verde), the msgstr fields should be left empty. Only non-default language files should have filled msgstr fields with translations.
Applied to files:
holidays/locale/pt_MO/LC_MESSAGES/MO.po
📚 Learning: 2025-03-31T19:37:57.691Z
Learnt from: KJhellico
PR: vacanza/holidays#2394
File: holidays/locale/pt_PT/LC_MESSAGES/CV.po:31-88
Timestamp: 2025-03-31T19:37:57.691Z
Learning: In the holidays library localization pattern, when a locale file matches a country's default language (e.g., pt_PT for Cape Verde), the msgstr fields should be left empty. Only non-default language locale files should have translations in the msgstr fields.
Applied to files:
holidays/locale/pt_MO/LC_MESSAGES/MO.po
📚 Learning: 2025-03-04T10:06:57.171Z
Learnt from: PPsyrius
PR: vacanza/holidays#2323
File: holidays/locale/en_MO/LC_MESSAGES/MO.po:86-96
Timestamp: 2025-03-04T10:06:57.171Z
Learning: In Macau holiday localizations, having multiple Chinese variants (聖誕節前日, 聖誕節前夕, 聖誕前夕) for "Christmas Eve" is intentional design, as confirmed by the developer.
Applied to files:
holidays/locale/pt_MO/LC_MESSAGES/MO.po
📚 Learning: 2025-03-05T02:35:03.298Z
Learnt from: PPsyrius
PR: vacanza/holidays#2323
File: holidays/countries/macau.py:278-377
Timestamp: 2025-03-05T02:35:03.298Z
Learning: For Macau holiday implementations, it's preferable to maintain separate methods for different holiday categories (MANDATORY, GOVERNMENT, PUBLIC) as they are based on different sets of laws, making the code easier to maintain despite having multiple year-based conditionals.
Applied to files:
holidays/countries/macau.pytests/countries/test_macau.py
📚 Learning: 2025-08-21T04:51:16.449Z
Learnt from: PPsyrius
PR: vacanza/holidays#2843
File: holidays/countries/burundi.py:13-13
Timestamp: 2025-08-21T04:51:16.449Z
Learning: In the holidays library, country classes with localization support consistently use `from gettext import gettext as tr` import and wrap class-level attributes like `estimated_label`, `observed_label`, and `observed_estimated_label` with `tr()` calls. This is the standard library-wide practice for l10n-enabled entities and is required for proper string extraction when generating .po files.
Applied to files:
holidays/countries/macau.py
📚 Learning: 2025-08-21T05:56:33.276Z
Learnt from: PPsyrius
PR: vacanza/holidays#2843
File: holidays/countries/burundi.py:15-16
Timestamp: 2025-08-21T05:56:33.276Z
Learning: In the holidays library, when importing Gregorian month constants from holidays.calendars.gregorian, only import the months that are actually used in the date data. For example, if Islamic holiday dates only reference JUN, JUL, SEP, OCT, then only import those specific constants rather than importing additional unused months.
Applied to files:
holidays/countries/macau.py
📚 Learning: 2025-08-21T04:56:03.780Z
Learnt from: PPsyrius
PR: vacanza/holidays#2843
File: holidays/countries/burundi.py:63-101
Timestamp: 2025-08-21T04:56:03.780Z
Learning: In the holidays library, countries with localization support consistently use tr() wrappers around holiday names when calling _add_* methods (e.g., self._add_new_years_day(tr("Holiday Name"))). This is the established pattern across United States, Thailand, and other l10n-enabled countries, contrary to any suggestion that translation is handled internally by _add_* methods.
Applied to files:
holidays/countries/macau.py
📚 Learning: 2025-04-03T16:58:27.175Z
Learnt from: Wasif-Shahzad
PR: vacanza/holidays#2409
File: holidays/countries/qatar.py:27-46
Timestamp: 2025-04-03T16:58:27.175Z
Learning: In the holidays library, method names like `_add_holiday_2nd_tue_of_feb()` and `_add_holiday_1st_sun_of_mar()` use calendar constants like FEB, TUE, MAR, and SUN internally through parent class implementations even when these constants don't appear directly in the file.
Applied to files:
holidays/countries/macau.py
📚 Learning: 2025-03-04T11:32:45.095Z
Learnt from: PPsyrius
PR: vacanza/holidays#2323
File: holidays/countries/macau.py:407-461
Timestamp: 2025-03-04T11:32:45.095Z
Learning: In the holidays library, the standard approach for organizing static holidays is to use separate dictionaries for different categories (`government`, `mandatory`, and `public`), which are utilized by syntactic sugar methods.
Applied to files:
holidays/countries/macau.py
📚 Learning: 2025-08-26T21:24:41.827Z
Learnt from: KJhellico
PR: vacanza/holidays#2860
File: holidays/countries/burkina_faso.py:27-30
Timestamp: 2025-08-26T21:24:41.827Z
Learning: Countries in the holidays library that don't have localization support yet should use plain English strings for labels (e.g., `estimated_label = "%s (estimated)"`), while only countries with existing .po translation files should use `tr()` wrapping. Check for the presence of .po files in holidays/locale to determine if a country has localization support.
Applied to files:
holidays/countries/macau.py
📚 Learning: 2025-08-21T04:56:03.780Z
Learnt from: PPsyrius
PR: vacanza/holidays#2843
File: holidays/countries/burundi.py:63-101
Timestamp: 2025-08-21T04:56:03.780Z
Learning: In the holidays library, countries with localization support DO use tr() wrappers around holiday names when calling _add_* methods. This is the correct pattern for l10n-enabled country implementations, contrary to previous learning about translation being handled internally by _add_* methods.
Applied to files:
holidays/countries/macau.py
📚 Learning: 2025-03-04T11:32:45.095Z
Learnt from: PPsyrius
PR: vacanza/holidays#2323
File: holidays/countries/macau.py:407-461
Timestamp: 2025-03-04T11:32:45.095Z
Learning: In the holidays library, the standard approach for organizing static holidays is to use separate dictionaries for different categories (like `special_government_holidays`, `special_mandatory_holidays`, and `special_public_holidays`), which are utilized by syntactic sugar methods to pick up the appropriate holidays based on the selected category.
Applied to files:
holidays/countries/macau.py
📚 Learning: 2025-06-16T14:08:09.492Z
Learnt from: KJhellico
PR: vacanza/holidays#2635
File: holidays/countries/bhutan.py:13-16
Timestamp: 2025-06-16T14:08:09.492Z
Learning: In the holidays library, translation is performed in the `_add_holiday` methods, not at the string level. Holiday strings passed to `_add_holiday_*` methods are processed through the translation machinery within those methods, so using `tr()` or `self.tr()` wrappers is unnecessary.
Applied to files:
holidays/countries/macau.py
📚 Learning: 2025-06-18T10:26:50.180Z
Learnt from: PPsyrius
PR: vacanza/holidays#2642
File: holidays/countries/france.py:178-180
Timestamp: 2025-06-18T10:26:50.180Z
Learning: In the France holidays implementation, the _populate_subdiv_57_public_holidays() (Moselle) and _populate_subdiv_6ae_public_holidays() (Alsace) methods are functionally identical, both adding Good Friday (≥1893) and Saint Stephen's Day (≥1892) with the same legal references from August 16th, 1892. Therefore, for the deprecated "Alsace-Moselle" subdivision, calling either method produces the same result.
Applied to files:
holidays/countries/macau.py
📚 Learning: 2025-06-18T10:07:58.780Z
Learnt from: PPsyrius
PR: vacanza/holidays#2642
File: holidays/countries/french_southern_territories.py:41-44
Timestamp: 2025-06-18T10:07:58.780Z
Learning: Territorial holiday classes that inherit from parent countries (like HolidaysAX from Finland, HolidaysSJ from Norway, HolidaysTF from France) follow a standard pattern of silently overriding self.subdiv in their _populate_public_holidays() method without validation, as this ensures they always use the correct subdivision code for their territory regardless of user input.
Applied to files:
holidays/countries/macau.py
📚 Learning: 2025-04-25T20:27:59.086Z
Learnt from: KJhellico
PR: vacanza/holidays#2402
File: holidays/countries/trinidad_and_tobago.py:85-92
Timestamp: 2025-04-25T20:27:59.086Z
Learning: The `_populate_observed` method in holiday classes should maintain the same signature as the parent class `ObservedHolidayBase`, even if specific child class implementations don't use all parameters.
Applied to files:
holidays/countries/macau.py
📚 Learning: 2025-06-18T10:58:28.058Z
Learnt from: PPsyrius
PR: vacanza/holidays#2642
File: holidays/countries/france.py:184-206
Timestamp: 2025-06-18T10:58:28.058Z
Learning: In the holidays library France implementation, creating shared private methods between subdivision-specific holiday population methods (like _populate_subdiv_57_public_holidays and _populate_subdiv_6ae_public_holidays) is not supported by the current framework architecture, so duplicate code between functionally identical subdivision methods should be left as-is.
Applied to files:
holidays/countries/macau.py
📚 Learning: 2025-03-30T20:18:46.006Z
Learnt from: KJhellico
PR: vacanza/holidays#2386
File: holidays/countries/nepal.py:24-26
Timestamp: 2025-03-30T20:18:46.006Z
Learning: In the holidays library, country classes do not directly implement `_populate()`. Instead, they implement specialized methods like `_populate_public_holidays()`, and the base class `HolidayBase` handles the orchestration by calling these specialized methods.
Applied to files:
holidays/countries/macau.py
📚 Learning: 2025-06-14T11:04:31.180Z
Learnt from: PPsyrius
PR: vacanza/holidays#2609
File: holidays/countries/nauru.py:57-60
Timestamp: 2025-06-14T11:04:31.180Z
Learning: In the holidays library, the base `HolidayBase._populate()` method already includes a guard clause that prevents holiday population methods like `_populate_public_holidays()` from being called when the year is before `start_year` or after `end_year`. Therefore, individual country implementations do not need to add their own guard clauses for years before independence or other start dates.
Applied to files:
holidays/countries/macau.py
📚 Learning: 2025-06-18T10:18:59.447Z
Learnt from: PPsyrius
PR: vacanza/holidays#2642
File: holidays/countries/france.py:178-182
Timestamp: 2025-06-18T10:18:59.447Z
Learning: In the France holidays implementation, deprecated subdivision names like "Alsace-Moselle" and "Saint-Barthélémy" are handled through explicit conditionals in _populate_public_holidays() that map them to their corresponding new subdivision-specific holiday population methods, providing backward compatibility while users transition to the new ISO codes.
Applied to files:
holidays/countries/macau.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/macau.py
📚 Learning: 2025-08-12T03:21:09.116Z
Learnt from: mbfarah
PR: vacanza/holidays#2798
File: holidays/countries/chile.py:278-281
Timestamp: 2025-08-12T03:21:09.116Z
Learning: In Chile holidays implementation, the general rule for September 17 (years >= 2007) uses MON_ONLY for years 2007-2016, meaning it only adds the holiday when September 17 falls on a Monday. For years when September 17 falls on other days and was declared a one-off holiday by specific laws, it must be added to the special_public_holidays dictionary.
Applied to files:
holidays/countries/macau.py
📚 Learning: 2025-08-28T02:42:52.725Z
Learnt from: PPsyrius
PR: vacanza/holidays#2863
File: tests/countries/test_georgia.py:31-36
Timestamp: 2025-08-28T02:42:52.725Z
Learning: In the holidays framework, when no categories parameter is specified in a country class instantiation (e.g., `Georgia(years=2025)`), the PUBLIC category is used by default. There's no need to explicitly specify `categories=PUBLIC` or import the PUBLIC constant for such test cases.
Applied to files:
tests/countries/test_macau.py
📚 Learning: 2025-03-13T15:17:45.519Z
Learnt from: PPsyrius
PR: vacanza/holidays#2349
File: tests/countries/test_taiwan.py:0-0
Timestamp: 2025-03-13T15:17:45.519Z
Learning: For Taiwan's holiday system, different categories (GOVERNMENT, OPTIONAL, SCHOOL, WORKDAY) have distinct uses and contexts, justifying separate instances rather than parameterization in tests.
Applied to files:
tests/countries/test_macau.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_macau.py
📚 Learning: 2025-08-18T13:06:16.919Z
Learnt from: KJhellico
PR: vacanza/holidays#2783
File: tests/countries/test_eritrea.py:130-147
Timestamp: 2025-08-18T13:06:16.919Z
Learning: The `assertLocalizedHolidays` method in the vacanza/holidays project requires a complete list of all holidays from all categories (PUBLIC, GOVERNMENT, etc.), not just the holidays from the default category. This is a framework requirement for comprehensive localization testing.
Applied to files:
tests/countries/test_macau.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_macau.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_macau.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_macau.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_macau.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_macau.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_macau.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_macau.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_macau.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_macau.py
📚 Learning: 2025-03-04T10:06:09.555Z
Learnt from: PPsyrius
PR: vacanza/holidays#2323
File: holidays/countries/macau.py:385-396
Timestamp: 2025-03-04T10:06:09.555Z
Learning: The winter solstice calculation in Macau's holiday implementation uses the same approximation method as Hong Kong's implementation and has been verified against the official Macau calendar for years 2017-2025. The method is valid for years 1952-2099.
Applied to files:
tests/countries/test_macau.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_macau.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_macau.py
📚 Learning: 2025-05-12T15:31:58.079Z
Learnt from: KJhellico
PR: vacanza/holidays#2532
File: tests/countries/test_cocos_islands.py:78-89
Timestamp: 2025-05-12T15:31:58.079Z
Learning: In the holidays project, tests for movable holidays (like Easter Monday) should always use static date sets only, not calculation functions.
Applied to files:
tests/countries/test_macau.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_macau.py
🧬 Code graph analysis (2)
holidays/countries/macau.py (4)
holidays/groups/international.py (2)
_add_new_years_day(142-150)_add_labor_day(115-124)holidays/groups/chinese.py (7)
_add_chinese_new_years_day(146-156)_add_chinese_new_years_day_two(158-166)_add_chinese_new_years_day_three(168-176)_add_double_ninth_festival(219-229)_add_qingming_festival(209-217)_add_mid_autumn_festival(255-265)_add_mid_autumn_festival_day_two(267-277)holidays/countries/canada.py (1)
_populate_optional_holidays(167-178)holidays/countries/hongkong.py (1)
_populate_optional_holidays(228-371)
tests/countries/test_macau.py (2)
holidays/countries/macau.py (2)
Macau(30-398)MO(401-402)tests/common.py (6)
TestCase(29-339)assertNoHolidays(293-295)assertHoliday(151-153)assertHolidayName(196-200)assertNoHolidayName(274-276)assertHolidays(229-231)
⏰ 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 (29)
README.md (1)
1029-1029: No remaining MANDATORY references. README.md now correctly lists GOVERNMENT, OPTIONAL.holidays/locale/zh_MO/LC_MESSAGES/MO.po (2)
17-29: Header bump to Holidays 0.80 and metadata — OK.Default locale file; empty msgstr is correct per project conventions.
46-77: New/relocated entries for Optional/Public set — OK.Entries align with Macau’s OPTIONAL/Public reshuffle; no translation needed in default zh_MO.
holidays/locale/pt_MO/LC_MESSAGES/MO.po (2)
17-29: Header metadata update — OK.
46-77: Added/relocated translations (Labour Day, Double Ninth, PRC National Day, etc.) — OK.Wording matches prior pt_MO style and Macau usage.
Also applies to: 62-77, 66-77, 70-77, 74-77
holidays/locale/en_MO/LC_MESSAGES/MO.po (2)
17-29: Header metadata update — OK.
46-77: Added/relocated holiday translations — OK.British English spellings and Macau romanizations look consistent.
Also applies to: 62-77, 66-77, 70-77, 74-77
holidays/locale/en_US/LC_MESSAGES/MO.po (2)
17-29: Header metadata update — OK.
46-77: Added/relocated holiday translations — OK.US English spellings consistent.
Also applies to: 62-77, 66-77, 70-77, 74-77
holidays/locale/zh_CN/LC_MESSAGES/MO.po (2)
17-17: Header bump is fine.Project-Id-Version updated to 0.80 matches the PR’s scope.
46-77: New zh_CN translations align with Macau terminology (incl. “重迭”).Simplified forms and wording look correct for: 劳动节、重阳节、中华人民共和国国庆日、葡国日…、中秋节/翌日、澳门特别行政区成立纪念日.
tests/countries/test_macau.py (8)
23-26: Good fixture split by category.Separate GOVERNMENT and OPTIONAL instances with appropriate year ranges improves clarity and coverage.
71-87: Observed-name assertions for GOVERNMENT look correct.Year-specific label switches (後首個工作日 → 的補假) match implementation.
280-289: PUBLIC 2000+ SAR Day assertions LGTM.Pre-2000 negative checks are appropriate.
305-337: Winter Solstice coverage is thorough.Covers 2000 exception and movable logic post-2001.
1192-1223: l10n 2024 (default) set is comprehensive.Includes PUBLIC, OPTIONAL, and GOVERNMENT (incl. observed) per framework expectations.
15-15: Global test refactor matches the category swap.Imports, names, and per-year assertions track the OPTIONAL/PUBLIC split cleanly.
Also applies to: 943-957, 959-1190
1-1: Sanity check passed: no lingering “MANDATORY” references remain.
899-905: Broaden years to match assertions (optional).Fixtures end at 2022 but assertions span up to 2050. Expand years for symmetry.
Apply this diff:
- m_optional_holidays = Macau(categories=OPTIONAL, subdiv="M", years=range(1982, 2023)) + m_optional_holidays = Macau(categories=OPTIONAL, subdiv="M", years=range(1982, 2050))- i_optional_holidays = Macau(categories=OPTIONAL, subdiv="I", years=range(1982, 2023)) + i_optional_holidays = Macau(categories=OPTIONAL, subdiv="I", years=range(1982, 2050))Also applies to: 911-919
⛔ Skipped due to learnings
Learnt from: PPsyrius PR: vacanza/holidays#2323 File: holidays/countries/macau.py:278-377 Timestamp: 2025-03-05T02:35:03.298Z Learning: For Macau holiday implementations, it's preferable to maintain separate methods for different holiday categories (MANDATORY, GOVERNMENT, PUBLIC) as they are based on different sets of laws, making the code easier to maintain despite having multiple year-based conditionals.Learnt from: KJhellico PR: vacanza/holidays#2829 File: tests/countries/test_canada.py:291-296 Timestamp: 2025-08-19T19:47:21.735Z Learning: In the holidays library, HolidayBase objects automatically populate years on-demand when expand=True (the default). When checking dates from years not initially in the years range, those years are automatically populated via the logic at line 646 in holiday_base.py: "if self.expand and dt.year not in self.years:". This means tests can check dates outside the initial year range without needing separate holiday instances.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: 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#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: PPsyrius PR: vacanza/holidays#2323 File: holidays/countries/macau.py:284-366 Timestamp: 2025-03-04T11:41:56.389Z Learning: For Macau holidays implementation, maintaining separate methods for each holiday category (PUBLIC, MANDATORY, GOVERNMENT) is preferred because these categories are based on different sets of laws and have distinct historical evolution.Learnt from: PPsyrius 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: 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.holidays/countries/macau.py (8)
80-81: supported_categories updated correctly.(GOVERNMENT, OPTIONAL, PUBLIC) aligns with the new model.
93-148: PUBLIC now implements statutory (ex-MANDATORY) set—looks right.Guard for ≤1984, Qingming ≥1989, and 2000 transitions (Mid-Autumn → following day, SAR Day) all match references.
149-282: General (OPTIONAL) holiday population mirrors HK pattern cleanly.Name switches by year and Dongzhi rules are consistent and localized via tr().
283-381: GOVERNMENT holidays + observed logic LGTM.Observed rule switch (SUN→SAT_SUN from 2012) and label selection per year are correctly handled.
383-399: Subdivision OPTIONAL methods are accurate.Ilhas NOV30→JUL13 move and Macau City Day ≤1999 are as expected.
462-482: Confirm dual inclusion of 2015-09-03 is intentional.It exists in both special_public_holidays and special_optional_holidays (tests cover both). If that’s by design, no change needed.
412-417: Nit: align static-holiday headings with dict names.“Mandatory” → “Public (Statutory)” for consistency with special_public_holidays.
Apply this diff:
- Special Mandatory (Statutory) Holidays: + Special Public (Statutory) Holidays:⛔ Skipped due to learnings
Learnt from: PPsyrius PR: vacanza/holidays#2323 File: holidays/countries/macau.py:407-461 Timestamp: 2025-03-04T11:32:45.095Z Learning: In the holidays library, the standard approach for organizing static holidays is to use separate dictionaries for different categories (`government`, `mandatory`, and `public`), which are utilized by syntactic sugar methods.Learnt from: PPsyrius PR: vacanza/holidays#2323 File: holidays/countries/macau.py:407-461 Timestamp: 2025-03-04T11:32:45.095Z Learning: In the holidays library, the standard approach for organizing static holidays is to use separate dictionaries for different categories (like `special_government_holidays`, `special_mandatory_holidays`, and `special_public_holidays`), which are utilized by syntactic sugar methods to pick up the appropriate holidays based on the selected category.Learnt from: PPsyrius PR: vacanza/holidays#2323 File: holidays/countries/macau.py:407-461 Timestamp: 2025-03-04T11:32:45.095Z Learning: In the holidays library, the standard approach for organizing static holidays is to use separate dictionaries for different categories (like `special_government_holidays`, `special_mandatory_holidays`, and `special_public_holidays`), which are utilized by syntactic sugar methods to pick up the appropriate holidays based on the selected category.Learnt from: 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.Learnt from: KJhellico PR: vacanza/holidays#2851 File: docs/holiday_categories.md:272-282 Timestamp: 2025-08-26T14:43:53.605Z Learning: In the holidays library documentation, it's strongly advisable to recommend the use of constants from holidays.constants (e.g., PUBLIC, CATHOLIC) instead of direct string values when specifying holiday categories, as constants provide better type safety, IDE support, and prevent typos.Learnt from: PPsyrius PR: vacanza/holidays#2706 File: holidays/countries/cayman_islands.py:80-97 Timestamp: 2025-07-10T03:36:16.461Z Learning: In the holidays library, date dictionaries that map years to specific dates (like queens_birthday_dates, special holiday dates, etc.) are typically defined within the _populate_public_holidays method rather than as module-level constants. This is the established library-wide pattern and should be maintained for consistency.Learnt from: PPsyrius PR: vacanza/holidays#2323 File: holidays/locale/zh_CN/LC_MESSAGES/MO.po:230-234 Timestamp: 2025-03-04T14:38:15.029Z Learning: For Macau holidays localization, official Macau government sources (e.g., gov.mo) should be the reference for correct terminology, even when it differs from mainland Chinese standards.Learnt from: PPsyrius PR: vacanza/holidays#2323 File: holidays/countries/macau.py:284-366 Timestamp: 2025-03-04T11:41:56.389Z Learning: For Macau holidays implementation, maintaining separate methods for each holiday category (PUBLIC, MANDATORY, GOVERNMENT) is preferred because these categories are based on different sets of laws and have distinct historical evolution.Learnt from: PPsyrius PR: vacanza/holidays#2323 File: holidays/countries/macau.py:278-377 Timestamp: 2025-03-05T02:35:03.298Z Learning: For Macau holiday implementations, it's preferable to maintain separate methods for different holiday categories (MANDATORY, GOVERNMENT, PUBLIC) as they are based on different sets of laws, making the code easier to maintain despite having multiple year-based conditionals.Learnt from: PPsyrius PR: vacanza/holidays#2323 File: holidays/locale/zh_CN/LC_MESSAGES/MO.po:230-234 Timestamp: 2025-03-04T14:42:43.024Z Learning: For Macau's Simplified Chinese (zh_CN) localization, the term "重迭" is used on the official government website (gov.mo) for "overlapping" holidays, rather than the mainland standard "重叠".Learnt from: PPsyrius PR: vacanza/holidays#2323 File: holidays/countries/macau.py:385-396 Timestamp: 2025-03-04T10:06:09.555Z Learning: The winter solstice calculation in Macau's holiday implementation uses the same approximation method as Hong Kong's implementation and has been verified against the official Macau calendar for years 2017-2025. The method is valid for years 1952-2099.
94-102: Nit: update docstring to reflect category name.Use “Public (Statutory)” to match the new category nomenclature.
Apply this diff:
- """Macau Mandatory (Statutory) Holidays. + """Macau Public (Statutory) Holidays.⛔ Skipped due to learnings
Learnt from: PPsyrius PR: vacanza/holidays#2323 File: holidays/countries/macau.py:284-366 Timestamp: 2025-03-04T11:41:56.389Z Learning: For Macau holidays implementation, maintaining separate methods for each holiday category (PUBLIC, MANDATORY, GOVERNMENT) is preferred because these categories are based on different sets of laws and have distinct historical evolution.Learnt from: PPsyrius PR: vacanza/holidays#2323 File: holidays/countries/macau.py:278-377 Timestamp: 2025-03-05T02:35:03.298Z Learning: For Macau holiday implementations, it's preferable to maintain separate methods for different holiday categories (MANDATORY, GOVERNMENT, PUBLIC) as they are based on different sets of laws, making the code easier to maintain despite having multiple year-based conditionals.Learnt from: KJhellico PR: vacanza/holidays#2851 File: docs/holiday_categories.md:272-282 Timestamp: 2025-08-26T14:43:53.605Z Learning: In the holidays library documentation, it's strongly advisable to recommend the use of constants from holidays.constants (e.g., PUBLIC, CATHOLIC) instead of direct string values when specifying holiday categories, as constants provide better type safety, IDE support, and prevent typos.Learnt from: KJhellico PR: vacanza/holidays#2437 File: holidays/countries/bhutan.py:27-30 Timestamp: 2025-04-08T14:46:10.656Z Learning: For country classes in the holidays library, there's no need to explicitly specify `supported_categories = (PUBLIC,)` when PUBLIC is the only category being used, as it's already the default category inherited from HolidayBase.Learnt from: KJhellico PR: vacanza/holidays#2525 File: holidays/countries/togo.py:0-0 Timestamp: 2025-05-04T10:29:46.780Z Learning: When a country class in the holidays library uses additional categories beyond PUBLIC, the `supported_categories` tuple should contain all categories, including PUBLIC. Only when PUBLIC is the only category being used should it be omitted from `supported_categories`.Learnt from: PPsyrius PR: vacanza/holidays#2863 File: tests/countries/test_georgia.py:31-36 Timestamp: 2025-08-28T02:42:52.725Z Learning: In the holidays framework, when no categories parameter is specified in a country class instantiation (e.g., `Georgia(years=2025)`), the PUBLIC category is used by default. There's no need to explicitly specify `categories=PUBLIC` or import the PUBLIC constant for such test cases.holidays/locale/th/LC_MESSAGES/MO.po (2)
17-17: Header bump acknowledged.Project-Id-Version → 0.80 matches repo-wide updates.
46-77: New Thai translations look good.Labor Day, Double Ninth, PRC National Day, Portugal Day, Mid-Autumn/翌日, and SAR Day read naturally.
|



Proposed change
This issue was raised in #2851 .
Macau's Mandatory (Statutory) Holidays have been changed from the custom
MANDATORYcategory toPUBLIC, whereas its General Holidays list has been moved toOPTIONALcategory - as done in Hong Kong's implementation.Type of change
holidaysfunctionality in general)Checklist
make checklocally; all checks and tests passed.