Skip to content

Update Latvia holidays: add substituted holidays#3499

Merged
arkid15r merged 2 commits into
vacanza:devfrom
KJhellico:upd-latvia
Apr 6, 2026
Merged

Update Latvia holidays: add substituted holidays#3499
arkid15r merged 2 commits into
vacanza:devfrom
KJhellico:upd-latvia

Conversation

@KJhellico

Copy link
Copy Markdown
Collaborator

Proposed change

Update Latvia holidays: add substituted holidays (2001-2026).

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 Apr 3, 2026

Copy link
Copy Markdown
Contributor

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: ee3ea1dd-36a3-4528-85fc-0df00f49e052

📥 Commits

Reviewing files that changed from the base of the PR and between 819db08 and e56a0ff.

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

Summary by CodeRabbit

  • New Features

    • Expanded Latvia holiday dataset with comprehensive substituted-holiday support (additional years 2001–2026) and updated exported holiday snapshots.
    • Improved observed-holiday configuration for Latvia.
  • Localization

    • Added substituted-holiday labels and date-format translations for English, Latvian, and Ukrainian.
  • Tests

    • Added/strengthened tests for substituted holidays and working-day validation.
  • Documentation

    • Clarified observed-holiday start year in Latvia docs.

Walkthrough

This pull request replaces Latvia's hardcoded _is_observed cutoff with observed_since=2007, adds substituted-holiday metadata and many year-specific substitution entries, updates translations for substituted-date/label strings, and extends unit tests and snapshot data to cover substituted holidays.

Changes

Cohort / File(s) Summary
Core Logic
holidays/countries/latvia.py
Removed _is_observed override; set kwargs.setdefault("observed_since", 2007) in Latvia.__init__. Expanded month imports and added substituted_date_format / substituted_label constants. Added many year-specific substituted-holiday tuples to special_public_holidays.
Localization
holidays/locale/en_US/LC_MESSAGES/LV.po, holidays/locale/lv/LC_MESSAGES/LV.po, holidays/locale/uk/LC_MESSAGES/LV.po
Updated PO revision metadata; added translation entries for substituted date format ("%d.%m.%Y") and substituted-day label ("Brīvdiena (pārcelta no %s)") with corresponding locale translations.
Tests
tests/countries/test_latvia.py
Added WorkingDayTests inheritance, new test_substituted_holidays and test_workdays, and adjusted observed-name handling and assertions for specific observed/restored holidays.
Snapshots
snapshots/countries/LV_COMMON.json
Added multiple substituted-holiday snapshot entries (2001–2026); changes are additive.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • PPsyrius
  • arkid15r
🚥 Pre-merge checks | ✅ 2 | ❌ 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 (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: adding substituted holidays for Latvia across multiple years (2001-2026).
Description check ✅ Passed The description clearly relates to the changeset, specifying the update to Latvia holidays with substituted holidays for years 2001-2026.

✏️ 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.

@codecov

codecov Bot commented Apr 3, 2026

Copy link
Copy Markdown

Codecov Report

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

Additional details and impacted files
@@            Coverage Diff            @@
##               dev     #3499   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          313       313           
  Lines        18652     18659    +7     
  Branches      2383      2383           
=========================================
+ Hits         18652     18659    +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.

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

LGTM

Comment thread holidays/countries/latvia.py Outdated
@sonarqubecloud

sonarqubecloud Bot commented Apr 4, 2026

Copy link
Copy Markdown

@arkid15r arkid15r enabled auto-merge April 6, 2026 18:37
@arkid15r arkid15r added this pull request to the merge queue Apr 6, 2026
Merged via the queue into vacanza:dev with commit 02a7505 Apr 6, 2026
32 checks passed
@KJhellico KJhellico deleted the upd-latvia branch April 6, 2026 19:02
@KJhellico KJhellico mentioned this pull request Apr 6, 2026
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.

2 participants