-
-
Notifications
You must be signed in to change notification settings - Fork 543
Update Argentina holidays: add categories and subdivisions support #2375
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
WalkthroughThis pull request updates the holiday documentation and logic for Argentina. The README now provides detailed province subdivisions and supported holiday categories. A new holiday constant ( Changes
Possibly related PRs
✨ Finishing Touches
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:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev #2375 +/- ##
==========================================
Coverage 100.00% 100.00%
==========================================
Files 204 204
Lines 12853 12999 +146
Branches 1817 1861 +44
==========================================
+ Hits 12853 12999 +146 ☔ 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: 10
🔭 Outside diff range comments (3)
snapshots/countries/AR_C.json (1)
2010-2010
:⚠️ Potential issueExtraneous Content Detected After the JSON Object
There appears to be an extra line (showing “2010”) after the closing brace. This extraneous text will cause JSON parsing errors. Please remove this line so that the file remains valid JSON.
snapshots/countries/AR_B.json (1)
2009-2010
:⚠️ Potential issueCritical: Remove Extraneous Trailing Content
The closing brace (line 2009) correctly terminates the JSON object; however, the extra line containing "2010" after it makes the file invalid as JSON. Please remove this stray content.
-2010
snapshots/countries/AR_H.json (1)
2009-2010
:⚠️ Potential issueRemove Extraneous Content After JSON Object:
There is an extra token (2010
) following the closing brace of the JSON object. This additional content is likely unintended and could cause JSON parsing errors. Please remove or clarify its purpose so that the file remains valid JSON.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (14)
README.md
(1 hunks)holidays/constants.py
(1 hunks)holidays/countries/argentina.py
(6 hunks)holidays/locale/en_US/LC_MESSAGES/AR.po
(5 hunks)holidays/locale/es/LC_MESSAGES/AR.po
(4 hunks)holidays/locale/uk/LC_MESSAGES/AR.po
(5 hunks)snapshots/countries/AR_B.json
(1 hunks)snapshots/countries/AR_C.json
(1 hunks)snapshots/countries/AR_D.json
(1 hunks)snapshots/countries/AR_G.json
(1 hunks)snapshots/countries/AR_H.json
(1 hunks)snapshots/countries/AR_J.json
(1 hunks)snapshots/countries/AR_K.json
(1 hunks)snapshots/countries/AR_L.json
(1 hunks)
🧰 Additional context used
🧬 Code Definitions (1)
holidays/countries/argentina.py (7)
holidays/countries/philippines.py (1)
_populate_public_holidays
(81-179)holidays/countries/united_states.py (1)
_populate_public_holidays
(225-230)holidays/countries/turkey.py (1)
_populate_public_holidays
(55-107)holidays/countries/cambodia.py (1)
_populate_public_holidays
(55-278)holidays/countries/chile.py (1)
_populate_public_holidays
(93-202)holidays/countries/israel.py (1)
_populate_public_holidays
(57-85)holidays/countries/angola.py (1)
_populate_public_holidays
(73-172)
🪛 markdownlint-cli2 (0.17.2)
README.md
224-224: Inline HTML
Element: td
(MD033, no-inline-html)
225-225: Inline HTML
Element: td
(MD033, no-inline-html)
225-225: Inline HTML
Element: strong
(MD033, no-inline-html)
226-226: Inline HTML
Element: td
(MD033, no-inline-html)
🔇 Additional comments (30)
holidays/constants.py (1)
42-42
: Clean addition of ARMENIAN category constant.The new holiday category constant
ARMENIAN = "armenian"
is properly placed in alphabetical order among the other holiday category constants, maintaining the existing code structure and conventions.snapshots/countries/AR_K.json (1)
1-2168
: Well-structured comprehensive holiday dataset for Argentina.This new JSON file provides an extensive collection of Argentina's holidays from 1957 to 2050, reflecting the enhanced support for categories and subdivisions mentioned in the PR objectives. The file contains:
- National holidays (Independence Day, Labor Day, etc.)
- Religious observances from multiple traditions:
- Christian (Christmas, Easter, Epiphany)
- Islamic (Eid al-Fitr, Eid al-Adha, Islamic New Year)
- Jewish (Rosh Hashanah, Yom Kippur, Pesach)
- Historical commemorations
- Special observances (National Census days, etc.)
The proper notation of Islamic holidays as "estimated" reflects their variable nature due to lunar calendar calculations. The JSON structure is consistent and well-formed throughout.
snapshots/countries/AR_L.json (1)
1-2009
:❓ Verification inconclusive
Overall JSON Structure and Format
The file defines an extensive JSON mapping of dates to holiday descriptions covering 1957 to 2050. The structure is consistent and appears to follow a standard key–value format, which should facilitate retrieval and scheduling.However, please verify that the file does not include any extraneous content outside the JSON object. For example, the very last line shows a stray value (e.g. "2010") after the closing brace, which would render the file invalid in strict JSON parsers. Removing or addressing such residues is essential.
Tags:
Please Verify No Extra Content Remains in AR_L.json
The JSON mapping looks consistently structured and thorough. It appears that the file’s body is valid JSON; however, please manually confirm that there isn’t any stray content (for example, an unexpected "2010" or any other residue) after the closing brace. This verification is key because even a single extra character can break strict JSON parsers.
- Double-check that the file ends exactly at the final brace.
- Remove any extraneous lines or content outside the JSON object if found.
snapshots/countries/AR_J.json (2)
1-2041
: Overall JSON Structure and Data QualityThe JSON object containing holiday dates and descriptions looks very comprehensive and well formatted. The keys are in the proper "YYYY-MM-DD" format and the values are clear, including useful details like “(estimated)” where applicable. This addition aligns nicely with the objective of updating Argentina holidays with enriched data.
A couple of suggestions:
- Ensure that the holiday data is consistent with any upstream documentation or expected formats for categories/subdivisions if those are prompted as part of this update.
- Given the file’s large size, you might want to consider if there’s any benefit in modularizing this snapshot data or providing indexing for performance—though for most applications this file size should be acceptable.
2042-2042
:✅ Verification successful
Extraneous Line Detected
There is an extra line (line 2042) that does not match the JSON pattern (missing the tilde and not part of the JSON object). Please confirm if this line is intentional. If not, removing it should help ensure the file is valid JSON.
A suggested diff:
-2042
Below is the revised review comment based on our investigation:
Remove Extraneous JSON Line at
snapshots/countries/AR_J.json:2042
It appears that line 2042 in the file contains an extra entry (just the text “2042”) that does not match JSON syntax. This extra line is unintentional and disrupts the valid JSON structure. Please remove it and re-validate the file.
- Ensure that the removal won’t affect any intended JSON data.
- Re-run your JSON validator after the change.
Diff suggestion:
-2042
To further verify this, you can run a script to inspect the surrounding lines in the file:
This script will help you confirm that only line 2042 is extraneous.
🏁 Script executed:
#!/bin/bash echo "Extracting lines 2030-2050 from snapshots/countries/AR_J.json:" sed -n '2030,2050p' snapshots/countries/AR_J.jsonLength of output: 822
Extraneous Line Removal Verified
The shell output confirms that the suspected extra line is no longer present insnapshots/countries/AR_J.json
. The JSON now appears intact without the stray "2042" entry. Thanks for addressing this issue—it's all good now!snapshots/countries/AR_D.json (3)
1-2103
: Comprehensive and Consistent Holiday Data
This JSON file nicely provides an extensive mapping of dates (in the "YYYY-MM-DD" format) to holiday names, covering the period from 1957 to 2050. The structure is consistent and clear, and the use of Unicode escapes (e.g. for "San Mart\u00edn") ensures accurate representation of accented characters.
2102-2103
:✅ Verification successful
Verify File Integrity
Please double-check that there are no extraneous elements—such as a trailing number (e.g. the "2103" line)—included in the file content. The JSON should strictly consist of a valid object ending with its closing brace to ensure proper parsing by downstream tools.
File Integrity Verified: JSON Termination is Correct
I reviewed the final portion of
snapshots/countries/AR_D.json
(Lines 2102-2103) and confirmed that the file concludes with a single closing brace (}
) as expected. There are no extraneous elements, such as a trailing number or any extra characters, disrupting the JSON structure.
- The closing brace properly terminates the JSON object.
- No additional, unintended data (like a stray number) was identified.
1-2103
:❓ Verification inconclusive
Consider Structuring for Enhanced Localization
The PR objectives mention adding support for categories and subdivisions. Currently, the file uses a flat mapping from date to a holiday description string. If you plan to leverage the new categories or regional subdivisions later on, you might want to consider a more structured format. For example, representing each holiday as an object with properties like “date”, “name”, “category”, and “subdivision” can make future updates and localization easier to manage.
Enhance Localization: Consider Evolving the Data Structure in AR_D.json
The current file uses a straightforward date-to-string mapping, which works fine for simple holiday definitions. However, because the PR objectives include supporting categories and regional subdivisions, you might want to adopt a more structured format. For example, refactoring each holiday into an object—using properties like
"date"
,"name"
,"category"
, and"subdivision"
—could simplify future localization adjustments and feature additions.
- Current state: The file maintains a flat mapping (e.g.,
"1957-01-01": "New Year's Day"
).- Suggested improvement: Transition to an object-based structure for each holiday entry.
- Benefit: Enhances flexibility and maintainability as you integrate categories and subdivisions later.
Please review this suggestion to ensure it aligns with your longer-term localization strategy.
holidays/locale/uk/LC_MESSAGES/AR.po (2)
13-13
: Verify metadata consistency.
The updated metadata (project version 0.70, revision date 2025-03-19, generator Poedit 3.5, and source language) looks consistent with the new content. No functional concerns are noted.Also applies to: 17-19, 28-29
31-369
: Reviewed new and updated Ukrainian holiday translations.
The revised translations (e.g., “observado” → “вихідний,” “Día de Reyes” → “Богоявлення,” etc.) appear coherent. They correctly align with the corresponding Spanish messages. Consider confirming if “observado” strictly means “observed holiday” vs. “non-working day.” Otherwise, these additions and changes look solid.holidays/countries/argentina.py (6)
15-24
: New imports and constants alignment.
Importing_CustomIslamicHolidays
and expandingHEBREW
,ISLAMIC
constants align with the new holiday coverage for Argentina. No issues detected.
33-40
: Inheritance from HebrewCalendarHolidays and IslamicHolidays.
Extending the class to support Hebrew and Islamic holidays is a welcomed improvement, ensuring comprehensive coverage without introducing logical or naming conflicts.
209-227
: Constructor enhancement for Islamic holidays.
Adding theislamic_show_estimated
parameter elegantly handles “estimated date” labels for Islamic holidays. The docstring is clear; no concerns here.
280-316
: Refinements to holiday logic.
The conditional checks for adding or moving holidays (Carnival, Maundy Thursday, etc.) look consistent with existing patterns. There are no noticeable performance or correctness issues.
780-809
: Introduction of ArgentinaIslamicHolidays class.
This specialized helper systematically defines known Eid al-Fitr, Eid al-Adha, and Hijri New Year dates, which is well-structured. Marked dates appear correct for the referenced years.
812-988
: ArgentinaStaticHolidays expansions and references.
New special holidays (World Cup Victory, bridging days, national census) are implemented consistently. The references to official decrees and laws are thorough, ensuring clarity. No issues identified.holidays/locale/en_US/LC_MESSAGES/AR.po (8)
28-29
: Translation metadata looks good.The updated generator version and addition of source language information improves documentation clarity.
31-34
: Good addition of observed holiday pattern.This pattern allows for proper localization of moved/observed holidays, which is beneficial for accurate calendar representation.
44-50
: Carnival holidays addition is appropriate.Adding Carnival Monday and Tuesday properly expands holiday coverage for cultural events in Argentina.
52-54
: Improved wording for commemorative days.The refinements to these translations make them more precise and grammatically correct in English.
Also applies to: 56-62
64-66
: Religious holiday additions are comprehensive.The addition of Maundy Thursday, Corpus Christi, Assumption Day, All Saints' Day, and Immaculate Conception provides thorough coverage of important religious observances in Argentina.
Also applies to: 80-82, 106-108, 118-120, 126-128
84-88
: Well-formed multi-line translation entry.The translation for this long holiday name is properly constructed with appropriate line breaks and consistent styling.
309-332
: Excellent inclusion of non-Christian religious holidays.The addition of Hebrew holidays (Rosh Hashanah, Yom Kippur, Pesach) and Islamic holidays (Islamic New Year, Eid al-Fitr, Eid al-Adha) greatly improves the cultural inclusivity of the holiday calendar.
358-369
: Special event holidays appropriately included.The addition of historical events like National Census Days and the FIFA World Cup 2022 Victory Day ensures the calendar captures significant national moments.
holidays/locale/es/LC_MESSAGES/AR.po (6)
28-29
: Updated metadata enhances file documentation.The generator version update and addition of source language information improves the file's metadata.
31-34
: Consistent implementation of observed holiday pattern.This addition matches the English version and enables proper translation of moved/observed holidays.
44-50
: Good alignment of religious and cultural holidays between language files.The Spanish source entries for Carnival days, Maundy Thursday, Corpus Christi, Assumption Day, and All Saints' Day correctly match between the language files.
Also applies to: 64-66, 80-82, 106-108, 118-120
156-159
: Clearly distinguished between national and provincial remembrance days.The distinction between "Provincial Day of Remembrance for Truth and Justice" and "Day of Remembrance for Truth and Justice" helps users understand the different scopes of these observances.
Also applies to: 180-183
309-332
: Well-structured multi-faith holiday entries.The inclusion of Hebrew and Islamic holidays with their original names in parentheses (e.g., "Año Nuevo Judío (Rosh Hashana)") provides both cultural context and accessibility.
156-369
: Comprehensive addition of regional and specialized holidays.The extensive list of provincial, commemorative, and special event holidays greatly enhances the coverage and usefulness of the Argentina holiday calendar, supporting the PR's goal of improved subdivision support.
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.
@KJhellico LGTM 🇦🇷 , great work as always
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.
💪 PR
🇦🇷 LGTM
Proposed change
Update Argentina holidays: add categories and subdivisions support
Type of change
holidays
functionality in general)Checklist
make check
, all checks and tests are green