Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update FI: add unofficial holidays #1885

Merged
merged 17 commits into from
Aug 2, 2024

Conversation

alexei-mobal
Copy link
Contributor

@alexei-mobal alexei-mobal commented Jul 29, 2024

Proposed change

Current implementation generates only list of Public holidays (so
holidays established by Parliament). However there are also quite a lot
of so called "flag flying days" ("liputuspäivät" in Finnish or "flaggdagar"
in Swedish) that don't have official holiday status, but still it's
quite common for businesses to have shorter opening hours or to be
completely closed.

So this adds a list of those holidays under unofficial category.
The English and Swedish translations are taken from the
Ministry of the Interior website, and for Ukrainian one I asked a
Ukrainian friend of mine (who's native language is Ukrainian) to
review the list for me.

Sources:

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/upgrade)
  • Bugfix (non-breaking change which fixes an issue)
  • Breaking change (a code change causing existing functionality to break)
  • New feature (new python-holidays functionality in general)

Checklist

  • I've followed the [contributing guidelines][contributing-guidelines]
  • I've run make pre-commit, it didn't generate any changes
  • I've run make test, all tests passed locally

@alexei-mobal alexei-mobal force-pushed the add-finnish-unofficial-holidays branch 2 times, most recently from 2e7204e to 9c3562a Compare July 29, 2024 13:42
@alexei-mobal alexei-mobal marked this pull request as ready for review July 29, 2024 13:43
Current implementation generates only list of Public holidays (so
holidays established by Parliament). However there are also quite a lot
of so called "flag flying days" ("liputuspäivät" in Finnish or "flaggdagar"
in Swedish) that don't have official holiday status, but still it's
quite common for businesses to have shorter opening hours or to be
completely closed.

So this adds a list of those holidays under unofficial category.
The English and Swedish translations are taken from the
Ministry of the Interior website, and for Ukrainian one I asked a
Ukrainian friend of mine (who's native language is Ukrainian) to
review the list for me.

Sources:

- https://en.wikipedia.org/wiki/Flag_flying_days_in_Finland
- https://intermin.fi/en/flag-and-arms/flag-flying-days (Ministry of the
  Interior of Finland)
@alexei-mobal alexei-mobal force-pushed the add-finnish-unofficial-holidays branch from 9c3562a to 56d6373 Compare July 29, 2024 13:44
@alexei-mobal
Copy link
Contributor Author

Sonar cloud is apparently not happy with all the year checks in if blocks of new _populate_unofficial_holidays, so I can of course, dunno, split that into some smaller functions if really needed 🤔

Copy link

codecov bot commented Jul 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (5cdde4c) to head (253434a).

Additional details and impacted files
@@            Coverage Diff            @@
##               dev     #1885   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          185       185           
  Lines        11222     11263   +41     
  Branches      1766      1785   +19     
=========================================
+ Hits         11222     11263   +41     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@KJhellico
Copy link
Collaborator

@alexei-mobal, it's great contribution! I am not very familiar with Finnish traditions and holidays, so I have a few questions here.

  1. There are several more "Official flag days": Kalevala day, Mothers' Day, birthday of C.G.E. Mannerheim, Fathers' Day. I don't know if their celebration is different, but maybe they should be added as well?
  2. It would be great to unify holidays names. I mean those that look like “Birthday of %someone%, day of %something%”. Now some have different names in different languages. I think we can follow the names provided here.

holidays/countries/finland.py Show resolved Hide resolved
holidays/countries/finland.py Outdated Show resolved Hide resolved
holidays/countries/finland.py Outdated Show resolved Hide resolved
holidays/locale/en_US/LC_MESSAGES/FI.po Outdated Show resolved Hide resolved
holidays/locale/fi/LC_MESSAGES/FI.po Outdated Show resolved Hide resolved
holidays/locale/sv_FI/LC_MESSAGES/FI.po Outdated Show resolved Hide resolved
holidays/locale/uk/LC_MESSAGES/FI.po Outdated Show resolved Hide resolved
holidays/locale/uk/LC_MESSAGES/FI.po Outdated Show resolved Hide resolved
@alexei-mobal
Copy link
Contributor Author

@alexei-mobal, it's great contribution! I am not very familiar with Finnish traditions and holidays, so I have a few questions here.

  1. There are several more "Official flag days": Kalevala day, Mothers' Day, birthday of C.G.E. Mannerheim, Fathers' Day. I don't know if their celebration is different, but maybe they should be added as well?

Mm, good point! I initially used a mix of holidays mentioned on the wikipedia page and ministry website, but maybe it's better idea to treat information provided by the ministry as single source of truth 👍

  1. It would be great to unify holidays names. I mean those that look like “Birthday of %someone%, day of %something%”. Now some have different names in different languages. I think we can follow the names provided here.

Same as above, I guess I ended up using a mix of names from wikipedia and the ministry website, will use the latter everywhere.

@arkid15r arkid15r changed the title Add Finnish unofficial holidays Update FI: add unofficial holidays Jul 30, 2024
Copy link
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.

Thanks for the PR, please take a look at these comments when you get a chance:

holidays/locale/uk/LC_MESSAGES/FI.po Outdated Show resolved Hide resolved
tests/countries/test_finland.py Outdated Show resolved Hide resolved
tests/countries/test_finland.py Outdated Show resolved Hide resolved
@arkid15r
Copy link
Collaborator

Sonar cloud is apparently not happy with all the year checks in if blocks of new _populate_unofficial_holidays, so I can of course, dunno, split that into some smaller functions if really needed 🤔

Just ignore it, consider it as FYI message.

@alexei-mobal
Copy link
Contributor Author

Ok, @KJhellico @arkid15r I updated PR with all your suggestions; now we don't list recommended flag days (there was only one in first version of this PR), and all names should follow the ones suggested by Finnish Ministry of Interior (with the exception of Ukrainian ones -- those are produced by combined forces of Google translate & my friend 😅 ).

Let me know if I missed something. One last thing I'd do is rebase this on top of latest dev and fix potential conflicts, and maybe squash commit history into one initial commit, since it doesn't carry much meaning right now.

holidays/locale/uk/LC_MESSAGES/FI.po Outdated Show resolved Hide resolved
holidays/locale/uk/LC_MESSAGES/FI.po Outdated Show resolved Hide resolved
tests/countries/test_finland.py Outdated Show resolved Hide resolved
tests/countries/test_finland.py Outdated Show resolved Hide resolved
tests/countries/test_finland.py Outdated Show resolved Hide resolved
tests/countries/test_finland.py Outdated Show resolved Hide resolved
tests/countries/test_finland.py Outdated Show resolved Hide resolved
holidays/countries/finland.py Outdated Show resolved Hide resolved
holidays/countries/finland.py Outdated Show resolved Hide resolved
tests/countries/test_finland.py Show resolved Hide resolved
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 👍

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

LGTM, just a few minor suggestions/comments:

holidays/locale/en_US/LC_MESSAGES/FI.po Show resolved Hide resolved
tests/countries/test_finland.py Outdated Show resolved Hide resolved
holidays/countries/finland.py Outdated Show resolved Hide resolved
tests/countries/test_finland.py Outdated Show resolved Hide resolved
tests/countries/test_finland.py Outdated Show resolved Hide resolved
tests/countries/test_finland.py Outdated Show resolved Hide resolved
tests/countries/test_finland.py Outdated Show resolved Hide resolved
Copy link

sonarcloud bot commented Aug 2, 2024

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

🇫🇮 LGTM

@KJhellico any last minute suggestions?

@arkid15r arkid15r enabled auto-merge August 2, 2024 15:38
Copy link
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.

@alexei-mobal thank you for this contribution and the clean/tested code!

It's great to see another community member efforts for holidays coverage improvement 👍

@arkid15r arkid15r added this pull request to the merge queue Aug 2, 2024
Merged via the queue into vacanza:dev with commit 7d0d59b Aug 2, 2024
25 checks passed
@alexei-mobal alexei-mobal deleted the add-finnish-unofficial-holidays branch August 3, 2024 09:47
@alexei-mobal
Copy link
Contributor Author

@arkid15r you're welcome, happy to contribute! 🙏 And thanks to you and @KJhellico for all the review comments, learned a thing or two myself, I'm not very savvy in python yet :)

@KJhellico KJhellico mentioned this pull request Aug 5, 2024
@arkid15r arkid15r mentioned this pull request Aug 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants