+
Skip to content

Update US holidays: аdd additional MI state holidays #2325

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 6 commits into from
Mar 6, 2025

Conversation

mcvic1rj
Copy link
Contributor

@mcvic1rj mcvic1rj commented Mar 4, 2025

Proposed change

US-Michigan has held the day after Thanksgiving as a state holiday since at least 2017. The current state holidays can be found here: https://www.michigan.gov/som/government/state-holidays

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

Add Day after Thanksgiving for US_MI

Signed-off-by: Ryan McVicar <rymcvicar@gmail.com>
Copy link
Contributor

coderabbitai bot commented Mar 4, 2025

Summary by CodeRabbit

  • New Features

    • Expanded holiday support by adding conditional "Election Day" (for even years starting 2008) and "Day After Thanksgiving" (from 2017 onward).
    • Enhanced the holiday calendar for Michigan with detailed observance dates spanning multiple years.
  • Tests

    • Updated holiday tests to validate the new schedule and ensure accurate region-specific holiday observances.

Walkthrough

The change introduces two new holidays to the _populate_subdiv_mi_public_holidays method within the UnitedStates class. "Election Day" is added for even years starting from 2008, while "Day After Thanksgiving" is included for years from 2017 onwards. Additionally, multiple entries for these holidays are added to the Michigan holiday JSON file, and the test cases are updated to reflect these changes.

Changes

File Summary
holidays/.../united_states.py Updated _populate_subdiv_mi_public_holidays to conditionally include "Election Day" for even years from 2008 and "Day After Thanksgiving" for years 2017+.
snapshots/.../US_MI.json Added multiple entries for "Election Day" and "Day After Thanksgiving" for various years from 2010 to 2050.
tests/countries/test_united_states.py Modified test cases to include Michigan ("MI") for "Election Day" and "Day After Thanksgiving," and updated the years tested for these holidays.

📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7125a6d and d0ece07.

📒 Files selected for processing (3)
  • holidays/countries/united_states.py (2 hunks)
  • snapshots/countries/US_MI.json (36 hunks)
  • tests/countries/test_united_states.py (2 hunks)
🔇 Additional comments (7)
holidays/countries/united_states.py (2)

688-691: Good addition of Election Day for Michigan.

The implementation correctly adds Election Day for Michigan in even years starting from 2008, which aligns with the state's holiday calendar.


692-694: Implementation for Day After Thanksgiving looks good.

The code properly adds the Day After Thanksgiving holiday for Michigan from 2017 onwards. This is consistent with Michigan's official holiday calendar as cited in the source on line 65.

tests/countries/test_united_states.py (3)

1658-1658: Good update to the Election Day test.

Michigan has been properly added to the list of states that observe Election Day, while Louisiana has been removed. This correctly reflects the changes made to the holiday implementation.


1816-1816: Test case addition for 2024 looks good.

Adding the 2024 test date for Day After Thanksgiving ensures that the test coverage extends to future dates.


1824-1824: Michigan correctly added to Day After Thanksgiving tests.

Michigan has been added to the list of states that observe Day After Thanksgiving with the correct start year of 2017, matching the implementation.

snapshots/countries/US_MI.json (2)

838-840: Review Election Day Additions
The updated JSON now includes new "Election Day" entries for several years (e.g. 2010, 2014, 2018, 2022, 2026, 2030, 2038, 2046, and 2050). Please verify that each of these dates correctly reflects the official observance in Michigan and adheres to the expected pattern (typically the Tuesday following the first Monday in November, as appropriate for even-year elections).

Also applies to: 899-901, 969-971, 1043-1045, 1120-1122, 1196-1198, 1349-1351, 1505-1508, 1581-1583


954-956: Review Day After Thanksgiving Additions
In addition, the snapshot now incorporates "Day After Thanksgiving" entries starting from 2017 across multiple years. Please ensure that these dates are accurate, consistently formatted, and truly reflect Michigan’s state holiday observance.

Also applies to: 973-975, 1007-1009, 1026-1028, 1046-1048, 1087-1089, 1104-1107, 1123-1125, 1142-1144, 1162-1165, 1178-1182, 1199-1201, 1209-1211, 1236-1239, 1255-1258, 1315-1317, 1333-1336, 1353-1356, 1372-1375, 1395-1399, 1412-1415, 1427-1430, 1448-1451, 1467-1470, 1489-1492, 1526-1529, 1545-1548, 1564-1568, 1584-1588

✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 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 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
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: 1

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 47b35af and e2aeb02.

📒 Files selected for processing (1)
  • holidays/countries/united_states.py (1 hunks)

@mcvic1rj mcvic1rj marked this pull request as ready for review March 4, 2025 18:34
Copy link

codecov bot commented Mar 4, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (3f52858) to head (d0ece07).
Report is 4 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff            @@
##               dev     #2325   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          201       201           
  Lines        12374     12378    +4     
  Branches      1775      1777    +2     
=========================================
+ Hits         12374     12378    +4     

☔ 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.

@KJhellico
Copy link
Collaborator

@mcvic1rj, thank you for your contribution to Holidays and for providing an official source for MI state holidays. According to it, we also miss Election Day. Would you like to add it as well? And do you have any information about when exactly these holidays appeared on the list?

@mcvic1rj
Copy link
Contributor Author

mcvic1rj commented Mar 5, 2025

Thank you for catching that @KJhellico. I've gone ahead and added a new commit to add in the election day as well.

Copy link

sonarqubecloud bot commented Mar 5, 2025

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.

LGTM 👍
@KJhellico thanks for the tests and the source list update.

@arkid15r arkid15r enabled auto-merge March 5, 2025 20:05
@arkid15r
Copy link
Collaborator

arkid15r commented Mar 5, 2025

@mcvic1rj thank you for updating MI holidays! Will be merged after @PPsyrius' review.

@KJhellico KJhellico changed the title Add additional holiday for US_MI Update US holidays: аdd additional MI state holidays Mar 5, 2025
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.

LGTM 🇺🇸

@arkid15r arkid15r added this pull request to the merge queue Mar 5, 2025
Merged via the queue into vacanza:dev with commit 99f821c Mar 6, 2025
33 checks passed
@KJhellico KJhellico mentioned this pull request Mar 17, 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.

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