Skip to content

Update HolidayBase::__repr__ method#3575

Merged
arkid15r merged 1 commit into
vacanza:devfrom
KJhellico:upd-repr-method
May 13, 2026
Merged

Update HolidayBase::__repr__ method#3575
arkid15r merged 1 commit into
vacanza:devfrom
KJhellico:upd-repr-method

Conversation

@KJhellico

Copy link
Copy Markdown
Collaborator

Proposed change

Include categories, language, subdiv arguments in the output.

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

@coderabbitai

coderabbitai Bot commented May 12, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack
No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 769994e5-dc72-4cb8-b66a-cac5f49d4cbc

📥 Commits

Reviewing files that changed from the base of the PR and between eaf67c4 and 9add49e.

📒 Files selected for processing (2)
  • holidays/holiday_base.py
  • tests/test_holiday_base.py

Summary by CodeRabbit

  • Refactor

    • Enhanced string representations of holiday objects to display additional parameters (language, categories, subdiv) when applicable.
  • Tests

    • Added test coverage for updated string representation output across various parameter configurations.

Walkthrough

The HolidayBase.__repr__ method now builds richer constructor-style strings by conditionally including language, non-default categories, and subdiv parameters for country and financial holiday instances, with matching test assertions validating the updated output formats.

Changes

Enhanced HolidayBase Representation

Layer / File(s) Summary
Enhanced __repr__ for financial and country holidays
holidays/holiday_base.py
HolidayBase.__repr__ now conditionally appends language for financial holidays and language, non-default categories, and subdiv for country holidays to generate more complete constructor-style representations.
Test coverage for conditional repr parameters
tests/test_holiday_base.py
TestRepr.test_country extends assertions to cover language, categories list formatting, and combined parameter cases; TestRepr.test_market adds validation for language in financial holiday repr output.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Suggested labels

test

Suggested reviewers

  • arkid15r
  • PPsyrius
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: updating the HolidayBase.repr method to include additional arguments.
Description check ✅ Passed The description directly relates to the changeset, specifying that categories, language, and subdiv arguments should be included in the repr output.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@github-actions github-actions Bot added the test label May 12, 2026
@sonarqubecloud

Copy link
Copy Markdown

@codecov

codecov Bot commented May 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (40576a6) to head (9add49e).
⚠️ Report is 1 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff            @@
##               dev     #3575   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          314       314           
  Lines        18766     18775    +9     
  Branches      2401      2405    +4     
=========================================
+ Hits         18766     18775    +9     

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

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 2 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Tip: cubic could auto-approve low-risk PRs like this, if it thinks it's safe to merge. Learn more

@PPsyrius PPsyrius left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM 🛠️

@arkid15r arkid15r left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I hope not a lot of users rely on a str/repr format (might be a breaking change for someone).

@arkid15r arkid15r added this pull request to the merge queue May 13, 2026
Merged via the queue into vacanza:dev with commit 593437d May 13, 2026
33 checks passed
@KJhellico KJhellico deleted the upd-repr-method branch May 13, 2026 18:55
@KJhellico KJhellico mentioned this pull request May 18, 2026
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