Skip to content

Add Germany Stock Exchange holidays#3271

Merged
PPsyrius merged 46 commits intovacanza:devfrom
priak388:dev
Mar 12, 2026
Merged

Add Germany Stock Exchange holidays#3271
PPsyrius merged 46 commits intovacanza:devfrom
priak388:dev

Conversation

@priak388
Copy link
Copy Markdown
Contributor

@priak388 priak388 commented Feb 14, 2026

Proposed change

This PR adds support for the Germany Exchange under financial markets by introducing a new file germany_exchange.py.

The implementation follows the established structure and conventions used for other financial market exchange calendars in the project. The file defines the official trading holidays observed by the Germany Exchange, enabling users to retrieve exchange-specific holidays via the financials module.

This addition expands the financial market coverage of the library.

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
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Feb 14, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Adds Germany Stock Exchange (XETR/XFRA): new financial module implementing exchange holidays (start_year=2020) including year-specific Whit Monday behavior (2020–2021), localization PO files, README table entry, registry and package exports, plus unit tests.

Changes

Cohort / File(s) Summary
Documentation
README.md
Inserted Germany Stock Exchange (XETR) row into "Available Financial Markets" table.
Core Implementation
holidays/financial/germany_exchange.py
New module: GermanyStockExchange (market="XETR", default_language="de", supported_languages=("de","en_US"), start_year=2020) with _populate_public_holidays registering market closures; Whit Monday included only for 2020–2021. Defines XETR and XFRA aliases.
Package exports
holidays/financial/__init__.py
Added re-exports for GermanyStockExchange, XETR, and XFRA.
Registry
holidays/registry.py
Added germany_exchange entry to FINANCIAL registry mapping to (GermanyStockExchange, XETR, XFRA).
Localization
holidays/locale/de/LC_MESSAGES/XETR.po, holidays/locale/en_US/LC_MESSAGES/XETR.po
Added PO files for German and en_US translations of XETR market holiday names (German file has empty msgstr; en_US provides English translations).
Tests
tests/financial/test_germany_exchange.py
New test suite validating holiday dates and names, Whit Monday conditional behavior (present 2020–2021, absent thereafter), alias handling, and en_US localization mappings.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • arkid15r
  • KJhellico
🚥 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 PR title clearly and concisely summarizes the main change: adding Germany Stock Exchange holiday support to the codebase.
Description check ✅ Passed The PR description clearly relates to the changeset—it describes adding Germany Exchange holidays support via a new germany_exchange.py file, which aligns with the actual changes across multiple files including the new implementation, tests, and locale files.

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

✨ Finishing Touches
🧪 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.

Updated holiday methods to accept language-specific names for holidays in Germany.

Signed-off-by: priak388 <[email protected]>
coderabbitai[bot]
coderabbitai bot previously approved these changes Feb 17, 2026
@KJhellico KJhellico marked this pull request as draft February 28, 2026 12:35
@priak388 priak388 marked this pull request as ready for review March 9, 2026 08:01
@github-actions github-actions bot added the l10n label Mar 9, 2026
@priak388 priak388 requested review from KJhellico and PPsyrius March 9, 2026 08:07
Copy link
Copy Markdown
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: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@holidays/financial/germany_exchange.py`:
- Around line 51-55: Move the explanatory policy note about Pfingstmontag above
the year check so the holiday-name comment stays directly above the translatable
call; specifically, leave the short comment "# Whit Monday." immediately above
the self._add_whit_monday(tr("Pfingstmontag")) call and relocate the multi-line
explanatory block that references trading/closure behavior to precede the if
self._year in {2020, 2021}: conditional, ensuring the tr("Pfingstmontag") line
remains adjacent to its holiday-name comment.

In `@holidays/locale/en_US/LC_MESSAGES/XETR.po`:
- Around line 52-54: The en_US translation for msgid "Zweiter Weihnachtstag" is
incorrect: replace the current msgstr "Boxing Day" with a literal translation
that matches the German source and adjacent comment, e.g. msgstr "Second
Christmas Day" so the English string faithfully mirrors the original msgid.

In `@tests/financial/test_germany_exchange.py`:
- Around line 24-77: Add a localized assertion for the XETR exchange to exercise
the en_US translations: call assertLocalizedHolidays(XETR(), "en_US", 2020, ...)
(either inside test_xetr or a new small test) and include at least the 2020
dates and expected English names for key holidays (e.g., New Year 2020-01-01,
Good Friday 2020-04-10, Easter Monday 2020-04-13, Labour Day 2020-05-01, Whit
Monday 2020-06-01, Christmas 2020-12-25, Boxing Day 2020-12-26) so the en_US
LC_MESSAGES/XETR.po translations (including the year-limited Whit Monday) are
validated.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 85ad4128-6452-42df-85dc-5e94befe14ec

📥 Commits

Reviewing files that changed from the base of the PR and between c924647 and e6de31d.

📒 Files selected for processing (7)
  • README.md
  • holidays/financial/__init__.py
  • holidays/financial/germany_exchange.py
  • holidays/locale/de/LC_MESSAGES/XETR.po
  • holidays/locale/en_US/LC_MESSAGES/XETR.po
  • holidays/registry.py
  • tests/financial/test_germany_exchange.py

Copy link
Copy Markdown
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: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@holidays/locale/en_US/LC_MESSAGES/XETR.po`:
- Around line 45-46: Add the missing descriptive comment for the Pfingstmontag
translation: insert a translator comment line (e.g., "#. Whit Monday.")
immediately above the msgid "Pfingstmontag" / msgstr "Whit Monday" entry so it
matches the other entries and tooling that expects those comments.

In `@tests/financial/test_germany_exchange.py`:
- Around line 76-77: Add an assertion to ensure the XFRA alias is registered
like XETR: in tests/financial/test_germany_exchange.py update the test_xetr test
(or add a new test_xfra) to import XFRA and assert that XFRA() returns an
instance of GermanyStockExchange, referencing the existing test_xetr, XETR,
XFRA, and GermanyStockExchange symbols so both aliases are validated.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: c75c49fd-23f2-4173-84c5-98def3543c14

📥 Commits

Reviewing files that changed from the base of the PR and between 208ced3 and 9cdd404.

📒 Files selected for processing (3)
  • holidays/financial/germany_exchange.py
  • holidays/locale/en_US/LC_MESSAGES/XETR.po
  • tests/financial/test_germany_exchange.py

Copy link
Copy Markdown
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.

We're almost there 🎉

priak388 and others added 5 commits March 10, 2026 12:58
Co-authored-by: Panpakorn Siripanich <[email protected]>
Signed-off-by: priak388 <[email protected]>
Co-authored-by: Panpakorn Siripanich <[email protected]>
Signed-off-by: priak388 <[email protected]>
Co-authored-by: Panpakorn Siripanich <[email protected]>
Signed-off-by: priak388 <[email protected]>
Co-authored-by: Panpakorn Siripanich <[email protected]>
Signed-off-by: priak388 <[email protected]>
Co-authored-by: Panpakorn Siripanich <[email protected]>
Signed-off-by: priak388 <[email protected]>
priak388 and others added 3 commits March 11, 2026 12:58
Co-authored-by: Panpakorn Siripanich <[email protected]>
Signed-off-by: priak388 <[email protected]>
Co-authored-by: Panpakorn Siripanich <[email protected]>
Signed-off-by: priak388 <[email protected]>
Co-authored-by: Panpakorn Siripanich <[email protected]>
Signed-off-by: priak388 <[email protected]>
@priak388 priak388 requested a review from PPsyrius March 11, 2026 07:31
Copy link
Copy Markdown
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.

Don't forget to update l10n as well - this is probably the final review before merging 🎉

AFAIK, while Xetra's own record excludes holidays which fell on weekends - that's only the case for one of the data sources, they're otherwise included elsewhere, so I don't think we need to implement it like the National Stock Exchange of India market holidays.

Co-authored-by: Panpakorn Siripanich <[email protected]>
Signed-off-by: priak388 <[email protected]>
@priak388 priak388 requested a review from PPsyrius March 11, 2026 10:22
@priak388
Copy link
Copy Markdown
Contributor Author

@PPsyrius Thank you for your review, sir. I have updated the code based on your suggestions.

Co-authored-by: Panpakorn Siripanich <[email protected]>
Signed-off-by: priak388 <[email protected]>
@sonarqubecloud
Copy link
Copy Markdown

@priak388 priak388 requested a review from PPsyrius March 11, 2026 12:17
Copy link
Copy Markdown
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 🇩🇪

Copy link
Copy Markdown
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.

@priak388
Copy link
Copy Markdown
Contributor Author

Thank you for the review and approval. I appreciate your time and feedback!

@arkid15r arkid15r added this pull request to the merge queue Mar 12, 2026
Copy link
Copy Markdown
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.

Great work @priak388!

Thanks for the contribution!

github-merge-queue bot pushed a commit that referenced this pull request Mar 12, 2026
Signed-off-by: priak388 <[email protected]>
Co-authored-by: Panpakorn Siripanich <[email protected]>
Co-authored-by: kris <[email protected]>
Co-authored-by: ~Jhellico <[email protected]>
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Mar 12, 2026
@PPsyrius PPsyrius added this pull request to the merge queue Mar 12, 2026
@PPsyrius PPsyrius mentioned this pull request Mar 12, 2026
9 tasks
Merged via the queue into vacanza:dev with commit 664424c Mar 12, 2026
32 checks passed
PPsyrius added a commit to PPsyrius/python-holidays that referenced this pull request Mar 14, 2026
Signed-off-by: priak388 <[email protected]>
Co-authored-by: Panpakorn Siripanich <[email protected]>
Co-authored-by: kris <[email protected]>
Co-authored-by: ~Jhellico <[email protected]>
@arkid15r arkid15r mentioned this pull request Mar 16, 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.

5 participants