+
Skip to content

Conversation

PPsyrius
Copy link
Collaborator

@PPsyrius PPsyrius commented Oct 9, 2025

Proposed change

Add _is_weekday method as an alias for not self._is_weekend(*args).

Inspired by #2992 - on one hand, its use case seems pretty narrow, but on the other hand, why not 🤷 - so I'm marking this as a draft PR for now.

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

@github-actions github-actions bot added the test label Oct 9, 2025
Copy link
Contributor

coderabbitai bot commented Oct 9, 2025

Summary by CodeRabbit

  • New Features
    • No user-facing changes in this release.
  • Refactor
    • Improved internal weekday/weekend utilities by adding a helper and standardizing type annotations for clarity and consistency. No changes to observable behavior or holiday results.
  • Tests
    • Expanded test coverage to verify weekday/weekend logic across various date formats and weekend configurations, ensuring they remain logical opposites. Increased robustness and regression protection.

Walkthrough

Added a new helper method HolidayBase._is_weekday(self, *args) -> bool that returns the negation of _is_weekend, and annotated HolidayBase._is_weekend(self, *args) -> bool. Tests were extended to assert parity between the two across inputs and weekend configurations.

Changes

Cohort / File(s) Summary
Core: HolidayBase helpers
holidays/holiday_base.py
Added def _is_weekday(self, *args) -> bool implemented as not self._is_weekend(*args); updated def _is_weekend(self, *args) -> bool signature to include explicit bool return annotation.
Tests: Weekday/Weekend parity
tests/test_holiday_base.py
Added assertions verifying _is_weekday(dt) is the logical opposite of _is_weekend(dt) for multiple date representations and weekend configurations.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The title succinctly describes the introduction of the new _is_weekday helper method in HolidayBase, matching the main change and remaining clear and concise.
Description Check ✅ Passed The description clearly states the addition of the _is_weekday alias, links it to the related issue, and notes test validation, directly reflecting the changeset without being off-topic.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

codecov bot commented Oct 9, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (05d291d) to head (77d4b24).
⚠️ Report is 2 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff            @@
##               dev     #2999   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          305       305           
  Lines        17998     18005    +7     
  Branches      2323      2323           
=========================================
+ Hits         17998     18005    +7     

☔ 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

Why not? 🙂

@PPsyrius PPsyrius marked this pull request as ready for review October 10, 2025 01:02
KJhellico
KJhellico previously approved these changes Oct 10, 2025
Copy link
Collaborator

@KJhellico KJhellico 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 enabled auto-merge October 11, 2025 01:21
Copy link

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: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0b29073 and 77d4b24.

📒 Files selected for processing (1)
  • holidays/holiday_base.py (1 hunks)
🧰 Additional context used
🪛 Ruff (0.13.3)
holidays/holiday_base.py

868-868: Missing type annotation for *args

(ANN002)


875-875: Missing type annotation for *args

(ANN002)

⏰ 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). (1)
  • GitHub Check: Test Python 3.14 on windows-latest
🔇 Additional comments (1)
holidays/holiday_base.py (1)

875-875: Good addition of return type annotation.

Explicit return type improves code clarity.

@arkid15r arkid15r added this pull request to the merge queue Oct 11, 2025
Merged via the queue into vacanza:dev with commit bcde5d1 Oct 11, 2025
36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

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