Add Germany Stock Exchange holidays#3271
Conversation
|
Note Reviews pausedIt 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 Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughAdds 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
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Updated holiday methods to accept language-specific names for holidays in Germany. Signed-off-by: priak388 <[email protected]>
There was a problem hiding this comment.
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
📒 Files selected for processing (7)
README.mdholidays/financial/__init__.pyholidays/financial/germany_exchange.pyholidays/locale/de/LC_MESSAGES/XETR.poholidays/locale/en_US/LC_MESSAGES/XETR.poholidays/registry.pytests/financial/test_germany_exchange.py
There was a problem hiding this comment.
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
📒 Files selected for processing (3)
holidays/financial/germany_exchange.pyholidays/locale/en_US/LC_MESSAGES/XETR.potests/financial/test_germany_exchange.py
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]>
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]>
PPsyrius
left a comment
There was a problem hiding this comment.
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]>
|
@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]>
|
|
Thank you for the review and approval. I appreciate your time and feedback! |
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]>
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]>



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
holidaysfunctionality in general)Checklist
make checklocally; all checks and tests passed.