+
Skip to content

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

Merged
merged 1 commit into from
Mar 27, 2025

Conversation

KJhellico
Copy link
Collaborator

Proposed change

Update Argentina holidays: add categories and subdivisions support

Type of change

  • New country/market holidays support (thank you!)
  • Supported country/market holidays update (calendar discrepancy fix, localization)
  • Existing code/documentation/test/process quality improvement (best practice, cleanup, refactoring, optimization)
  • Dependency update (version deprecation/pin/upgrade)
  • Bugfix (non-breaking change which fixes an issue)
  • Breaking change (a code change causing existing functionality to break)
  • New feature (new holidays functionality in general)

Checklist

Copy link
Contributor

coderabbitai bot commented Mar 26, 2025

Summary by CodeRabbit

  • Documentation

    • Updated the Argentina guide with clear subdivisions and detailed holiday categories.
  • New Features

    • Expanded holiday support in Argentina to include Hebrew and Islamic observances along with local subdivision-specific holidays.
    • Extended holiday scheduling data covering dates from the past to the future for enhanced planning.
  • Localization

    • Improved translations and metadata across multiple languages for more accurate and culturally inclusive holiday information.

Walkthrough

This 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 (ARMENIAN) has been added, and the Argentina class is enhanced with inherited support for Hebrew and Islamic holidays, along with new parameters and methods for refined holiday population. Additionally, localization files in multiple languages have updated metadata and additional holiday entries, and several new JSON snapshot files have been introduced containing Argentina’s holiday data from 1957 to 2050.

Changes

File(s) Change Summary
README.md Updated Argentina’s subdivisions cell with province codes and names, and populated the supported categories cell with holiday types (ARMENIAN, BANK, GOVERNMENT, HEBREW, ISLAMIC).
holidays/constants.py Added a new holiday category constant: ARMENIAN = "armenian".
holidays/countries/argentina.py Expanded the Argentina class to inherit from HebrewCalendarHolidays and IslamicHolidays; introduced new parameter islamic_show_estimated, added the ArgentinaIslamicHolidays class, and refined holiday population logic including subdivision-specific methods.
holidays/locale/.../LC_MESSAGES/AR.po Updated localization files (en_US, es, uk) with revised metadata (version, dates, generator, source language) and expanded holiday translation entries (e.g., “Maundy Thursday”, “Carnival Monday”, etc.).
snapshots/countries/AR_*.json Introduced new JSON snapshot files (AR_B, AR_C, AR_D, AR_G, AR_H, AR_J, AR_K, AR_L) containing detailed holiday data for Argentina from 1957 to 2050.

Possibly related PRs

✨ Finishing Touches
  • 📝 Generate Docstrings

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

Copy link

codecov bot commented Mar 26, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (a9fce3c) to head (f962ace).
Report is 9 commits behind head on dev.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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 issue

Extraneous 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 issue

Critical: 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 issue

Remove 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

📥 Commits

Reviewing files that changed from the base of the PR and between a9fce3c and f962ace.

📒 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:

  1. National holidays (Independence Day, Labor Day, etc.)
  2. 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)
  3. Historical commemorations
  4. 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 Quality

The 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.json

Length of output: 822


Extraneous Line Removal Verified
The shell output confirms that the suspected extra line is no longer present in snapshots/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 expanding HEBREW, 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 the islamic_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.

Copy link
Collaborator

@PPsyrius PPsyrius left a 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

Copy link
Collaborator

@arkid15r arkid15r left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💪 PR

🇦🇷 LGTM

@arkid15r arkid15r added this pull request to the merge queue Mar 27, 2025
Merged via the queue into vacanza:dev with commit 5e9f05a Mar 27, 2025
33 checks passed
@KJhellico KJhellico deleted the upd-argentina branch March 27, 2025 18:32
@arkid15r arkid15r mentioned this pull request Apr 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载