+
Skip to content

Conversation

PPsyrius
Copy link
Collaborator

@PPsyrius PPsyrius commented Sep 17, 2025

Proposed change

Set 2007 as start_year for Serbia holidays as its independence was restored on June 5th, 2006.

Any Yugoslavian-era holidays should instead be handled by its own entity Yugoslavia/YUG/YU and Serbia and Montenegro / CS / CSG - if we ever plan to support those anyway.

This is part of the non-test case changes decoupling from #2881

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 Sep 17, 2025

Summary by CodeRabbit

  • Bug Fixes

    • Corrected Serbia holiday coverage to start from 2007, aligning results with the valid historical period.
  • Chores

    • Updated Serbia holiday dataset to reflect availability from 2007 onward, removing earlier entries.
    • Streamlined formatting in holiday definitions without changing behavior.

Walkthrough

Introduces a start_year = 2007 attribute in the Serbia holiday class and inserts blank lines for readability. Updates the RS_COMMON.json snapshot by removing historical entries and retaining only three dates in 2007 (Jan 1, Jan 2, Jan 7). No other logic or API changes.

Changes

Cohort / File(s) Summary
Serbia holiday class update
holidays/countries/serbia.py
Added public attribute start_year = 2007 to Serbia class; inserted blank lines after Easter-related additions in _populate_public_holidays; no functional holiday logic changes.
RS snapshot data reduction
snapshots/countries/RS_COMMON.json
Purged historical date-to-holiday mappings; retained only three entries for 2007-01-01, 2007-01-02, and 2007-01-07; no code changes.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 Ruff (0.12.2)
holidays/countries/serbia.py

�[1;31mruff failed�[0m
�[1mCause:�[0m Failed to load configuration /ruff.toml
�[1mCause:�[0m Failed to parse /ruff.toml
�[1mCause:�[0m TOML parse error at line 26, column 3
|
26 | "RSE100", # Use of assert detected
| ^^^^^^^^
Unknown rule selector: RSE100


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.

Pre-merge checks

❌ 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%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The title "Update Serbia holidays: set 2007 as start_year" concisely and accurately summarizes the primary change — adding start_year = 2007 to the Serbia holidays class — making it clear and relevant for a teammate scanning history.
Description Check ✅ Passed The pull request description directly states the change (set Serbia's start_year to 2007), provides a concise rationale (independence restored June 5, 2006), and links the work to related PRs and intent, so it is on-topic and relevant to the modifications shown.

Copy link

Copy link

codecov bot commented Sep 17, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (d8ecdbe) to head (67c1773).
⚠️ Report is 4 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff            @@
##               dev     #2939   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          296       296           
  Lines        17596     17597    +1     
  Branches      2270      2270           
=========================================
+ Hits         17596     17597    +1     

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

@PPsyrius PPsyrius changed the title Update Serbia: set 2007 as start_year Update Serbia holidays: set 2007 as start_year Sep 17, 2025
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 d8ecdbe and 67c1773.

📒 Files selected for processing (2)
  • holidays/countries/serbia.py (2 hunks)
  • snapshots/countries/RS_COMMON.json (0 hunks)
💤 Files with no reviewable changes (1)
  • snapshots/countries/RS_COMMON.json
🧰 Additional context used
🧠 Learnings (8)
📓 Common learnings
Learnt from: PPsyrius
PR: vacanza/holidays#2881
File: tests/countries/test_bosnia_and_herzegovina.py:21-24
Timestamp: 2025-09-10T16:17:30.428Z
Learning: Bosnia and Herzegovina holidays implementation currently lacks a start_year attribute. In tests/countries/test_bosnia_and_herzegovina.py, using cls.full_range = range(2000, 2050) is intentional to bound assertions and setup. Do not suggest replacing it with harness default full_range until start_year is introduced.
Learnt from: PPsyrius
PR: vacanza/holidays#2609
File: holidays/countries/nauru.py:48-50
Timestamp: 2025-06-14T11:05:21.250Z
Learning: In the holidays library, newer implementations use `start_year` to indicate the earliest year with complete holiday data coverage, not necessarily the first year a holiday existed. If a holiday system starts partway through a year (like Nauru's Public Holidays Act starting Jan 31, 1968), the start_year should be set to the following year (1969) to ensure users get full annual holiday coverage.
Learnt from: PPsyrius
PR: vacanza/holidays#2881
File: tests/countries/test_south_africa.py:22-22
Timestamp: 2025-09-14T04:41:10.130Z
Learning: South Africa's observed holiday system only started in 1995, so in tests/countries/test_south_africa.py, using years_non_observed=range(1995, 2050) is intentional to limit testing to years where observed holidays actually exist, improving both correctness and performance.
Learnt from: PPsyrius
PR: vacanza/holidays#2881
File: tests/countries/test_bulgaria.py:21-23
Timestamp: 2025-09-14T16:14:44.954Z
Learning: For Bulgaria in the holidays library, using years_non_observed=range(2017, 2030) in tests/countries/test_bulgaria.py is intentional because all observed holiday examples in the test data fall within this range (latest being 2029), making this range appropriate for limiting testing to years where observed holidays actually exist, improving both correctness and performance.
Learnt from: KJhellico
PR: vacanza/holidays#2530
File: tests/countries/test_andorra.py:23-28
Timestamp: 2025-05-06T21:07:11.577Z
Learning: In the holidays project, test methods for country holidays follow a standard form where year ranges are explicitly recreated in each test method rather than being stored as class variables, to maintain consistency across all country tests.
Learnt from: PPsyrius
PR: vacanza/holidays#2881
File: tests/countries/test_bulgaria.py:21-23
Timestamp: 2025-09-14T16:14:44.954Z
Learning: For Bulgaria in the holidays library, using years_non_observed=range(2017, 2030) in tests/countries/test_bulgaria.py is intentional because all observed holiday examples in the test data fall within this range (latest being 2029), making this range appropriate for limiting testing to years where observed holidays actually exist.
Learnt from: PPsyrius
PR: vacanza/holidays#2407
File: snapshots/countries/TL_COMMON.json:7-7
Timestamp: 2025-04-03T05:59:57.480Z
Learning: In the holidays project, snapshot files (like snapshots/countries/TL_COMMON.json) are auto-generated when running `make snapshot` and should not be manually edited. Semicolons (;) in holiday entries are used as separators when multiple holidays occur on the same date.
Learnt from: PPsyrius
PR: vacanza/holidays#2881
File: tests/countries/test_barbados.py:21-23
Timestamp: 2025-09-14T16:03:13.496Z
Learning: In tests/countries/test_barbados.py, using years_non_observed=range(2000, 2024) is intentional because all observed holiday examples fall within 2001-2023, making this range appropriate for limiting testing to years where observed holidays actually exist in the test data.
Learnt from: PPsyrius
PR: vacanza/holidays#2642
File: holidays/countries/france.py:300-319
Timestamp: 2025-06-18T10:21:01.376Z
Learning: In the France holidays implementation, legislative years for holiday changes should be hard-coded rather than extracted into constants, as this maintains consistency with the existing codebase pattern and provides historical accuracy for specific legislative acts.
📚 Learning: 2025-09-10T16:17:30.428Z
Learnt from: PPsyrius
PR: vacanza/holidays#2881
File: tests/countries/test_bosnia_and_herzegovina.py:21-24
Timestamp: 2025-09-10T16:17:30.428Z
Learning: Bosnia and Herzegovina holidays implementation currently lacks a start_year attribute. In tests/countries/test_bosnia_and_herzegovina.py, using cls.full_range = range(2000, 2050) is intentional to bound assertions and setup. Do not suggest replacing it with harness default full_range until start_year is introduced.

Applied to files:

  • holidays/countries/serbia.py
📚 Learning: 2025-06-14T11:05:21.250Z
Learnt from: PPsyrius
PR: vacanza/holidays#2609
File: holidays/countries/nauru.py:48-50
Timestamp: 2025-06-14T11:05:21.250Z
Learning: In the holidays library, newer implementations use `start_year` to indicate the earliest year with complete holiday data coverage, not necessarily the first year a holiday existed. If a holiday system starts partway through a year (like Nauru's Public Holidays Act starting Jan 31, 1968), the start_year should be set to the following year (1969) to ensure users get full annual holiday coverage.

Applied to files:

  • holidays/countries/serbia.py
📚 Learning: 2025-06-14T11:04:31.180Z
Learnt from: PPsyrius
PR: vacanza/holidays#2609
File: holidays/countries/nauru.py:57-60
Timestamp: 2025-06-14T11:04:31.180Z
Learning: In the holidays library, the base `HolidayBase._populate()` method already includes a guard clause that prevents holiday population methods like `_populate_public_holidays()` from being called when the year is before `start_year` or after `end_year`. Therefore, individual country implementations do not need to add their own guard clauses for years before independence or other start dates.

Applied to files:

  • holidays/countries/serbia.py
📚 Learning: 2025-09-14T04:41:10.130Z
Learnt from: PPsyrius
PR: vacanza/holidays#2881
File: tests/countries/test_south_africa.py:22-22
Timestamp: 2025-09-14T04:41:10.130Z
Learning: South Africa's observed holiday system only started in 1995, so in tests/countries/test_south_africa.py, using years_non_observed=range(1995, 2050) is intentional to limit testing to years where observed holidays actually exist, improving both correctness and performance.

Applied to files:

  • holidays/countries/serbia.py
📚 Learning: 2025-08-21T04:56:03.780Z
Learnt from: PPsyrius
PR: vacanza/holidays#2843
File: holidays/countries/burundi.py:63-101
Timestamp: 2025-08-21T04:56:03.780Z
Learning: In the holidays library, countries with localization support consistently use tr() wrappers around holiday names when calling _add_* methods (e.g., self._add_new_years_day(tr("Holiday Name"))). This is the established pattern across United States, Thailand, and other l10n-enabled countries, contrary to any suggestion that translation is handled internally by _add_* methods.

Applied to files:

  • holidays/countries/serbia.py
📚 Learning: 2025-07-08T10:21:37.055Z
Learnt from: KJhellico
PR: vacanza/holidays#2701
File: holidays/countries/palestine.py:122-122
Timestamp: 2025-07-08T10:21:37.055Z
Learning: In Palestine, Easter follows the same naming pattern as Christmas - both the first and second days of Easter have identical names for the respective religious groups (Catholic or Orthodox). The implementation correctly uses `_add_easter_sunday` for nationwide holidays and `_add_easter_monday` for group-specific second days, but both share the same Arabic name "عيد الفصح المجيد".

Applied to files:

  • holidays/countries/serbia.py
📚 Learning: 2025-08-21T04:56:03.780Z
Learnt from: PPsyrius
PR: vacanza/holidays#2843
File: holidays/countries/burundi.py:63-101
Timestamp: 2025-08-21T04:56:03.780Z
Learning: In the holidays library, countries with localization support DO use tr() wrappers around holiday names when calling _add_* methods. This is the correct pattern for l10n-enabled country implementations, contrary to previous learning about translation being handled internally by _add_* methods.

Applied to files:

  • holidays/countries/serbia.py
🧬 Code graph analysis (1)
holidays/countries/serbia.py (1)
holidays/groups/christian.py (2)
  • _add_holy_saturday (355-362)
  • _add_easter_sunday (286-295)
🔇 Additional comments (1)
holidays/countries/serbia.py (1)

67-78: Whitespace-only around Easter block — OK

Formatting tweak only; no behavior change.

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 added this pull request to the merge queue Sep 17, 2025
Merged via the queue into vacanza:dev with commit 5a80654 Sep 17, 2025
36 checks passed
@PPsyrius PPsyrius deleted the serbia branch September 18, 2025 02:28
@arkid15r arkid15r mentioned this pull request Oct 6, 2025
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浏览器服务,不要输入任何密码和下载