-
-
Couldn't load subscription status.
- Fork 560
Update India holidays: add missing Tamil Nadu holidays #2502
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
Signed-off-by: tr33k <[email protected]>
Summary by CodeRabbit
Summary by CodeRabbit
WalkthroughThis update introduces three new Hindu holidays—Pongal, Thiruvalluvar Day / Mattu Pongal, and Uzhavar Thirunal—into the holiday calendar logic and Tamil Nadu's public holidays. The changes include new constants, date mappings, and methods for these holidays in the core calendar module, new methods in the Hindu holiday group, and updates to Tamil Nadu's holiday population method. Localization files for English (India and US) and Hindi are updated with entries for the new holidays, and tests are expanded to cover these additions and their localized names. Changes
Assessment against linked issues
Suggested reviewers
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (1)
🧰 Additional context used🧬 Code Graph Analysis (1)holidays/countries/india.py (1)
⏰ Context from checks skipped due to timeout of 300000ms (1)
🔇 Additional comments (2)
✨ 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
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (7)
holidays/calendars/hindu.py(5 hunks)holidays/countries/india.py(1 hunks)holidays/groups/hindu.py(2 hunks)holidays/locale/en_IN/LC_MESSAGES/IN.po(2 hunks)holidays/locale/en_US/LC_MESSAGES/IN.po(2 hunks)holidays/locale/hi/LC_MESSAGES/IN.po(2 hunks)tests/countries/test_india.py(4 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (3)
holidays/countries/india.py (1)
holidays/groups/hindu.py (3)
_add_pongal(259-269)_add_thiruvalluvar_day(321-335)_add_uzhavar_thirunal(337-349)
holidays/groups/hindu.py (1)
holidays/calendars/hindu.py (3)
pongal_date(1390-1391)thiruvalluvar_day_date(1423-1424)uzhavar_thirunal_date(1426-1427)
holidays/calendars/hindu.py (1)
holidays/calendars/buddhist.py (1)
_get_holiday(430-434)
🔇 Additional comments (19)
holidays/locale/en_IN/LC_MESSAGES/IN.po (2)
17-17: Project version updated correctly.Version number has been updated from 0.69 to 0.72, maintaining consistency with other locale files.
309-316: New holiday entries added properly.The two new holidays for Tamil Nadu - "Thiruvalluvar Day / Mattu Pongal" and "Uzhavar Thirunal" - have been correctly added to the translation file following the existing format. Both entries have empty msgstr fields which is appropriate for the en_IN locale since the original holiday names are already in English.
holidays/locale/en_US/LC_MESSAGES/IN.po (2)
17-17: Project version updated correctly.Version number has been updated from 0.69 to 0.72, maintaining consistency with other locale files.
310-317: New holiday entries properly added with translations.The two new holidays for Tamil Nadu - "Thiruvalluvar Day / Mattu Pongal" and "Uzhavar Thirunal" - have been correctly added and translated for the US English locale. The translation strings match the source strings as expected for English variants.
holidays/locale/hi/LC_MESSAGES/IN.po (2)
17-17: Project version updated correctly.Version number has been updated from 0.69 to 0.72, maintaining consistency with other locale files.
310-316: Hindi translations added correctly for new Tamil Nadu holidays.The Hindi translations for "Thiruvalluvar Day / Mattu Pongal" (तिरुवल्लुवर दिवस / मट्टू पोंगल) and "Uzhavar Thirunal" (उझावर थिरुनल) have been properly implemented, following the translation pattern for other regional holidays.
tests/countries/test_india.py (4)
149-151: Test coverage added for the new Tamil Nadu holidays.The test case now correctly verifies the two new Tamil Nadu holidays: Thiruvalluvar Day / Mattu Pongal (Jan 15) and Uzhavar Thirunal (Jan 16) for 2018. This matches the implementation of the Pongal festival sequence.
506-507: Localization test updated with new holiday names.The default locale test has been properly updated to include the localized names for the newly added Tamil Nadu holidays. This ensures that the holiday names are correctly displayed in the default locale.
574-575: Hindi localization added for the new holidays.The Hindi locale test has been correctly updated with translated names for the new Tamil Nadu holidays. The translations appear to be appropriate Hindi equivalents for Thiruvalluvar Day / Mattu Pongal and Uzhavar Thirunal.
637-638: US English localization verified for the new holidays.The US English locale test has been appropriately updated with the English names for the Tamil Nadu holidays. The names match those in the default locale, ensuring consistency across English variants.
holidays/groups/hindu.py (3)
259-270: Well-documented Pongal holiday method added.The
_add_pongalmethod is well implemented with a comprehensive docstring that clearly explains:
- What Pongal is (a major harvest festival in Tamil Nadu)
- When it's observed (January 14-15)
- Its significance (sun's northward journey, prosperity season)
- A reference link to Wikipedia
The implementation correctly uses the Hindu calendar to retrieve the appropriate date.
321-336: Clear implementation of Thiruvalluvar Day method.The
_add_thiruvalluvar_daymethod properly implements the holiday with a thorough docstring explaining:
- The dual nature of the holiday (Thiruvalluvar Day and Mattu Pongal)
- The cultural significance of honoring both the Tamil poet and cattle
- The timing (January 15-16, part of Pongal festival)
- Wikipedia references for both aspects
The implementation follows the established pattern for adding Hindu calendar holidays.
337-349: Uzhavar Thirunal method completes the Pongal holiday sequence.The
_add_uzhavar_thirunalmethod rounds out the Pongal festival sequence with:
- Clear explanation of the farmers' harvest festival
- Proper timing (January 16-17)
- Appropriate Wikipedia reference
- Consistent implementation pattern
This completes the set of methods needed for the Tamil Nadu Pongal festival sequence.
holidays/calendars/hindu.py (6)
38-44: New holiday constants added in alphabetical order.The new constants
PONGAL,THIRUVALLUVAR_DAY, andUZHAVAR_THIRUNALhave been properly added to the list of constants, maintaining the alphabetical ordering that helps with code readability and maintenance.
871-907: Pongal date mappings follow established pattern.The
PONGAL_DATESdictionary is correctly implemented with:
- Comprehensive coverage from 2001-2035
- Dates follow the expected January 14-15 pattern (Jan 14 in standard years, Jan 15 in leap years and certain other years)
- Format consistent with other holiday date mappings
This provides a reliable date source for the Pongal holiday calculations.
1229-1265: Thiruvalluvar Day dates properly mapped.The
THIRUVALLUVAR_DAY_DATESdictionary correctly:
- Covers years 2001-2035
- Places the holiday on January 15-16 (the day after Pongal)
- Maintains the consistent format of other date mappings
This ensures the Thiruvalluvar Day / Mattu Pongal holiday is correctly placed in the sequence of Pongal celebrations.
1267-1303: Uzhavar Thirunal dates complete the festival sequence.The
UZHAVAR_THIRUNAL_DATESdictionary properly:
- Spans 2001-2035
- Places the holiday on January 16-17 (the day after Thiruvalluvar Day)
- Follows the consistent pattern of the other date mappings
This completes the date sequence for the four-day Pongal celebration as observed in Tamil Nadu.
1390-1392: Pongal date retrieval method added.The
pongal_datemethod correctly implements the date retrieval by calling the common_get_holidayhelper with the appropriate constant and year. This follows the established pattern for holiday date access.
1423-1428: Date retrieval methods for other Pongal-related holidays.The
thiruvalluvar_day_dateanduzhavar_thirunal_datemethods correctly implement the date retrieval functionality following the established pattern of other holiday date methods in the class. These complete the API needed for the Tamil Nadu holidays.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev #2502 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 215 215
Lines 13588 13600 +12
Branches 1931 1931
=========================================
+ Hits 13588 13600 +12 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…runal' Signed-off-by: tr33k <[email protected]>
Co-authored-by: ~Jhellico <[email protected]> Signed-off-by: Devaraj K <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🔭 Outside diff range comments (1)
holidays/groups/hindu.py (1)
30-42: 🛠️ Refactor suggestionMethod signature needs updating for new use cases
The existing
_add_hindu_calendar_holidaymethod doesn't support thedays_deltaparameter needed by the new holiday methods.As suggested in previous review comments, you should update this method to include the
days_deltaparameter:def _add_hindu_calendar_holiday( - self, name: str, dt_estimated: tuple[Optional[date], bool] + self, name: str, dt_estimated: tuple[Optional[date], bool], days_delta: int = 0 ) -> Optional[date]: """ Add Hindu calendar holiday. Adds customizable estimation label to holiday name if holiday date is an estimation. """ return self._add_eastern_calendar_holiday( - name, dt_estimated, self._hindu_calendar_show_estimated + name, dt_estimated, self._hindu_calendar_show_estimated, days_delta )This approach would make the new method calls work correctly and eliminate the need for separate calendar constants for related holidays.
♻️ Duplicate comments (1)
holidays/groups/hindu.py (1)
337-349:⚠️ Potential issueParameter mismatch in method call
The same issue exists here - the
_add_hindu_calendar_holidaymethod doesn't accept adays_deltaparameter.Apply the same fix pattern as for the previous method:
- return self._add_hindu_calendar_holiday( - name, self._hindu_calendar.pongal_date(self._year), days_delta=+2 - ) + return self._add_eastern_calendar_holiday( + name, self._hindu_calendar.pongal_date(self._year), self._hindu_calendar_show_estimated, days_delta=+2 + )
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (1)
holidays/groups/hindu.py(2 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
holidays/groups/hindu.py (1)
holidays/calendars/hindu.py (1)
pongal_date(1390-1391)
🔇 Additional comments (1)
holidays/groups/hindu.py (1)
259-269: Well-structured addition of Pongal holiday methodThis implementation follows the established pattern of other Hindu calendar holidays in the class. The docstring provides clear cultural context with appropriate Wikipedia reference.
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Signed-off-by: Devaraj K <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (1)
holidays/groups/hindu.py(2 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
holidays/groups/hindu.py (2)
holidays/calendars/hindu.py (1)
pongal_date(1390-1391)holidays/groups/eastern.py (1)
_add_eastern_calendar_holiday(24-51)
🪛 Ruff (0.8.2)
holidays/groups/hindu.py
333-333: SyntaxError: Expected an identifier, but found a keyword 'return' that cannot be used here
333-333: SyntaxError: Simple statements must be separated by newlines or semicolons
335-335: SyntaxError: Expected an expression
336-336: SyntaxError: Expected an identifier, but found a keyword 'return' that cannot be used here
336-336: SyntaxError: Simple statements must be separated by newlines or semicolons
340-340: SyntaxError: Expected a parameter name
341-341: SyntaxError: Positional argument cannot follow keyword argument
341-341: SyntaxError: Expected an expression
343-343: SyntaxError: Unexpected indentation
🔇 Additional comments (2)
holidays/groups/hindu.py (2)
259-269: Implementation of Pongal holiday looks good!This new method correctly adds the Pongal festival holiday following the same pattern as other Hindu holidays in the file. The comprehensive docstring provides clear context about the festival's significance and timing.
321-341: Good fix for parameter handling!You've correctly updated the implementation to use
_add_eastern_calendar_holidaydirectly with the appropriate parameters instead of using_add_hindu_calendar_holiday. This addresses the parameter mismatch issue identified in previous reviews.🧰 Tools
🪛 Ruff (0.8.2)
333-333: SyntaxError: Expected an identifier, but found a keyword 'return' that cannot be used here
333-333: SyntaxError: Simple statements must be separated by newlines or semicolons
335-335: SyntaxError: Expected an expression
336-336: SyntaxError: Expected an identifier, but found a keyword 'return' that cannot be used here
336-336: SyntaxError: Simple statements must be separated by newlines or semicolons
340-340: SyntaxError: Expected a parameter name
341-341: SyntaxError: Positional argument cannot follow keyword argument
341-341: SyntaxError: Expected an expression
Signed-off-by: Devaraj K <[email protected]>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Signed-off-by: Devaraj K <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (1)
holidays/calendars/hindu.py(3 hunks)
🔇 Additional comments (2)
holidays/calendars/hindu.py (2)
38-38: Nice addition of the PONGAL constant
The newPONGALconstant aligns perfectly with the existing holiday constants and sets up the new date method.
1312-1314: Method signature follows established pattern
Thepongal_datemethod correctly delegates to_get_holidayand mirrors the signatures of the other date methods.
Signed-off-by: tr33k <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (1)
holidays/groups/hindu.py(4 hunks)
🔇 Additional comments (4)
holidays/groups/hindu.py (4)
31-42: Good implementation of days_delta parameterThe addition of the days_delta parameter to _add_hindu_calendar_holiday is well-implemented. The validation check for None before applying timedelta is a smart defensive programming approach.
259-269: Well-documented Pongal implementationThe Pongal method is well-implemented with comprehensive documentation explaining the festival's significance, timing, and cultural context.
321-335: Well-documented Thiruvalluvar Day implementationGood implementation of the Thiruvalluvar Day / Mattu Pongal holiday with a clear days_delta of 1 from Pongal. The documentation provides excellent context about this Tamil Nadu celebration.
337-349: Well-documented Uzhavar Thirunal implementationGood implementation of Uzhavar Thirunal with appropriate days_delta of 2 from Pongal. The documentation clearly explains the significance of this farmers' celebration day.
Signed-off-by: tr33k <[email protected]>
|
It's worth adding these links to References in India class docstring: |
Signed-off-by: Devaraj K <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (1)
holidays/countries/india.py(2 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
holidays/countries/india.py (1)
holidays/groups/hindu.py (3)
_add_pongal(259-269)_add_thiruvalluvar_day(321-335)_add_uzhavar_thirunal(337-349)
🔇 Additional comments (1)
holidays/countries/india.py (1)
40-41: Good addition of Tamil calendar reference sources.Adding these reference URLs directly supports the PR objective of accurately representing Tamil Nadu holidays. These sources provide authoritative data for calculating the traditional Pongal festival dates.
Signed-off-by: ~Jhellico <[email protected]>
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nicely done, thanks @tr33k 👍


Proposed change
Added missing holidays for the Tamil Nadu subdivision (India).
Notably, Pongal and Marker Sankranti dates differ slightly. To handle this correctly, I introduced a separate add_pongal() method for Pongal-related holidays.
For accurate historical data, I referred to:
Tamil Daily Calendar (2005–2025)
Prokerala Tamil Calendar (2001–2005)
The sequence of holidays around Pongal is:
Bhogi (not declared as a public holiday)
Pongal (Main festival)
Thiruvalluvar Day (the day after Pongal)
Uzhavar Thirunal (the day after Thiruvalluvar Day)
This structure aligns with the traditional four-day Pongal celebrations in Tamil Nadu.
Type of change
Added missing public and optional holidays.
Created a new add_pongal() function for better handling of Pongal-related holidays.
Closes #2500
holidaysfunctionality in general)Checklist
make check, all checks and tests are green